pyiron / pyiron/atomistics

`Workflow.analyze_structures` has no consistent return behaviour

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
10
Forks
4
Avg merge
12h 31m
Merged PRs (30d)
13

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the return paths of Workflow.analyze_structures across the workflow implementations, including atomistics/workflows/langevin/workflow.py around line 137. Review the linked pyiron_workflow DotDict and result_dict usage to define a consistent result contract. Done means workflows expose consistently named results and downstream extraction remains compatible.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.