pyiron / ironflow

Prototype of a graphical user interface for pyiron (unstable)
https://mybinder.org/v2/gh/pyiron/ironflow/HEAD?labpath=example.ipynb
BSD 3-Clause "New" or "Revised" License
18 stars 2 forks source link

Onto codevelopment #162

Closed liamhuber closed 1 year ago

liamhuber commented 1 year ago

This is the base PR for integrating ontological typing with pyiron_ontology. The ontology module is still under active development and not even available as a dependency on conda forge yet. This will stay as a draft until that dependency is available.

WARNING: the binder link will fail because the pyiron_ontology dependency is not yet listed!

Since the ontology module is still quite new, I'll be actively developing it together with ironflow until I'm satisfied enough to release it on conda. To get far enough along the ironflow development to really know what I even need from pyiron_ontology would make this a beast of a PR, so I'll use the stacked-PR paradigm again.

In this particular PR, I lay the most fundamental groundwork:

Note that for now I plan to keep all the type checking with the dtype. On the one hand, this makes node definitions a bit verbose, as both dtype and otype should be defined. On the other hand...

As of this PR, you can send Murnaghan output to the material property node and get it correctly converted to the generic units. When building up the graph, where both input and output are ontologically typed, input validation now also confirms that the ontological type being input matches the ontological conditions, and these conditions are collected by traversing the graph downstream and collecting all downstream conditions. Thus, in the simple graph below, the Lammps structure input is aware that it needs a bulk-like structure.

Screen Shot 2023-01-26 at 13 19 12

From here on out we'll make stacked PR's to handle the recommender system. Then hopefully merge and get a release based on a conda-forge version of pyiron_ontology, then extend everything to the surface energy use-case.

Edit: Stacked PRs (to be) merged in

github-actions[bot] commented 1 year ago

Binder :point_left: Launch a binder notebook on branch _pyiron/ironflow/ontocodevelopment

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

liamhuber commented 1 year ago

Updated everything here to pyiron_ontology-0.1.0.

Also updated the logic so that when I search for downstream conditions, only paths where both input and output are otyped actually shows up.

Had to drop the unit conversion, because that's not supported in the ontology library any more (at least for now), but everything else was a pretty straightforward conversion.

Happiest check was to set up the graph pictured above and see struct.outputs.ports.structure.get_downstream_requirements()[0].is_a change from [atomistics.Bulk, atomistics.ThreeD] to [atomistics.Structure] when we disconnect the Lammps node from CalcMurnhaghan (where struct is the BulkStructure node). (This ought to be included in the tests, but given the current developments over in pyiron_contrib between pyiron v1.0 and graph based workflows, I don't want to go overboard spending time on tests here right now...)

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB