aiidateam / aiida-workgraph

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, and remote execution capabilities.
https://aiida-workgraph.readthedocs.io/en/latest/
MIT License
9 stars 5 forks source link

Add `If` task #222

Closed superstar54 closed 1 month ago

superstar54 commented 1 month ago

Using the If Task

In the WorkGraph user interface, the If Task is visually represented as an "If Zone." This zone encapsulates all its child tasks, which are executed based on the defined conditions.

Example

if2 = wg.add_task("If", name="if_false",
                        conditions=condition1.outputs["result"],
                        invert_condition=True)
if2.children.append("multiply1")
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.56%. Comparing base (5937b88) to head (b1845ce). Report is 23 commits behind head on main.

Files Patch % Lines
tests/test_if.py 95.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #222 +/- ## ========================================== + Coverage 75.75% 76.56% +0.80% ========================================== Files 70 71 +1 Lines 4615 5039 +424 ========================================== + Hits 3496 3858 +362 - Misses 1119 1181 +62 ``` | [Flag](https://app.codecov.io/gh/aiidateam/aiida-workgraph/pull/222/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam) | Coverage Δ | | |---|---|---| | [python-3.11](https://app.codecov.io/gh/aiidateam/aiida-workgraph/pull/222/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam) | `76.56% <98.43%> (+0.89%)` | :arrow_up: | | [python-3.9](https://app.codecov.io/gh/aiidateam/aiida-workgraph/pull/222/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.