-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathatomate.utils.html
474 lines (438 loc) · 27.4 KB
/
atomate.utils.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>atomate.utils package — atomate 1.0.3 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">atomate 1.0.3 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">atomate.utils package</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="atomate-utils-package">
<h1>atomate.utils package<a class="headerlink" href="#atomate-utils-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="atomate.utils.tests.html">atomate.utils.tests package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="atomate.utils.tests.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="atomate.utils.tests.html#atomate-utils-tests-test-database-module">atomate.utils.tests.test_database module</a></li>
<li class="toctree-l2"><a class="reference internal" href="atomate.utils.tests.html#module-atomate.utils.tests.test_loaders">atomate.utils.tests.test_loaders module</a></li>
<li class="toctree-l2"><a class="reference internal" href="atomate.utils.tests.html#module-atomate.utils.tests.test_utils">atomate.utils.tests.test_utils module</a></li>
<li class="toctree-l2"><a class="reference internal" href="atomate.utils.tests.html#module-atomate.utils.tests">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="atomate-utils-database-module">
<h2>atomate.utils.database module<a class="headerlink" href="#atomate-utils-database-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-atomate.utils.fileio">
<span id="atomate-utils-fileio-module"></span><h2>atomate.utils.fileio module<a class="headerlink" href="#module-atomate.utils.fileio" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt id="atomate.utils.fileio.FileClient">
<em class="property">class </em><code class="sig-prename descclassname">atomate.utils.fileio.</code><code class="sig-name descname">FileClient</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">filesystem</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">private_key</span><span class="o">=</span><span class="default_value">'~/.ssh/id_rsa'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A client for performing many file operations while being agnostic
of whether those operations are happening locally or via SSH</p>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">filesystem</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">private_key</span><span class="o">=</span><span class="default_value">'~/.ssh/id_rsa'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.__init__" title="Permalink to this definition">¶</a></dt>
<dd><dl class="simple">
<dt>Args:</dt><dd><dl class="simple">
<dt>filesystem (str): remote filesystem, e.g. <a class="reference external" href="mailto:username%40remote_host">username<span>@</span>remote_host</a>.</dt><dd><p>If None, use local</p>
</dd>
<dt>private_key (str): path to the private key file (for remote</dt><dd><p>connections only). Note: passwordless ssh login must be setup</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.abspath">
<code class="sig-name descname">abspath</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.abspath" title="Permalink to this definition">¶</a></dt>
<dd><p>return the absolute path</p>
<dl class="simple">
<dt>Args:</dt><dd><p>path (str): path to get absolute string of</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.copy">
<code class="sig-name descname">copy</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">src</span></em>, <em class="sig-param"><span class="n">dest</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy from source to destination.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>src (str): source full path
dest (str): destination file full path</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.exists">
<em class="property">static </em><code class="sig-name descname">exists</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sftp</span></em>, <em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.exists" title="Permalink to this definition">¶</a></dt>
<dd><p>os.path.exists() for paramiko’s SCP object</p>
<dl class="simple">
<dt>Args:</dt><dd><p>sftp (SFTPClient):
path (str): path to check existence of</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.get_ssh_connection">
<em class="property">static </em><code class="sig-name descname">get_ssh_connection</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">username</span></em>, <em class="sig-param"><span class="n">host</span></em>, <em class="sig-param"><span class="n">private_key</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.get_ssh_connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Connect to the remote host via paramiko using the private key.
If the host key is not present it will be added automatically.</p>
<dl>
<dt>Args:</dt><dd><p>username (str):
host (str):</p>
<p>private_key (str): path to private key file</p>
</dd>
<dt>Returns:</dt><dd><p>SSHClient</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.glob">
<code class="sig-name descname">glob</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.glob" title="Permalink to this definition">¶</a></dt>
<dd><p>return the glob</p>
<dl class="simple">
<dt>Args:</dt><dd><p>path (str): path to glob</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.fileio.FileClient.listdir">
<code class="sig-name descname">listdir</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ldir</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.fileio.FileClient.listdir" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the directory listing from either the local or remote filesystem.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>ldir (str): full path to the directory</p>
</dd>
<dt>Returns:</dt><dd><p>iterator of filenames</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-atomate.utils.testing">
<span id="atomate-utils-testing-module"></span><h2>atomate.utils.testing module<a class="headerlink" href="#module-atomate.utils.testing" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt id="atomate.utils.testing.AtomateTest">
<em class="property">class </em><code class="sig-prename descclassname">atomate.utils.testing.</code><code class="sig-name descname">AtomateTest</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">methodName</span><span class="o">=</span><span class="default_value">'runTest'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.testing.AtomateTest" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">unittest.case.TestCase</span></code></p>
<dl class="py method">
<dt id="atomate.utils.testing.AtomateTest.get_task_collection">
<code class="sig-name descname">get_task_collection</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coll_name</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.testing.AtomateTest.get_task_collection" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns pymongo collection</p>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.testing.AtomateTest.get_task_database">
<code class="sig-name descname">get_task_database</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.testing.AtomateTest.get_task_database" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns pymongo db connection.</p>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.testing.AtomateTest.setUp">
<code class="sig-name descname">setUp</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lpad</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.testing.AtomateTest.setUp" title="Permalink to this definition">¶</a></dt>
<dd><p>Create scratch directory(removes the old one if there is one) and change to it.
Also initialize launchpad.</p>
</dd></dl>
<dl class="py method">
<dt id="atomate.utils.testing.AtomateTest.tearDown">
<code class="sig-name descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.testing.AtomateTest.tearDown" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove the scratch directory and teardown the test db.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-atomate.utils.utils">
<span id="atomate-utils-utils-module"></span><h2>atomate.utils.utils module<a class="headerlink" href="#module-atomate.utils.utils" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt id="atomate.utils.utils.env_chk">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">env_chk</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">val</span></em>, <em class="sig-param"><span class="n">fw_spec</span></em>, <em class="sig-param"><span class="n">strict</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">default</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.env_chk" title="Permalink to this definition">¶</a></dt>
<dd><p>env_chk() is a way to set different values for a property depending
on the worker machine. For example, you might have slightly different
executable names or scratch directories on different machines.</p>
<p>env_chk() works using the principles of the FWorker env in FireWorks.</p>
<p>This helper method translates string “val” that looks like this:
“>>ENV_KEY<<”
to the contents of:
fw_spec[“_fw_env”][ENV_KEY]</p>
<p>Otherwise, the string “val” is interpreted literally and passed-through as is.</p>
<p>The fw_spec[“_fw_env”] is in turn set by the FWorker. For more details,
see: <a class="reference external" href="https://materialsproject.github.io/fireworks/worker_tutorial.html">https://materialsproject.github.io/fireworks/worker_tutorial.html</a></p>
<p>Since the fw_env can be set differently for each FireWorker, one can
use this method to translate a single “val” into multiple possibilities,
thus achieving different behavior on different machines.</p>
<dl>
<dt>Args:</dt><dd><p>val: any value, with “>><<” notation reserved for special env lookup values
fw_spec: (dict) fw_spec where one can find the _fw_env keys
strict (bool): if True, errors if env format (>><<) specified but cannot be found in fw_spec
default: if val is None or env cannot be found in non-strict mode,</p>
<blockquote>
<div><p>return default</p>
</div></blockquote>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_a_unique_id">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_a_unique_id</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_a_unique_id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_database">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_database</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">config_file</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">settings</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">admin</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_database" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_fws_and_tasks">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_fws_and_tasks</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">workflow</span></em>, <em class="sig-param"><span class="n">fw_name_constraint</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">task_name_constraint</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_fws_and_tasks" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper method: given a workflow, returns back the fw_ids and task_ids that match name
constraints. Used in developing multiple powerups.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>workflow (Workflow): Workflow
fw_name_constraint (str): a constraint on the FW name
task_name_constraint (str): a constraint on the task name</p>
</dd>
<dt>Returns:</dt><dd><p>a list of tuples of the form (fw_id, task_id) of the RunVasp-type tasks</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_logger">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_logger</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">level=10</em>, <em class="sig-param">log_format='%(asctime)s %(levelname)s %(name)s %(message)s'</em>, <em class="sig-param">stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_logger" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_meta_from_structure">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_meta_from_structure</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">structure</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_meta_from_structure" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_mongolike">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_mongolike</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">d</span></em>, <em class="sig-param"><span class="n">key</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_mongolike" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve a dict value using dot-notation like “a.b.c” from dict {“a”:{“b”:{“c”: 3}}}
Args:</p>
<blockquote>
<div><p>d (dict): the dictionary to search
key (str): the key we want to retrieve with dot notation, e.g., “a.b.c”</p>
</div></blockquote>
<dl class="simple">
<dt>Returns:</dt><dd><p>value from desired dict (whatever is stored at the desired key)</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_uri">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_uri</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dir_name</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_uri" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the URI path for a directory. This allows files hosted on
different file servers to have distinct locations.
Args:</p>
<blockquote>
<div><dl class="simple">
<dt>dir_name:</dt><dd><p>A directory name.</p>
</dd>
</dl>
</div></blockquote>
<dl class="simple">
<dt>Returns:</dt><dd><p>Full URI path, e.g., fileserver.host.com:/full/path/of/dir_name.</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.get_wf_from_spec_dict">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">get_wf_from_spec_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">structure</span></em>, <em class="sig-param"><span class="n">wfspec</span></em>, <em class="sig-param"><span class="n">common_param_updates</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.get_wf_from_spec_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Load a WF from a structure and a spec dict. This allows simple
custom workflows to be constructed quickly via a YAML file.</p>
<dl>
<dt>Args:</dt><dd><p>structure (Structure): An input structure object.
wfspec (dict): A dict specifying workflow. A sample of the dict in</p>
<blockquote>
<div><p>YAML format for the usual MP workflow is given as follows:</p>
<p><a href="#id1"><span class="problematic" id="id2">``</span></a>`
fireworks:
- fw: atomate.vasp.fireworks.core.OptimizeFW
- fw: atomate.vasp.fireworks.core.StaticFW</p>
<blockquote>
<div><dl class="simple">
<dt>params:</dt><dd><p>parents: 0</p>
</dd>
</dl>
</div></blockquote>
<ul>
<li><p>fw: atomate.vasp.fireworks.core.NonSCFUniformFW
params:</p>
<blockquote>
<div><p>parents: 1</p>
</div></blockquote>
</li>
<li><p>fw: atomate.vasp.fireworks.core.NonSCFLineFW
params:</p>
<blockquote>
<div><p>parents: 1</p>
</div></blockquote>
</li>
</ul>
<dl class="simple">
<dt>common_params:</dt><dd><p>db_file: db.json
$vasp_cmd: $HOME/opt/vasp</p>
</dd>
</dl>
<p>name: bandstructure
metadata:</p>
<blockquote>
<div><p>tag: testing_workflow</p>
</div></blockquote>
<p><a href="#id3"><span class="problematic" id="id4">``</span></a><a href="#id5"><span class="problematic" id="id6">`</span></a></p>
<p>The <cite>fireworks</cite> key is a list of Fireworks; it is expected that
all such Fireworks have “structure” as the first argument and
other optional arguments following that. Each Firework is specified
via “fw”: <explicit path>.</p>
<p>You can pass arguments into the constructor using the special
keyword <cite>params</cite>, which is a dict. Any param starting with a $ will
be expanded using environment variables.If multiple fireworks share
the same <cite>params</cite>, you can use <cite>common_params</cite> to specify a common
set of arguments that are passed to all fireworks. Local params
take precedent over global params.</p>
<p>Another special keyword is <cite>parents</cite>, which provides
the <em>indices</em> of the parents of that particular Firework in the
list. This allows you to link the Fireworks into a logical
workflow.</p>
<p>Finally, <cite>name</cite> is used to set the Workflow name
(structure formula + name) which can be helpful in record keeping.</p>
</div></blockquote>
<p>common_param_updates (dict): A dict specifying any user-specified updates to common_params</p>
</dd>
<dt>Returns:</dt><dd><p>Workflow</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.load_class">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">load_class</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">modulepath</span></em>, <em class="sig-param"><span class="n">classname</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.load_class" title="Permalink to this definition">¶</a></dt>
<dd><p>Load and return the class from the given module.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>modulepath (str): dotted path to the module. eg: “pymatgen.io.vasp.sets”
classname (str): name of the class to be loaded.</p>
</dd>
<dt>Returns:</dt><dd><p>class</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.recursive_get_result">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">recursive_get_result</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">d</span></em>, <em class="sig-param"><span class="n">result</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.recursive_get_result" title="Permalink to this definition">¶</a></dt>
<dd><p>Function that gets designated keys or values of d
(i. e. those that start with “d>>” or “a>>”) from
the corresponding entry in result_dict, similar to
FireWorks recursive_deserialize.</p>
<p>Note that the plain “>>” notation will get a key from
the result.as_dict() object and may use MongoDB
dot notation, while “a>>” will get an attribute
of the object.</p>
<p>Examples:</p>
<dl class="simple">
<dt>Getting a dict key from a VaspRun instance:</dt><dd><p>recursive_get_result({“stress”:”>>output.ionic_steps.-1.stress”}, vasprun)
–> {“stress”:[[0.2, 0, 0], [0, 0.3, 0], [0, 0, 0.3]]}</p>
</dd>
<dt>Getting an <strong>attribute</strong> from a vasprun:</dt><dd><p>recursive_get_result({“epsilon”:”a>>epsilon_static”, vasprun}
–> {“epsilon”:-3.4}</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="atomate.utils.utils.recursive_update">
<code class="sig-prename descclassname">atomate.utils.utils.</code><code class="sig-name descname">recursive_update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">d</span></em>, <em class="sig-param"><span class="n">u</span></em><span class="sig-paren">)</span><a class="headerlink" href="#atomate.utils.utils.recursive_update" title="Permalink to this definition">¶</a></dt>
<dd><p>Recursive updates d with values from u
Args:</p>
<blockquote>
<div><p>d (dict): dict to update
u (dict): updates to propagate</p>
</div></blockquote>
</dd></dl>
</div>
<div class="section" id="module-atomate.utils">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-atomate.utils" title="Permalink to this headline">¶</a></h2>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">atomate.utils package</a><ul>
<li><a class="reference internal" href="#subpackages">Subpackages</a></li>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#atomate-utils-database-module">atomate.utils.database module</a></li>
<li><a class="reference internal" href="#module-atomate.utils.fileio">atomate.utils.fileio module</a></li>
<li><a class="reference internal" href="#module-atomate.utils.testing">atomate.utils.testing module</a></li>
<li><a class="reference internal" href="#module-atomate.utils.utils">atomate.utils.utils module</a></li>
<li><a class="reference internal" href="#module-atomate.utils">Module contents</a></li>
</ul>
</li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/atomate.utils.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">atomate 1.0.3 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">atomate.utils package</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2015, Anubhav Jain.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>