Skip to content
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

Workflow.analyze_structures has no consistent return behaviour #100

Open
liamhuber opened this issue Dec 1, 2023 · 0 comments
Open

Workflow.analyze_structures has no consistent return behaviour #100

liamhuber opened this issue Dec 1, 2023 · 0 comments

Comments

@liamhuber
Copy link
Member

liamhuber commented Dec 1, 2023

Depending on the workflow you might get a dict, or a tuple of floats, or a tuple of dicts. In each individual case these make perfect sense, but overall the variance makes the Workflow class feel disjointed. What about enforcing consistency across return values, e.g. Workflow.analyse_structures(self, output_dict: dict) -> dict?

Advantages:

  • Workflow return values seem pretty clear in the code, e.g. return eng_pot, kinetic_energy, but this is lost to the user who just sees two floats and needs to go look at the docs to figure out their meaning; with a dict those nice variable names could be directly visible
  • It makes it easier to consistently leverage the workflows downstream; e.g. in pyiron_workflow we have a node to extract workflow results and it's named result_dict, but this is not true for some of the workflows even though the node is working perfectly fine.

Ideally one could even use something like a DotDict so the results are both named and tab completable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant