Skip to content

Commit 331c992

Browse files
authored
Merge pull request #778 from KaplanOpenSource/issue641
docs(pydoc): Complete hermes workflow toolkit docstrings
2 parents b340849 + cceb263 commit 331c992

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

hera/simulations/LSM/hermesWorkflowToolkit.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424

2525
@unique
2626
class actionModes(Enum):
27+
"""Workflow action modes controlling which steps are executed.
28+
29+
- ``ADD`` — add the workflow document to the database only.
30+
- ``ADDBUILD`` — add and build (generate LSM input files).
31+
- ``ADDBUILDEXECUTE`` — add, build, and execute the LSM simulation.
32+
"""
2733
ADD = auto()
2834
ADDBUILD = auto()
2935
ADDBUILDEXECUTE = auto()

hera/simulations/hermesWorkflowToolkit.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
@unique
2727
class actionModes(Enum):
28+
"""Workflow action modes controlling which steps are executed.
29+
30+
- ``ADD`` — add the workflow document to the database only.
31+
- ``ADDBUILD`` — add and build (generate input files).
32+
- ``ADDBUILDEXECUTE`` — add, build, and execute the simulation.
33+
"""
2834
ADD = auto()
2935
ADDBUILD = auto()
3036
ADDBUILDEXECUTE = auto()
@@ -214,6 +220,15 @@ def getHermesWorkflowFromJSON(self, workflow: Union[dict, str], name=None, resou
214220
return hermesWFObj(workFlowJSON, name=name, Resource_path=resource)
215221

216222
def updateDocumentWorkflow(self, document, workflow):
223+
"""Update a simulation document's workflow and parameters in the database.
224+
225+
Parameters
226+
----------
227+
document : MetadataFrame
228+
The simulation document to update.
229+
workflow : hermes.workflow
230+
The workflow object whose JSON and parameters will be stored.
231+
"""
217232
document.desc['workflow'] = workflow.json
218233
document.desc['parameters'] = workflow.parametersJSON
219234
document.save()

0 commit comments

Comments
 (0)