Closed liamhuber closed 5 months ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Coverage variation | Diff coverage |
---|---|
:white_check_mark: -0.12% (target: -1.00%) | :white_check_mark: 100.00% |
:rocket: Don’t miss a bit, follow what’s new on Codacy.
Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
create.py | 9 | 92.16% | ||
nodes/standard.py | 12 | 91.72% | ||
<!-- | Total: | 21 | --> |
Totals | |
---|---|
Change from base Build 9473872395: | -0.1% |
Covered Lines: | 3159 |
Relevant Lines: | 3416 |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
create.py | 9 | 92.16% | ||
nodes/standard.py | 12 | 91.67% | ||
<!-- | Total: | 21 | --> |
Totals | |
---|---|
Change from base Build 9473872395: | -0.1% |
Covered Lines: | 3158 |
Relevant Lines: | 3415 |
The current while-loop metanode is (a) not a nice UI at all, and (b) not pickleable (or even easy to read/understand). I set out to replace it with something like the
For
class andfor_node
constructor for for-loops, but didn't find a way of breaking things out well enough to get a clean UI.In lieu of replacing it with a new tool, here I just remove it entirely and replace it with a raw example (in both the deepdive and the integration tests) how you can make a cyclic subgraph directly as a macro. There is still some "universal" aspects to this that I'd love to eventually abstract out to a
@as_while_loop
decorator or something, but in the meantime I found sticking to a plain macro makes it much cleaner to handle setting up both the logic and the IO.As long as body functionality and condition functionality are in turn nicely abstracted into their own nodes/macros, the example below is extremely generic. Note also that since the same nodes get executed multiple times, it also shows how the (new to this PR)
AppendToList
node can be used to track the parts of the history of the loop that is important to you.