Skip to content

CPAlgorithms: re-ordering of blocks with dependencies

Baptiste Ravina requested to merge ravinab/athena:block_orders into main

Config blocks that declare dependencies trigger a re-ordering of the ConfigSequence. The code currently looks up the first index of a block in the sequence that matches the declared dependency, and checks it against the dependent block: if they are in the wrong order, the dependent block is moved to right after the block it depends on.

This breaks down when multiple instances of such blocks are configured. @adohnalo ran into exactly this issue, trying to set up 2 instances of the TriggerAnalysisSF block and 2 instances of the OverlapRemoval block (that TriggerAnalysisSF depends on) with matching settings. The current re-ordering would yield:

  1. Overlap A
  2. Trigger A
  3. Trigger B
  4. Overlap B

i.e. both TriggerAnalysisSF blocks are inserted after the first (by index) OverlapRemoval block.

This MR instead looks up the last index of the dependency, yielding the correct ordering:

  1. Overlap A
  2. Overlap B
  3. Trigger A
  4. Trigger B

Merge request reports

Loading