You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<spanid="atomate-common-powerups-module"></span><h2>atomate.common.powerups module<aclass="headerlink" href="#module-atomate.common.powerups" title="Permalink to this headline">¶</a></h2>
79
79
<p>This module defines general powerups that can be used for all workflows</p>
<codeclass="sig-prename descclassname">atomate.common.powerups.</code><codeclass="sig-name descname">add_additional_fields_to_taskdocs</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">original_wf</span></em>, <emclass="sig-param"><spanclass="n">update_dict</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">task_name_constraint</span><spanclass="o">=</span><spanclass="default_value">'ToDb'</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#atomate.common.powerups.add_additional_fields_to_taskdocs" title="Permalink to this definition">¶</a></dt>
83
+
<dd><p>For all XXToDbTasks in a given workflow, add information to
84
+
“additional_fields” to be placed in the task doc.</p>
85
+
<dlclass="simple">
86
+
<dt>Args:</dt><dd><p>original_wf (Workflow)
87
+
update_dict (Dict): dictionary to add additional_fields
88
+
task_name_constraint (str): name of the Firetasks to be modified.</p>
89
+
</dd>
90
+
<dt>Returns:</dt><dd><p>Workflow</p>
91
+
</dd>
92
+
</dl>
93
+
</dd></dl>
94
+
95
+
<dlclass="py function">
96
+
<dtid="atomate.common.powerups.add_namefile">
97
+
<codeclass="sig-prename descclassname">atomate.common.powerups.</code><codeclass="sig-name descname">add_namefile</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">original_wf</span></em>, <emclass="sig-param"><spanclass="n">use_slug</span><spanclass="o">=</span><spanclass="default_value">True</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#atomate.common.powerups.add_namefile" title="Permalink to this definition">¶</a></dt>
98
+
<dd><p>Every FireWork begins by writing an empty file with the name
99
+
“FW–<fw.name>”. This makes it easy to figure out what jobs are in what
100
+
launcher directories, e.g. “ls -l launch*/FW–<ahref="#id1"><spanclass="problematic" id="id2">*</span></a>” from within a “block” dir.</p>
101
+
<dlclass="simple">
102
+
<dt>Args:</dt><dd><p>original_wf (Workflow)
103
+
use_slug (bool): whether to replace whitespace-type chars with a slug</p>
104
+
</dd>
105
+
<dt>Returns:</dt><dd><p>Workflow</p>
106
+
</dd>
107
+
</dl>
108
+
</dd></dl>
109
+
110
+
<dlclass="py function">
111
+
<dtid="atomate.common.powerups.add_priority">
112
+
<codeclass="sig-prename descclassname">atomate.common.powerups.</code><codeclass="sig-name descname">add_priority</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">original_wf</span></em>, <emclass="sig-param"><spanclass="n">root_priority</span></em>, <emclass="sig-param"><spanclass="n">child_priority</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#atomate.common.powerups.add_priority" title="Permalink to this definition">¶</a></dt>
113
+
<dd><p>Adds priority to a workflow</p>
114
+
<dl>
115
+
<dt>Args:</dt><dd><p>original_wf (Workflow): original WF
116
+
root_priority (int): priority of first (root) job(s)
117
+
child_priority(int): priority of all child jobs. Defaults to</p>
<codeclass="sig-prename descclassname">atomate.common.powerups.</code><codeclass="sig-name descname">add_tags</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">original_wf</span></em>, <emclass="sig-param"><spanclass="n">tags_list</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#atomate.common.powerups.add_tags" title="Permalink to this definition">¶</a></dt>
130
+
<dd><p>Adds tags to all Fireworks in the Workflow, WF metadata, as well as
131
+
additional_fields for the Drone to track them later (e.g. tag all fireworks
132
+
and tasks related to a specific research project).</p>
133
+
<p>Tags are written to the “_spec” key of each Firework in the workflow and
134
+
to the “metadata.tags” key of each Workflow. If the workflow contains any
135
+
Firetasks ending in “ToDb”, e.g. VaspToDb, QChemToDb, etc., then the tags
136
+
are also passed as “additional_fields” to these tasks and included in the
137
+
resulting task documents.</p>
138
+
<dlclass="simple">
139
+
<dt>Args:</dt><dd><p>original_wf (Workflow)
140
+
tags_list: list of tags parameters (list of strings)</p>
<dt>Args:</dt><dd><p>original_wf: workflow that will be changed
169
+
powerup_dicts: dictionary containing the powerup_name and kwarg.</p>
170
+
<blockquote>
171
+
<div><p>if “.” is present in the name it will be imported as a full path
172
+
if not we will use standard atomate modules where the powerups are kept</p>
173
+
</div></blockquote>
174
+
</dd>
175
+
</dl>
176
+
</dd></dl>
177
+
178
+
<dlclass="py function">
179
+
<dtid="atomate.common.powerups.preserve_fworker">
180
+
<codeclass="sig-prename descclassname">atomate.common.powerups.</code><codeclass="sig-name descname">preserve_fworker</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">original_wf</span></em>, <emclass="sig-param"><spanclass="n">fw_name_constraint</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#atomate.common.powerups.preserve_fworker" title="Permalink to this definition">¶</a></dt>
181
+
<dd><p>set _preserve_fworker spec of Fireworker(s) of a Workflow. Can be used to
182
+
pin a workflow to the first fworker it is run with. Very useful when running
183
+
on multiple machines that can’t share files. fw_name_constraint can be used
184
+
to only preserve fworker after a certain point where file passing becomes
185
+
important</p>
186
+
<dlclass="simple">
187
+
<dt>Args:</dt><dd><p>original_wf (Workflow):
188
+
fw_name_constraint (str): name of the Fireworks to be tagged (all if
189
+
None is passed)</p>
190
+
</dd>
191
+
<dt>Returns:</dt><dd><p>Workflow: modified workflow with specified Fireworkers tagged</p>
0 commit comments