Resolve "Specify internal input/output dependencies of an Operation"
Closes #74 (closed)
Merge request reports
Activity
changed milestone to %Period 2 Kanban
added Feature development + 1 deleted label
added 4 commits
Toggle commit listadded 8 commits
-
7a2ab563...60a87ac1 - 7 commits from branch
develop
- 6c00ee33 - Merge branch 'develop' into '74-specify-internal-input-output-dependencies-of-an-operation'
-
7a2ab563...60a87ac1 - 7 commits from branch
Nice feature! Exactly what is needed to finish my issue, however it would be arithmetically preferable if there was some way to store the dependencies in the operation so that they could be returned as iterables so that the calculation doesn't have to be redone for input / output port combination. Do you think it would be possible to fix this @ivaha717 or should I attempt it?
What do you mean by "returned as iterables"? I can see a solution where SFG would store a "dependency map", i.e. a dictionary from output indices to sets of input indices. As for regular operations, they can choose to implement depends() however efficiently they want. The default implementation just returns True, which is about as efficient as it gets :)
By iterables I mean some way of extracting an iterable collection of input ports that an output port depends on, a dependency map would be great. The calculation is currently expensive for SFG's as it has to traverse the SFG once for every combination of input ports / output ports if one wants to check all combinations.
Edited by Angus LothianI changed it so that the function for checking dependencies returns an iterable, but decided not to store a "dependency map" in the SFG since it may not always be needed, and will in that case take unnecessary time to calculate. If the user wants quick lookup of the dependencies for a certain SFG more than once, they can choose to build and store the dependency map themselves with the following one-liner:
dependency_map = {i: sfg.inputs_required_by_output(i) for i in range(sfg.output_count)}
- Resolved by Angus Lothian
- Resolved by Angus Lothian
Looks good, but added two minor review comments @ivaha717
added 1 commit
- 417e6340 - remove unused dependency map from SFG, simplify dependency tests
mentioned in commit e860e482