Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit c360fbf

Browse files
authored
Merge pull request #191 from pyiron/managing_pyiron_jobs
Managing pyiron jobs
2 parents c7c7d20 + d7ce3b5 commit c360fbf

File tree

6 files changed

+1303
-1082
lines changed

6 files changed

+1303
-1082
lines changed

ironflow/model/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ class attribute.
524524
valid_job_classes = None
525525
init_inputs = [
526526
NodeInputBP(type_="exec", label="run"),
527-
NodeInputBP(type_="exec", label="remove"),
527+
NodeInputBP(type_="exec", label="reset"),
528528
NodeInputBP(dtype=dtypes.String(default="calc"), label="name"),
529529
]
530530
init_outputs = [

ironflow/nodes/pyiron/atomistics_nodes.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ class Project_Node(DataNode):
107107
title = "Project"
108108
init_inputs = [
109109
NodeInputBP(dtype=dtypes.String(default="."), label="name"),
110+
NodeInputBP(label="remove", type_="exec"),
111+
NodeInputBP(label="enable_remove", dtype=dtypes.Boolean(default=False)),
112+
NodeInputBP(label="remove_name", dtype=dtypes.String()),
113+
NodeInputBP(label="remove_all", dtype=dtypes.Boolean(default=False)),
114+
NodeInputBP(label="recursive", dtype=dtypes.Boolean(default=True)),
110115
]
111116
init_outputs = [
112117
NodeOutputBP(
@@ -117,6 +122,23 @@ class Project_Node(DataNode):
117122
]
118123
color = "#aabb44"
119124

125+
def update_event(self, inp=-1):
126+
if inp == 1:
127+
if self.inputs.values.enable_remove:
128+
if self.inputs.values.remove_all:
129+
self.outputs.values.project.remove_jobs(
130+
recursive=self.inputs.values.recursive, silently=True
131+
)
132+
else:
133+
self.outputs.values.project.remove_job(
134+
self.inputs.values.remove_name
135+
)
136+
else:
137+
InfoMsgs.write(
138+
"`enable_remove` must be set to `True` before removing jobs."
139+
)
140+
super().update_event(inp=inp)
141+
120142
def node_function(self, name, **kwargs) -> dict:
121143
return {"project": Project(name)}
122144

notebooks/bulk_modulus.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
" - Observe: Without knowing a-priori which nodes we need to use, we simply follow recommendations to populate our graph\n",
4747
" - Observe: When `Lammps.outputs.engine` is connected to `CalcMurnaghan.inputs.engine`, the only recommendation for `Lammps.inputs.structure` is `BulkStructure` -- but when we disconnect these, Lammps sees both `BulkStructure` _and_ `SlabStructure`! This is because the requirements of the Murnaghan job to be calculated on a bulk structure get propogated upstream by the graph and processed by the ontology reasoner. \n",
4848
"11. Run the `CalcMurnaghan` job\n",
49-
" - Observe: If you use `SHOW` to investigate the `CalcMurnaghan` and `MaterialProperty` node outputs, you'll see that the bulk modulus gets converted from the Murnaghan units of GPa to the ontology's units of MPa.\n",
5049
"12. Select `MaterialProperty` again, and choose `B_prime` from the `property` dropdown.\n",
5150
" - Observe: The `eq_bulk_modulus` output of `CalcMurnaghan` still has a green (valid) output port, but the `source` input port of `MaterialProperty` is now red (invalid) -- this is because the provided ontological type no longer matches the requested property.\n",
5251
"13. Click on the `source` input port again; disconnect it from `eq_bulk_modulus` and reconnect it to the recommended port."

0 commit comments

Comments
 (0)