Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3721567
Extend the standard library to include many operators
liamhuber Dec 7, 2023
ee4e789
Use standard nodes
liamhuber Dec 7, 2023
1608779
Add an item node
liamhuber Dec 7, 2023
026a1e5
Format black
pyiron-runner Dec 7, 2023
ebfd9d7
Re-order nodes
liamhuber Dec 7, 2023
e1660f2
Remove the __len__ shortcut for channels
liamhuber Dec 7, 2023
2c30810
Parse (many but not all) operations on output nodes
liamhuber Dec 7, 2023
402beed
Refactor: slide
liamhuber Dec 7, 2023
f1e4b47
Fail with grace when running at initialization but not ready
liamhuber Dec 8, 2023
120246a
Try to run operator injections at the end of initialization
liamhuber Dec 8, 2023
b65ccc4
Extend single value node to use operators like output
liamhuber Dec 8, 2023
93ad2ff
:bug: include GetItem in the standard package
liamhuber Dec 8, 2023
b627a69
Format black
pyiron-runner Dec 8, 2023
d9f4d6a
Merge remote-tracking branch 'origin/inject_output_nodes' into inject…
liamhuber Dec 8, 2023
ae81c6d
Don't define access to the output twice
liamhuber Dec 8, 2023
2646953
Introduce a slice node
liamhuber Dec 8, 2023
7ee7144
Replace the binary and unary injectors with one for arbitrary nargs
liamhuber Dec 8, 2023
89e9356
Make it optional to inject the base channel as the 0th arg
liamhuber Dec 8, 2023
be84f14
Extend getitem to handle slices
liamhuber Dec 8, 2023
12a4259
Add equality and finish multiply
liamhuber Dec 8, 2023
c895cc2
Give Slice's stop input a show-stopping default
liamhuber Dec 8, 2023
90a1810
Start modifying bad operators
liamhuber Dec 8, 2023
bcfdd7e
Refactor: slide
liamhuber Dec 9, 2023
fe5ad80
Add invert on the SingleValue
liamhuber Dec 9, 2023
563e0e7
Redo casts as methods
liamhuber Dec 9, 2023
860250e
Add tests for most of the new operators
liamhuber Dec 9, 2023
d9caaed
Update atomistics notebook
liamhuber Dec 9, 2023
77adf42
Update quickstart
liamhuber Dec 9, 2023
99bd93c
Update deepdive
liamhuber Dec 9, 2023
24de8b3
Update README
liamhuber Dec 9, 2023
2c33750
Format black
pyiron-runner Dec 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,43 @@ Nodes can be used by themselves and -- other than being "delayed" in that their

```

But the intent is to collect them together into a workflow and leverage existing nodes:
But the intent is to collect them together into a workflow and leverage existing nodes. We can directly perform (many but not quite all) python actions natively on output channels, can build up data graph topology by simply assigning values (to attributes or at instantiation), and can package things together into reusable macros with customizable IO interfaces:

```python
>>> from pyiron_workflow import Workflow
>>> Workflow.register("plotting", "pyiron_workflow.node_library.plotting")
>>>
>>> @Workflow.wrap_as.single_value_node()
... def add_one(x):
... return x + 1
... def Arange(n: int):
... import numpy as np
... return np.arange(n)
>>>
>>> @Workflow.wrap_as.macro_node()
... def add_three_macro(macro):
... macro.start = add_one()
... macro.middle = add_one(x=macro.start)
... macro.end = add_one(x=macro.middle)
... macro.inputs_map = {"start__x": "x"}
... macro.outputs_map = {"end__x + 1": "y"}
>>>
>>> Workflow.register(
... "plotting",
... "pyiron_workflow.node_library.plotting"
... )
... def PlotShiftedSquare(macro):
... macro.shift = macro.create.standard.UserInput(0)
... macro.arange = Arange()
... macro.plot = macro.create.plotting.Scatter(
... x=macro.arange + macro.shift,
... y=macro.arange**2
... )
... macro.inputs_map = {
... "shift__user_input": "shift",
... "arange__n": "n",
... }
... macro.outputs_map = {"plot__fig": "fig"}
>>>
>>> wf = Workflow("add_5_and_plot")
>>> wf.add_one = add_one()
>>> wf.add_three = add_three_macro(x=wf.add_one)
>>> wf.plot = wf.create.plotting.Scatter(
... x=wf.add_one,
... y=wf.add_three.outputs.y
... )
>>> wf = Workflow("plot_with_and_without_shift")
>>> wf.n = wf.create.standard.UserInput()
>>> wf.no_shift = PlotShiftedSquare(shift=0, n=10)
>>> wf.shift = PlotShiftedSquare(shift=2, n=10)
>>> wf.inputs_map = {
... "n__user_input": "n",
... "shift__shift": "shift"
... }
>>>
>>> diagram = wf.draw()
>>>
>>> import numpy as np
>>> fig = wf(add_one__x=np.arange(5)).plot__fig
>>> out = wf(shift=3, n=10)

```

Expand All @@ -90,7 +93,7 @@ Which gives the workflow `diagram`

And the resulting `fig`

![](docs/_static/readme_shifted.png)
![](docs/_static/readme_fig.png)

## Installation

Expand Down
Binary file modified docs/_static/readme_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_static/readme_shifted.png
Binary file not shown.
141 changes: 76 additions & 65 deletions notebooks/atomistics_nodes.ipynb

Large diffs are not rendered by default.

Loading