Skip to content

Commit

Permalink
Merge 9690114 into b69ca0b
Browse files Browse the repository at this point in the history
  • Loading branch information
liamhuber committed May 9, 2024
2 parents b69ca0b + 9690114 commit 87751b0
Show file tree
Hide file tree
Showing 77 changed files with 12,652 additions and 10,225 deletions.
20 changes: 11 additions & 9 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ dependencies:
- cloudpickle =3.0.0
- graphviz =9.0.0
- h5io =0.2.2
- h5io_browser =0.0.9
- matplotlib =3.8.3
- pyiron_base =0.7.9
- pyiron_contrib =0.1.15
- pympipool =0.7.13
- h5io_browser =0.0.12
- matplotlib =3.8.4
- pandas =2.2.0
- pyiron_base =0.8.3
- pyiron_contrib =0.1.16
- pympipool =0.8.0
- python-graphviz =0.20.3
- toposort =1.10
- typeguard =4.1.5
- typeguard =4.2.1
- ase =3.22.1
- atomistics =0.1.23
- atomistics =0.1.27
- lammps
- phonopy =2.21.2
- pyiron_atomistics =0.4.17
- matgl = 0.9.2
- phonopy =2.22.1
- pyiron_atomistics =0.5.4
- pyiron-data =0.0.29
- numpy =1.26.4
7 changes: 4 additions & 3 deletions .ci_support/environment-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ channels:
- conda-forge
dependencies:
- ase =3.22.1
- atomistics =0.1.23
- atomistics =0.1.27
- lammps
- phonopy =2.21.2
- pyiron_atomistics =0.4.17
- matgl = 0.9.2
- phonopy =2.22.1
- pyiron_atomistics =0.5.4
- pyiron-data =0.0.29
- numpy =1.26.4
13 changes: 7 additions & 6 deletions .ci_support/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ dependencies:
- cloudpickle =3.0.0
- graphviz =9.0.0
- h5io =0.2.2
- h5io_browser =0.0.9
- matplotlib =3.8.3
- pyiron_base =0.7.9
- pyiron_contrib =0.1.15
- pympipool =0.7.13
- h5io_browser =0.0.12
- matplotlib =3.8.4
- pandas =2.2.0
- pyiron_base =0.8.3
- pyiron_contrib =0.1.16
- pympipool =0.8.0
- python-graphviz =0.20.3
- toposort =1.10
- typeguard =4.1.5
- typeguard =4.2.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ _build/
apidoc/
.ipynb_checkpoints/
test_times.dat
tests/integration/test_notebooks.py
.aider*
31 changes: 13 additions & 18 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Individual node computations can be shipped off to parallel processes for scalab

Once you're happy with a workflow, it can be easily turned it into a macro for use in other workflows. This allows the clean construction of increasingly complex computation graphs by composing simpler graphs.

Nodes (including macros) can be stored in plain text, and registered by future workflows for easy access. This encourages and supports an ecosystem of useful nodes, so you don't need to re-invent the wheel. (This is a beta-feature, with full support of [FAIR](https://en.wikipedia.org/wiki/FAIR_data) principles for node packages planned.)
Nodes (including macros) can be stored in plain text as python code, and registered by future workflows for easy access. This encourages and supports an ecosystem of useful nodes, so you don't need to re-invent the wheel. (This is a beta-feature, with full support of [FAIR](https://en.wikipedia.org/wiki/FAIR_data) principles for node packages planned.)

Executed or partially-executed graphs can be stored to file, either by explicit call or automatically after running. When creating a new node(/macro/workflow), the working directory is automatically inspected for a save-file and the node will try to reload itself if one is found. (This is an alpha-feature, so it is currently only possible to save entire graphs at once and not individual nodes within a graph, all the child nodes in a saved graph must have been instantiated by `Workflow.create` (or equivalent, i.e. their code lives in a `.py` file that has been registered), and there are no safety rails to protect you from changing the node source code between saving and loading (which may cause errors/inconsistencies depending on the nature of the changes).)

Expand All @@ -39,7 +39,7 @@ Nodes can be used by themselves and -- other than being "delayed" in that their
```python
>>> from pyiron_workflow import Workflow
>>>
>>> @Workflow.wrap_as.function_node()
>>> @Workflow.wrap.as_function_node()
... def add_one(x):
... return x + 1
>>>
Expand All @@ -54,33 +54,28 @@ But the intent is to collect them together into a workflow and leverage existing
>>> from pyiron_workflow import Workflow
>>> Workflow.register("pyiron_workflow.node_library.plotting", "plotting")
>>>
>>> @Workflow.wrap_as.function_node()
>>> @Workflow.wrap.as_function_node()
... def Arange(n: int):
... import numpy as np
... return np.arange(n)
>>>
>>> @Workflow.wrap_as.macro_node("fig")
... def PlotShiftedSquare(macro, shift: int = 0):
... macro.arange = Arange()
... macro.plot = macro.create.plotting.Scatter(
... x=macro.arange + shift,
... y=macro.arange**2
>>> @Workflow.wrap.as_macro_node("fig")
... def PlotShiftedSquare(self, n: int, shift: int = 0):
... self.arange = Arange(n)
... self.plot = self.create.plotting.Scatter(
... x=self.arange + shift,
... y=self.arange**2
... )
... macro.inputs_map = {"arange__n": "n"} # Expose arange input
... return macro.plot
... return self.plot
>>>
>>> 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"
... }
>>> wf.no_shift = PlotShiftedSquare(shift=0, n=wf.n)
>>> wf.shift = PlotShiftedSquare(shift=2, n=wf.n)
>>>
>>> diagram = wf.draw()
>>>
>>> out = wf(shift=3, n=10)
>>> out = wf(shift__shift=3, n__user_input=10)

```

Expand Down
13 changes: 7 additions & 6 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ dependencies:
- cloudpickle =3.0.0
- graphviz =9.0.0
- h5io =0.2.2
- h5io_browser =0.0.9
- matplotlib =3.8.3
- pyiron_base =0.7.9
- pyiron_contrib =0.1.15
- pympipool =0.7.13
- h5io_browser =0.0.12
- matplotlib =3.8.4
- pandas =2.2.0
- pyiron_base =0.8.3
- pyiron_contrib =0.1.16
- pympipool =0.8.0
- python-graphviz =0.20.3
- toposort =1.10
- typeguard =4.1.5
- typeguard =4.2.1
30 changes: 23 additions & 7 deletions notebooks/atomistics_nodes.ipynb

Large diffs are not rendered by default.

0 comments on commit 87751b0

Please sign in to comment.