Skip to content

Conversation

GeigerJ2
Copy link
Collaborator

@GeigerJ2 GeigerJ2 commented May 5, 2025

This PR introduces pydantic models for each component of the updated PWD definition, namely PwdInputNode, PwdOutputNode, PwdFunctionNode, PwdEdge, and PwdWorkflow.

It also refactors the AiiDA implementation, adding an AiidaPwdConverter to convert between WG the PWD JSON via the PwdWorkflow intermediate model.

Global inputs and outputs are resolved1 and null ports in the PWD JSON are handled via an internal __result__ port.

As a side effect of me working on this, I added an additional square step to the arithmetic workflow. This can eventually be moved to a separate PR.

One should note, that in the round-trip conversion PWD -> WG -> PWD, currently, some information still gets lost (see footnote below), while it obviously should not. @superstar54 is working on a PR to make group_inputs functional, which should hopefully fix it (I could also hack my way around here for now, but I don't think that makes too much sense).

Footnotes

  1. Well, as far as currently possible, as WG doesn't expose inputs and outputs directly. One can define a mapping of outputs via the group_outputs attribute, see here. An equivalent attribute exists for the inputs, group_inputs, but

@GeigerJ2
Copy link
Collaborator Author

GeigerJ2 commented May 5, 2025

Ping @jan-janssen. Feel free to commit any edits directly here on the PR.

@jan-janssen
Copy link
Member

@GeigerJ2 I copied the pydantic model to #97 - it is a simpler implementation which is converting the pydantic model back to a dictionary once it is validated, so the interfaces for the individual codes remains the same.

@GeigerJ2 GeigerJ2 mentioned this pull request May 14, 2025
@jan-janssen
Copy link
Member

@GeigerJ2 I am going to close this pull request based on the number of changes in main. Feel free to reopen it once it is ready to be merged.

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

Successfully merging this pull request may close these issues.

2 participants