Skip to content

Refactoring of WorkGraphs and input schema#71

Open
t-reents wants to merge 8 commits into
mainfrom
feature/issue-67-relaxation-graph-task
Open

Refactoring of WorkGraphs and input schema#71
t-reents wants to merge 8 commits into
mainfrom
feature/issue-67-relaxation-graph-task

Conversation

@t-reents
Copy link
Copy Markdown
Collaborator

No description provided.

t-reents added 5 commits May 26, 2026 15:35
Moreover, some small restructuring related to the utils.
uniqueness analysis

This simplifies the several stages of relaxation in the big inpainting
workflow. Moreover, it makes it easier to enable symmetry refinement and
uniqueness analysis at different stages of the workflow.
The input schema was significantly adjusted and the inpainting WorkGraph
was also updated to adopt the `task.graph` approach.
Comment thread docs/index.md Outdated
Comment on lines +58 to +59
code_label: AiiDA code label for all inner pythonjob tasks. If
``None``, aiida-pythonjob locates ``python3`` automatically.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should differentiate the different codes. The relaxation is likely on a remote machine, whereas the other post-processing ones can run locally


wg = WorkGraph()
@task.graph
def InpaintingWorkGraph(inputs: XtalPaintConfig):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, each task should potentially receive individual options/computational resources

usempi=inp_opts.withmpi,
metadata={
"call_link_label": "inpainting",
"options": inp_opts.model_dump(exclude={"withmpi"}),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed. The AiiDA withmpi should still be in the options

# Post-relaxation steps
refine: bool = False
refinement_symprec: float = 0.01
refinement_primitive: bool = False
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using the RefinementConfig?

return self.params.model_dump(exclude={"elements_to_relax"})


class RelaxationConfig(RelaxationGraphConfig):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename, to make clear that it's a specific part of the Inpainting workflow.

default_code_label: Optional[str] = None
inpainting_code_label: Optional[str] = None
relax_code_label: Optional[str] = None
candidate_generation_code_label: Optional[str] = None
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add uniqueness and refinement code label?

code=orm.load_code(code_label) if code_label else None,
as_graph_outputs=True,
# --- Pre-refinement (before relaxation) ---
if inputs.pre_refinement is not None:
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Load code label

Comment thread src/xtalpaint/inpainting/config_schema.py Outdated
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.

Move symmetry refinement step after constrained relaxation Add uniqueness analysis task

1 participant