-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create subsection "Nested workflow" in the docs #277
Conversation
94e0a29
to
b4ed841
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #277 +/- ##
==========================================
+ Coverage 75.75% 80.56% +4.81%
==========================================
Files 70 66 -4
Lines 4615 5156 +541
==========================================
+ Hits 3496 4154 +658
+ Misses 1119 1002 -117
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
16e2070
to
b059def
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the if
and while
task again, because we now have new If
task and while
task, thus there are two ways to implement if
if
task, dose not need nested workgraph- use
graph_builder
, thus nested workgraph.
thus it's better to keep if
and while
separately, and not move to the nested_workgraph
.
I suggest at the end of the graph_builder.py
, we make a link to show the application in the if
and while
.
fb9410e
to
c344a45
Compare
I dont think the graph_builder example is really about the dynamic part as it just forwards inputs like any task does it. We could make another example that runs different tasks depending on the inputs. Something like @task.calcfunction()
def add_one(x):
return x.value+1
@task.calcfunction()
def modulo_five(x):
return x % 5
@graph_builder(outputs = [...])
def my_modular(i: orm.Int):
wg = WorkGraph()
if i.value < 5:
task = wg.add_task(add_one)
else:
task = wg.add_task(modulo_five)
# need wg.selector to expose for linking?
return wg Then one could say that this does not preserve provenance and directly interlude to the |
c344a45
to
7f4145c
Compare
Added an example for a dynamic use case of the graph_builder |
a57e316
to
b3d0cad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @agoscinski , Thanks for the work.
I would suggest not creating a dynamic-workflows
section, but moving all three notebooks into the howto
, so that user can see the dynamic
, if
and while
immediately.
docs/gallery/howto/dynamic_workflows/autogen/dynamic_graph_builder.py
Outdated
Show resolved
Hide resolved
Why ti does not preserve provenance? |
Okay, but the howto's starting to get messy and need some structure at some point, but I think for now one still can put everything there |
I mean more that it does not store provenance as transparently as using the |
I merged now the nested and dynamic example because it seemed strange to see them separate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @agoscinski , thanks for the update!
The dynamic_graph_builder.py
is not used, I think you want to remove it.
Moves the if task and while task examples into this subsection.
8e823f3
to
fe738a0
Compare
Co-authored-by: Xing Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Moves the graph builder, if task and while task examples into this subsection. Also removed the graph_builder.ipynb since it is now generated. Solves issue #195