forked from materialsproject/pymatgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pymatgen.ext.matproj.html
966 lines (917 loc) · 58.4 KB
/
pymatgen.ext.matproj.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
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pymatgen.ext.matproj module — pymatgen 2019.5.1 documentation</title>
<link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</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">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pymatgen.ext.matproj">
<span id="pymatgen-ext-matproj-module"></span><h1>pymatgen.ext.matproj module<a class="headerlink" href="#module-pymatgen.ext.matproj" title="Permalink to this headline">¶</a></h1>
<dl class="exception">
<dt id="pymatgen.ext.matproj.MPRestError">
<em class="property">exception </em><code class="descname">MPRestError</code><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRestError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRestError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p>
<p>Exception class for MPRestAdaptor.
Raised when the query has problems, e.g., bad query format.</p>
</dd></dl>
<dl class="class">
<dt id="pymatgen.ext.matproj.MPRester">
<em class="property">class </em><code class="descname">MPRester</code><span class="sig-paren">(</span><em>api_key=None</em>, <em>endpoint=None</em>, <em>include_user_agent=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>A class to conveniently interface with the Materials Project REST
interface. The recommended way to use MPRester is with the “with” context
manager to ensure that sessions are properly closed after usage:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">with</span> <span class="n">MPRester</span><span class="p">(</span><span class="s2">"API_KEY"</span><span class="p">)</span> <span class="k">as</span> <span class="n">m</span><span class="p">:</span>
<span class="n">do_something</span>
</pre></div>
</div>
<p>MPRester uses the “requests” package, which provides for HTTP connection
pooling. All connections are made via https for security.</p>
<p>For more advanced uses of the Materials API, please consult the API
documentation at <a class="reference external" href="https://github.com/materialsproject/mapidoc">https://github.com/materialsproject/mapidoc</a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>api_key</strong> (<em>str</em>) – A String API key for accessing the MaterialsProject
REST interface. Please obtain your API key at
<a class="reference external" href="https://www.materialsproject.org/dashboard">https://www.materialsproject.org/dashboard</a>. If this is None,
the code will check if there is a “PMG_MAPI_KEY” setting.
If so, it will use that environment variable. This makes
easier for heavy users to simply add this environment variable to
their setups and MPRester can then be called without any arguments.</p></li>
<li><p><strong>endpoint</strong> (<em>str</em>) – Url of endpoint to access the MaterialsProject REST
interface. Defaults to the standard Materials Project REST
address at “<a class="reference external" href="https://materialsproject.org/rest/v2">https://materialsproject.org/rest/v2</a>”, but
can be changed to other urls implementing a similar interface.</p></li>
<li><p><strong>include_user_agent</strong> (<em>bool</em>) – If True, will include a user agent with the
HTTP request including information on pymatgen and system version
making the API request. This helps MP support pymatgen users, and
is similar to what most web browsers send with each page request.
Set to False to disable the user agent.</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.delete_snl">
<code class="descname">delete_snl</code><span class="sig-paren">(</span><em>snl_ids</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.delete_snl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.delete_snl" title="Permalink to this definition">¶</a></dt>
<dd><p>Delete earlier submitted SNLs.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>snl_ids</strong> – List of SNL ids.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><a class="reference internal" href="#pymatgen.ext.matproj.MPRestError" title="pymatgen.ext.matproj.MPRestError"><strong>MPRestError</strong></a> – </p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.find_structure">
<code class="descname">find_structure</code><span class="sig-paren">(</span><em>filename_or_structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.find_structure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.find_structure" title="Permalink to this definition">¶</a></dt>
<dd><p>Finds matching structures on the Materials Project site.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>filename_or_structure</strong> – filename or Structure object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of matching structures.</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pymatgen.ext.matproj.MPRestError" title="pymatgen.ext.matproj.MPRestError"><strong>MPRestError</strong></a> – </p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_all_substrates">
<code class="descname">get_all_substrates</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_all_substrates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_all_substrates" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets the list of all possible substrates considered in the
Materials Project substrate database</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>list of material_ids corresponding to possible substrates</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_bandstructure_by_material_id">
<code class="descname">get_bandstructure_by_material_id</code><span class="sig-paren">(</span><em>material_id</em>, <em>line_mode=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_bandstructure_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_bandstructure_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a BandStructure corresponding to a material_id.</p>
<p>REST Endpoint: <a class="reference external" href="https://www.materialsproject.org/rest/v2/materials">https://www.materialsproject.org/rest/v2/materials</a>/<mp-id>/vasp/bandstructure or
<a class="reference external" href="https://www.materialsproject.org/rest/v2/materials">https://www.materialsproject.org/rest/v2/materials</a>/<mp-id>/vasp/bandstructure_uniform</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id.</p></li>
<li><p><strong>line_mode</strong> (<em>bool</em>) – If True, fetch a BandStructureSymmLine object
(default). If False, return the uniform band structure.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A BandStructure object.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_cohesive_energy">
<code class="descname">get_cohesive_energy</code><span class="sig-paren">(</span><em>material_id</em>, <em>per_atom=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_cohesive_energy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_cohesive_energy" title="Permalink to this definition">¶</a></dt>
<dd><dl class="simple">
<dt>Gets the cohesive for a material (eV per formula unit). Cohesive energy</dt><dd><p>is defined as the difference between the bulk energy and the sum of
total DFT energy of isolated atoms for atom elements in the bulk.</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id, e.g. ‘mp-123’.</p></li>
<li><p><strong>per_atom</strong> (<em>bool</em>) – Whether or not to return cohesive energy per atom</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Cohesive energy (eV).</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_data">
<code class="descname">get_data</code><span class="sig-paren">(</span><em>chemsys_formula_id</em>, <em>data_type='vasp'</em>, <em>prop=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.</p>
<p>Format of REST return is <em>always</em> a list of dict (regardless of the
number of pieces of data returned. The general format is as follows:</p>
<p>[{“material_id”: material_id, “property_name” : value}, …]</p>
<p>This is generally a call to
<a class="reference external" href="https://www.materialsproject.org/rest/v2/materials/vasp">https://www.materialsproject.org/rest/v2/materials/vasp</a>/<prop>.
See <a class="reference external" href="https://github.com/materialsproject/mapidoc">https://github.com/materialsproject/mapidoc</a> for details.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chemsys_formula_id</strong> (<em>str</em>) – A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e.g., mp-1234).</p></li>
<li><p><strong>data_type</strong> (<em>str</em>) – Type of data to return. Currently can either be
“vasp” or “exp”.</p></li>
<li><p><strong>prop</strong> (<em>str</em>) – Property to be obtained. Should be one of the
MPRester.supported_task_properties. Leave as empty string for a
general list of useful properties.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_doc">
<code class="descname">get_doc</code><span class="sig-paren">(</span><em>materials_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_doc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_doc" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the entire data document for one materials id. Use this judiciously.</p>
<p>REST Endpoint: <a class="reference external" href="https://www.materialsproject.org/materials">https://www.materialsproject.org/materials</a>/<mp-id>/doc.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>materials_id</strong> (<em>str</em>) – E.g., mp-1143 for Al2O3</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Dict of json document of all data that is displayed on a materials
details page.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_dos_by_material_id">
<code class="descname">get_dos_by_material_id</code><span class="sig-paren">(</span><em>material_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_dos_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_dos_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a Dos corresponding to a material_id.</p>
<p>REST Endpoint: <a class="reference external" href="https://www.materialsproject.org/rest/v2/materials">https://www.materialsproject.org/rest/v2/materials</a>/<mp-id>/vasp/dos</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id (a string,
e.g., mp-1234).</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Dos object.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_entries">
<code class="descname">get_entries</code><span class="sig-paren">(</span><em>chemsys_formula_id_criteria</em>, <em>compatible_only=True</em>, <em>inc_structure=None</em>, <em>property_data=None</em>, <em>conventional_unit_cell=False</em>, <em>sort_by_e_above_hull=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_entries"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_entries" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a list of ComputedEntries or ComputedStructureEntries corresponding
to a chemical system, formula, or materials_id or full criteria.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chemsys_formula_id_criteria</strong> (<em>str/dict</em>) – A chemical system
(e.g., Li-Fe-O), or formula (e.g., Fe2O3) or materials_id
(e.g., mp-1234) or full Mongo-style dict criteria.</p></li>
<li><p><strong>compatible_only</strong> (<em>bool</em>) – Whether to return only “compatible”
entries. Compatible entries are entries that have been
processed using the MaterialsProjectCompatibility class,
which performs adjustments to allow mixing of GGA and GGA+U
calculations for more accurate phase diagrams and reaction
energies.</p></li>
<li><p><strong>inc_structure</strong> (<em>str</em>) – If None, entries returned are
ComputedEntries. If inc_structure=”initial”,
ComputedStructureEntries with initial structures are returned.
Otherwise, ComputedStructureEntries with final structures
are returned.</p></li>
<li><p><strong>property_data</strong> (<em>list</em>) – Specify additional properties to include in
entry.data. If None, no data. Should be a subset of
supported_properties.</p></li>
<li><p><strong>conventional_unit_cell</strong> (<em>bool</em>) – Whether to get the standard
conventional unit cell</p></li>
<li><p><strong>sort_by_e_above_hull</strong> (<em>bool</em>) – Whether to sort the list of entries by
e_above_hull (will query e_above_hull as a property_data if True).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of ComputedEntry or ComputedStructureEntry objects.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_entries_in_chemsys">
<code class="descname">get_entries_in_chemsys</code><span class="sig-paren">(</span><em>elements</em>, <em>compatible_only=True</em>, <em>inc_structure=None</em>, <em>property_data=None</em>, <em>conventional_unit_cell=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_entries_in_chemsys"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_entries_in_chemsys" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper method to get a list of ComputedEntries in a chemical system.
For example, elements = [“Li”, “Fe”, “O”] will return a list of all
entries in the Li-Fe-O chemical system, i.e., all LixOy,
FexOy, LixFey, LixFeyOz, Li, Fe and O phases. Extremely useful for
creating phase diagrams of entire chemical systems.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>elements</strong> (<em>[</em><em>str</em><em>]</em>) – List of element symbols, e.g., [“Li”, “Fe”,
“O”].</p></li>
<li><p><strong>compatible_only</strong> (<em>bool</em>) – Whether to return only “compatible”
entries. Compatible entries are entries that have been
processed using the MaterialsProjectCompatibility class,
which performs adjustments to allow mixing of GGA and GGA+U
calculations for more accurate phase diagrams and reaction
energies.</p></li>
<li><p><strong>inc_structure</strong> (<em>str</em>) – If None, entries returned are
ComputedEntries. If inc_structure=”final”,
ComputedStructureEntries with final structures are returned.
Otherwise, ComputedStructureEntries with initial structures
are returned.</p></li>
<li><p><strong>property_data</strong> (<em>list</em>) – Specify additional properties to include in
entry.data. If None, no data. Should be a subset of
supported_properties.</p></li>
<li><p><strong>conventional_unit_cell</strong> (<em>bool</em>) – Whether to get the standard
conventional unit cell</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of ComputedEntries.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_entry_by_material_id">
<code class="descname">get_entry_by_material_id</code><span class="sig-paren">(</span><em>material_id</em>, <em>compatible_only=True</em>, <em>inc_structure=None</em>, <em>property_data=None</em>, <em>conventional_unit_cell=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_entry_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_entry_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a ComputedEntry corresponding to a material_id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id (a string,
e.g., mp-1234).</p></li>
<li><p><strong>compatible_only</strong> (<em>bool</em>) – Whether to return only “compatible”
entries. Compatible entries are entries that have been
processed using the MaterialsProjectCompatibility class,
which performs adjustments to allow mixing of GGA and GGA+U
calculations for more accurate phase diagrams and reaction
energies.</p></li>
<li><p><strong>inc_structure</strong> (<em>str</em>) – If None, entries returned are
ComputedEntries. If inc_structure=”final”,
ComputedStructureEntries with final structures are returned.
Otherwise, ComputedStructureEntries with initial structures
are returned.</p></li>
<li><p><strong>property_data</strong> (<em>list</em>) – Specify additional properties to include in
entry.data. If None, no data. Should be a subset of
supported_properties.</p></li>
<li><p><strong>conventional_unit_cell</strong> (<em>bool</em>) – Whether to get the standard
conventional unit cell</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>ComputedEntry or ComputedStructureEntry object.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_exp_entry">
<code class="descname">get_exp_entry</code><span class="sig-paren">(</span><em>formula</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_exp_entry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_exp_entry" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an ExpEntry object, which is the experimental equivalent of a
ComputedEntry and can be used for analyses using experimental data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>formula</strong> (<em>str</em>) – A formula to search for.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An ExpEntry object.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_exp_thermo_data">
<code class="descname">get_exp_thermo_data</code><span class="sig-paren">(</span><em>formula</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_exp_thermo_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_exp_thermo_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a list of ThermoData objects associated with a formula using the
Materials Project REST interface.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>formula</strong> (<em>str</em>) – A formula to search for.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of ThermoData objects.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_interface_reactions">
<code class="descname">get_interface_reactions</code><span class="sig-paren">(</span><em>reactant1</em>, <em>reactant2</em>, <em>open_el=None</em>, <em>relative_mu=None</em>, <em>use_hull_energy=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_interface_reactions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_interface_reactions" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets critical reactions between two reactants.</p>
<p>Get critical reactions (“kinks” in the mixing ratio where
reaction products change) between two reactants. See the
<cite>pymatgen.analysis.interface_reactions</cite> module for more info.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>reactant1</strong> (<em>str</em>) – Chemical formula for reactant</p></li>
<li><p><strong>reactant2</strong> (<em>str</em>) – Chemical formula for reactant</p></li>
<li><p><strong>open_el</strong> (<em>str</em>) – Element in reservoir available to system</p></li>
<li><p><strong>relative_mu</strong> (<em>float</em>) – Relative chemical potential of element in
reservoir with respect to pure substance. Must be non-positive.</p></li>
<li><p><strong>use_hull_energy</strong> (<em>bool</em>) – Whether to use the convex hull energy for a</p></li>
<li><p><strong>composition for the reaction energy calculation. If false</strong><strong>,</strong> (<em>given</em>) – </p></li>
<li><p><strong>energy of the ground state structure will be preferred; if a</strong> (<em>the</em>) – </p></li>
<li><p><strong>state can not be found for a composition</strong><strong>, </strong><strong>the convex hull</strong> (<em>ground</em>) – </p></li>
<li><p><strong>will be used with a warning message.</strong> (<em>energy</em>) – </p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><dl class="simple">
<dt>list of dicts of form {ratio,energy,rxn} where <cite>ratio</cite> is the</dt><dd><p>reactant mixing ratio, <cite>energy</cite> is the reaction energy
in eV/atom, and <cite>rxn</cite> is a
<cite>pymatgen.analysis.reaction_calculator.Reaction</cite>.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_materials_id_from_task_id">
<code class="descname">get_materials_id_from_task_id</code><span class="sig-paren">(</span><em>task_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_materials_id_from_task_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_materials_id_from_task_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a new MP materials id from a task id (which can be
equivalent to an old materials id)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>task_id</strong> (<em>str</em>) – A task id.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>materials_id (str)</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_materials_id_references">
<code class="descname">get_materials_id_references</code><span class="sig-paren">(</span><em>material_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_materials_id_references"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_materials_id_references" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all references for a materials id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>material_id</strong> (<em>str</em>) – A material id.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>BibTeX (str)</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_materials_ids">
<code class="descname">get_materials_ids</code><span class="sig-paren">(</span><em>chemsys_formula</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_materials_ids"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_materials_ids" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all materials ids for a formula or chemsys.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>chemsys_formula</strong> (<em>str</em>) – A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3).</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>([str]) List of all materials ids.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_phonon_bandstructure_by_material_id">
<code class="descname">get_phonon_bandstructure_by_material_id</code><span class="sig-paren">(</span><em>material_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_phonon_bandstructure_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_phonon_bandstructure_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get phonon dispersion data corresponding to a material_id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A phonon band structure.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="pymatgen.phonon.bandstructure.html#pymatgen.phonon.bandstructure.PhononBandStructureSymmLine" title="pymatgen.phonon.bandstructure.PhononBandStructureSymmLine">PhononBandStructureSymmLine</a></p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_phonon_ddb_by_material_id">
<code class="descname">get_phonon_ddb_by_material_id</code><span class="sig-paren">(</span><em>material_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_phonon_ddb_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_phonon_ddb_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get ABINIT Derivative Data Base (DDB) output for phonon calculations.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>ABINIT DDB file as a string.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_phonon_dos_by_material_id">
<code class="descname">get_phonon_dos_by_material_id</code><span class="sig-paren">(</span><em>material_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_phonon_dos_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_phonon_dos_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get phonon density of states data corresponding to a material_id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A phonon DOS object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>CompletePhononDos</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_pourbaix_entries">
<code class="descname">get_pourbaix_entries</code><span class="sig-paren">(</span><em>chemsys</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_pourbaix_entries"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_pourbaix_entries" title="Permalink to this definition">¶</a></dt>
<dd><p>A helper function to get all entries necessary to generate
a pourbaix diagram from the rest interface.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>chemsys</strong> (<em>[</em><em>str</em><em>]</em>) – A list of elements comprising the chemical
system, e.g. [‘Li’, ‘Fe’]</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_reaction">
<code class="descname">get_reaction</code><span class="sig-paren">(</span><em>reactants</em>, <em>products</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_reaction"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_reaction" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets a reaction from the Materials Project.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>reactants</strong> (<em>[</em><em>str</em><em>]</em>) – List of formulas</p></li>
<li><p><strong>products</strong> (<em>[</em><em>str</em><em>]</em>) – List of formulas</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rxn</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_stability">
<code class="descname">get_stability</code><span class="sig-paren">(</span><em>entries</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_stability"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_stability" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the stability of all entries.</p>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_structure_by_material_id">
<code class="descname">get_structure_by_material_id</code><span class="sig-paren">(</span><em>material_id</em>, <em>final=True</em>, <em>conventional_unit_cell=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_structure_by_material_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_structure_by_material_id" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a Structure corresponding to a material_id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id (a string,
e.g., mp-1234).</p></li>
<li><p><strong>final</strong> (<em>bool</em>) – Whether to get the final structure, or the initial
(pre-relaxation) structure. Defaults to True.</p></li>
<li><p><strong>conventional_unit_cell</strong> (<em>bool</em>) – Whether to get the standard
conventional unit cell</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Structure object.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_structures">
<code class="descname">get_structures</code><span class="sig-paren">(</span><em>chemsys_formula_id</em>, <em>final=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_structures"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_structures" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a list of Structures corresponding to a chemical system, formula,
or materials_id.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chemsys_formula_id</strong> (<em>str</em>) – A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e.g., mp-1234).</p></li>
<li><p><strong>final</strong> (<em>bool</em>) – Whether to get the final structure, or the initial
(pre-relaxation) structure. Defaults to True.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of Structure objects.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_substrates">
<code class="descname">get_substrates</code><span class="sig-paren">(</span><em>material_id</em>, <em>number=50</em>, <em>orient=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_substrates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_substrates" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a substrate list for a material id. The list is in order of
increasing elastic energy if a elastic tensor is available for
the material_id. Otherwise the list is in order of increasing
matching area.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id, e.g. ‘mp-123’.</p></li>
<li><p><strong>orient</strong> (<em>list</em>) – substrate orientation to look for</p></li>
<li><p><strong>number</strong> (<em>int</em>) – number of substrates to return;
n=0 returns all available matches</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of dicts with substrate matches</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_surface_data">
<code class="descname">get_surface_data</code><span class="sig-paren">(</span><em>material_id</em>, <em>inc_structures=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_surface_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_surface_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets surface data for a material. Useful for Wulff shapes.</p>
<p>Reference for surface data:</p>
<p>Tran, R., Xu, Z., Radhakrishnan, B., Winston, D., Sun, W., Persson, K.
A., & Ong, S. P. (2016). Data Descripter: Surface energies of elemental
crystals. Scientific Data, 3(160080), 1–13.
<a class="reference external" href="http://dx.doi.org/10.1038/sdata.2016.80">http://dx.doi.org/10.1038/sdata.2016.80</a></p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id, e.g. ‘mp-123’.</p></li>
<li><p><strong>inc_structures</strong> (<em>bool</em>) – Include final surface slab structures.
These are unnecessary for Wulff shape construction.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Surface data for material. Energies are given in SI units (J/m^2).</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_task_data">
<code class="descname">get_task_data</code><span class="sig-paren">(</span><em>chemsys_formula_id</em>, <em>prop=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_task_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_task_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Flexible method to get any data using the Materials Project REST
interface. Generally used by other methods for more specific queries.
Unlike the <a href="#id1"><span class="problematic" id="id2">:func:`get_data`_</span></a>, this method queries the task collection
for specific run information.</p>
<p>Format of REST return is <em>always</em> a list of dict (regardless of the
number of pieces of data returned. The general format is as follows:</p>
<p>[{“material_id”: material_id, “property_name” : value}, …]</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>chemsys_formula_id</strong> (<em>str</em>) – A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e.g., mp-1234).</p></li>
<li><p><strong>prop</strong> (<em>str</em>) – Property to be obtained. Should be one of the
MPRester.supported_properties. Leave as empty string for a
general list of useful properties.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.get_wulff_shape">
<code class="descname">get_wulff_shape</code><span class="sig-paren">(</span><em>material_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.get_wulff_shape"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.get_wulff_shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructs a Wulff shape for a material.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>material_id</strong> (<em>str</em>) – Materials Project material_id, e.g. ‘mp-123’.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>pymatgen.analysis.wulff.WulffShape</p>
</dd>
</dl>
</dd></dl>
<dl class="staticmethod">
<dt id="pymatgen.ext.matproj.MPRester.parse_criteria">
<em class="property">static </em><code class="descname">parse_criteria</code><span class="sig-paren">(</span><em>criteria_string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.parse_criteria"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.parse_criteria" title="Permalink to this definition">¶</a></dt>
<dd><p>Parses a powerful and simple string criteria and generates a proper
mongo syntax criteria.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>criteria_string</strong> (<em>str</em>) – <p>A string representing a search criteria.
Also supports wild cards. E.g.,
something like “<a href="#id3"><span class="problematic" id="id4">*</span></a>2O” gets converted to
{‘pretty_formula’: {‘$in’: [u’B2O’, u’Xe2O’, u”Li2O”, …]}}</p>
<dl class="simple">
<dt>Other syntax examples:</dt><dd><p>mp-1234: Interpreted as a Materials ID.
Fe2O3 or <a href="#id5"><span class="problematic" id="id6">*</span></a>2O3: Interpreted as reduced formulas.
Li-Fe-O or <a href="#id7"><span class="problematic" id="id8">*</span></a>-Fe-O: Interpreted as chemical systems.</p>
</dd>
</dl>
<p>You can mix and match with spaces, which are interpreted as
“OR”. E.g., “mp-1234 FeO” means query for all compounds with
reduced formula FeO or with materials_id mp-1234.</p>
</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A mongo query dict.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.query">
<code class="descname">query</code><span class="sig-paren">(</span><em>criteria</em>, <em>properties</em>, <em>chunk_size=500</em>, <em>max_tries_per_chunk=5</em>, <em>mp_decode=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.query"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.query" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs an advanced query using MongoDB-like syntax for directly
querying the Materials Project database. This allows one to perform
queries which are otherwise too cumbersome to perform using the standard
convenience methods.</p>
<p>Please consult the Materials API documentation at
<a class="reference external" href="https://github.com/materialsproject/mapidoc">https://github.com/materialsproject/mapidoc</a>, which provides a
comprehensive explanation of the document schema used in the Materials
Project (supported criteria and properties) and guidance on how best to
query for the relevant information you need.</p>
<p>For queries that request data on more than CHUNK_SIZE materials at once,
this method will chunk a query by first retrieving a list of material
IDs that satisfy CRITERIA, and then merging the criteria with a
restriction to one chunk of materials at a time of size CHUNK_SIZE. You
can opt out of this behavior by setting CHUNK_SIZE=0. To guard against
intermittent server errors in the case of many chunks per query,
possibly-transient server errors will result in re-trying a give chunk
up to MAX_TRIES_PER_CHUNK times.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>criteria</strong> (<em>str/dict</em>) – <p>Criteria of the query as a string or
mongo-style dict.</p>
<p>If string, it supports a powerful but simple string criteria.
E.g., “Fe2O3” means search for materials with reduced_formula
Fe2O3. Wild cards are also supported. E.g., “*2O” means get
all materials whose formula can be formed as *2O, e.g.,
Li2O, K2O, etc.</p>
<p>Other syntax examples:
mp-1234: Interpreted as a Materials ID.
Fe2O3 or *2O3: Interpreted as reduced formulas.
Li-Fe-O or *-Fe-O: Interpreted as chemical systems.</p>
<p>You can mix and match with spaces, which are interpreted as
“OR”. E.g. “mp-1234 FeO” means query for all compounds with
reduced formula FeO or with materials_id mp-1234.</p>
<p>Using a full dict syntax, even more powerful queries can be
constructed. For example, {“elements”:{“$in”:[“Li”,
“Na”, “K”], “$all”: [“O”]}, “nelements”:2} selects all Li, Na
and K oxides. {“band_gap”: {“$gt”: 1}} selects all materials
with band gaps greater than 1 eV.</p>
</p></li>
<li><p><strong>properties</strong> (<em>list</em>) – Properties to request for as a list. For
example, [“formula”, “formation_energy_per_atom”] returns
the formula and formation energy per atom.</p></li>
<li><p><strong>chunk_size</strong> (<em>int</em>) – Number of materials for which to fetch data at a
time. More data-intensive properties may require smaller chunk
sizes. Use chunk_size=0 to force no chunking – this is useful
when fetching only properties such as ‘material_id’.</p></li>
<li><p><strong>max_tries_per_chunk</strong> (<em>int</em>) – How many times to re-try fetching a given
chunk when the server gives a 5xx error (e.g. a timeout error).</p></li>
<li><p><strong>mp_decode</strong> (<em>bool</em>) – Whether to do a decoding to a Pymatgen object
where possible. In some cases, it might be useful to just get
the raw python dict, i.e., set to False.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of results. E.g.,
[{u’formula’: {u’O’: 1, u’Li’: 2.0}},
{u’formula’: {u’Na’: 2.0, u’O’: 2.0}},
{u’formula’: {u’K’: 1, u’O’: 3.0}},
…]</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.query_snl">
<code class="descname">query_snl</code><span class="sig-paren">(</span><em>criteria</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.query_snl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.query_snl" title="Permalink to this definition">¶</a></dt>
<dd><p>Query for submitted SNLs.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>criteria</strong> (<em>dict</em>) – Query criteria.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict, with a list of submitted SNLs in the “response” key.</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pymatgen.ext.matproj.MPRestError" title="pymatgen.ext.matproj.MPRestError"><strong>MPRestError</strong></a> – </p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.submit_snl">
<code class="descname">submit_snl</code><span class="sig-paren">(</span><em>snl</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.submit_snl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.submit_snl" title="Permalink to this definition">¶</a></dt>
<dd><p>Submits a list of StructureNL to the Materials Project site.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>snl</strong> (<em>StructureNL/</em><em>[</em><a class="reference internal" href="pymatgen.util.provenance.html#pymatgen.util.provenance.StructureNL" title="pymatgen.util.provenance.StructureNL"><em>StructureNL</em></a><em>]</em>) – A single StructureNL, or a list</p></li>
<li><p><strong>StructureNL objects</strong> (<em>of</em>) – </p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of inserted submission ids.</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pymatgen.ext.matproj.MPRestError" title="pymatgen.ext.matproj.MPRestError"><strong>MPRestError</strong></a> – </p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.submit_structures">
<code class="descname">submit_structures</code><span class="sig-paren">(</span><em>structures</em>, <em>authors</em>, <em>projects=None</em>, <em>references=''</em>, <em>remarks=None</em>, <em>data=None</em>, <em>histories=None</em>, <em>created_at=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.submit_structures"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.submit_structures" title="Permalink to this definition">¶</a></dt>
<dd><p>Submits a list of structures to the Materials Project as SNL files.
The argument list mirrors the arguments for the StructureNL object,
except that a list of structures with the same metadata is used as an
input.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structures</strong> – A list of Structure objects</p></li>
<li><p><strong>authors</strong> (<em>list</em>) – List of {“name”:’‘, “email”:’‘} dicts,
<em>list</em> of Strings as ‘John Doe <<a class="reference external" href="mailto:johndoe%40gmail.com">johndoe<span>@</span>gmail<span>.</span>com</a>>’,
or a single String with commas separating authors</p></li>
<li><p><strong>projects</strong> (<em>[</em><em>str</em><em>]</em>) – List of Strings [‘Project A’, ‘Project B’].
This applies to all structures.</p></li>
<li><p><strong>references</strong> (<em>str</em>) – A String in BibTeX format. Again, this applies to
all structures.</p></li>
<li><p><strong>remarks</strong> (<em>[</em><em>str</em><em>]</em>) – List of Strings [‘Remark A’, ‘Remark B’]</p></li>
<li><p><strong>data</strong> (<em>[</em><em>dict</em><em>]</em>) – A list of free form dict. Namespaced at the root
level with an underscore, e.g. {“_materialsproject”:<custom
data>}. The length of data should be the same as the list of
structures if not None.</p></li>
<li><p><strong>histories</strong> – List of list of dicts - [[{‘name’:’‘, ‘url’:’‘,
‘description’:{}}], …] The length of histories should be the
same as the list of structures if not None.</p></li>
<li><p><strong>created_at</strong> (<em>datetime</em>) – A datetime object</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of inserted submission ids.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.ext.matproj.MPRester.submit_vasp_directory">
<code class="descname">submit_vasp_directory</code><span class="sig-paren">(</span><em>rootdir</em>, <em>authors</em>, <em>projects=None</em>, <em>references=''</em>, <em>remarks=None</em>, <em>master_data=None</em>, <em>master_history=None</em>, <em>created_at=None</em>, <em>ncpus=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/ext/matproj.html#MPRester.submit_vasp_directory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.submit_vasp_directory" title="Permalink to this definition">¶</a></dt>
<dd><p>Assimilates all vasp run directories beneath a particular
directory using BorgQueen to obtain structures, and then submits thhem
to the Materials Project as SNL files. VASP related meta data like
initial structure and final energies are automatically incorporated.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>As of now, this MP REST feature is open only to a select group of
users. Opening up submissions to all users is being planned for
the future.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rootdir</strong> (<em>str</em>) – Rootdir to start assimilating VASP runs from.</p></li>
<li><p><strong>authors</strong> – <em>List</em> of {“name”:’‘, “email”:’‘} dicts,
<em>list</em> of Strings as ‘John Doe <<a class="reference external" href="mailto:johndoe%40gmail.com">johndoe<span>@</span>gmail<span>.</span>com</a>>’,
or a single String with commas separating authors. The same
list of authors should apply to all runs.</p></li>
<li><p><strong>projects</strong> (<em>[</em><em>str</em><em>]</em>) – List of Strings [‘Project A’, ‘Project B’].
This applies to all structures.</p></li>
<li><p><strong>references</strong> (<em>str</em>) – A String in BibTeX format. Again, this applies to
all structures.</p></li>
<li><p><strong>remarks</strong> (<em>[</em><em>str</em><em>]</em>) – List of Strings [‘Remark A’, ‘Remark B’]</p></li>
<li><p><strong>master_data</strong> (<em>dict</em>) – A free form dict. Namespaced at the root
level with an underscore, e.g. {“_materialsproject”:<custom
data>}. This data is added to all structures detected in the
directory, in addition to other vasp data on a per structure
basis.</p></li>
<li><p><strong>master_history</strong> – A master history to be added to all entries.</p></li>
<li><p><strong>created_at</strong> (<em>datetime</em>) – A datetime object</p></li>
<li><p><strong>ncpus</strong> (<em>int</em>) – Number of cpus to use in using BorgQueen to
assimilate. Defaults to None, which means serial.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="attribute">
<dt id="pymatgen.ext.matproj.MPRester.supported_properties">
<code class="descname">supported_properties</code><em class="property"> = ('energy', 'energy_per_atom', 'volume', 'formation_energy_per_atom', 'nsites', 'unit_cell_formula', 'pretty_formula', 'is_hubbard', 'elements', 'nelements', 'e_above_hull', 'hubbards', 'is_compatible', 'spacegroup', 'task_ids', 'band_gap', 'density', 'icsd_id', 'icsd_ids', 'cif', 'total_magnetization', 'material_id', 'oxide_type', 'tags', 'elasticity')</em><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.supported_properties" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pymatgen.ext.matproj.MPRester.supported_task_properties">
<code class="descname">supported_task_properties</code><em class="property"> = ('energy', 'energy_per_atom', 'volume', 'formation_energy_per_atom', 'nsites', 'unit_cell_formula', 'pretty_formula', 'is_hubbard', 'elements', 'nelements', 'e_above_hull', 'hubbards', 'is_compatible', 'spacegroup', 'band_gap', 'density', 'icsd_id', 'cif')</em><a class="headerlink" href="#pymatgen.ext.matproj.MPRester.supported_task_properties" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pymatgen.ext.matproj.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#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">pymatgen 2019.5.1 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011, Pymatgen Development Team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.0.1.
</div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html>