Skip to content

add dependencies to blocks and reorder based on that

Blocks can depend on other blocks. This merge request introduces block names, block dependencies and a mechanism to reorder blocks based on these dependencies.

To declare a dependency for a block, you can call

addDependency(blockName="OverlapRemoval", required=False)

in the __init__ function of the class definition. In this example, adding the above line of code to the JVT block, would move the JVT block after OverlapRemoval, if it is present, during the fullConfigure step; otherwise, the JVT block will not be moved. If required is set to True (default), the code will throw an error if theOverlapRemoval block is not present.

When a dependency is added to a block, an option named ignoreDependencies will automatically be added to the block. The option is a list and expects the name of one or more dependencies. In the example above, we can ignore the dependency on OverlapRemoval for JVT by adding the following to the yaml file:

        - OverlapRemoval

You can do the same for the block configuration as well.

Note: the mechanism that moves blocks can only move blocks forward. This can be extended, if desired.

Edited by Joseph Earl Lambert

Merge request reports