|
26 | 26 | pd.Series(
|
27 | 27 | {e.entry_id: e for e in all_mp_computed_structure_entries}
|
28 | 28 | ).drop_duplicates().to_json( # mp-15590 appears twice so we drop_duplicates()
|
29 |
| - f"{ROOT}/data/{today}-all-mp-entries.json.gz", default_handler=lambda x: x.as_dict() |
| 29 | + f"{ROOT}/data/{today}-mp-computed-structure-entries.json.gz", |
| 30 | + default_handler=lambda x: x.as_dict(), |
30 | 31 | )
|
31 | 32 |
|
32 | 33 |
|
33 | 34 | # %%
|
34 |
| -all_mp_computed_entries = ( |
35 |
| - pd.read_json(f"{ROOT}/data/2022-09-16-all-mp-entries.json.gz") |
36 |
| - .set_index("material_id") |
37 |
| - .entry.map(ComputedEntry.from_dict) # drop the structure, just load ComputedEntry |
38 |
| - .to_dict() |
39 |
| -) |
40 |
| - |
| 35 | +data_path = f"{ROOT}/data/2022-09-16-mp-computed-structure-entries.json.gz" |
| 36 | +df = pd.read_json(data_path).set_index("material_id") |
| 37 | +# drop the structure, just load ComputedEntry |
| 38 | +mp_computed_entries = df.entry.map(ComputedEntry.from_dict).to_dict() |
41 | 39 |
|
42 |
| -print(f"{len(all_mp_computed_entries) = :,}") |
43 |
| -# len(all_mp_computed_entries) = 146,323 |
| 40 | +print(f"{len(mp_computed_entries) = :,}") |
| 41 | +# len(mp_computed_entries) = 146,323 |
44 | 42 |
|
45 | 43 |
|
46 | 44 | # %% build phase diagram with MP entries only
|
47 |
| -ppd_mp = PatchedPhaseDiagram(all_mp_computed_entries) |
| 45 | +ppd_mp = PatchedPhaseDiagram(mp_computed_entries) |
48 | 46 | # prints:
|
49 | 47 | # PatchedPhaseDiagram covering 44805 sub-spaces
|
50 | 48 |
|
|
76 | 74 |
|
77 | 75 | # %% merge MP and WBM entries into a single PatchedPhaseDiagram
|
78 | 76 | mp_wbm_ppd = PatchedPhaseDiagram(
|
79 |
| - wbm_computed_entries + all_mp_computed_entries, verbose=True |
| 77 | + wbm_computed_entries + mp_computed_entries, verbose=True |
80 | 78 | )
|
81 | 79 |
|
82 | 80 | # save MP+WBM PPD to disk (not run)
|
|
86 | 84 |
|
87 | 85 | # %% compute terminal reference entries across all MP (can be used to compute MP
|
88 | 86 | # compatible formation energies quickly)
|
89 |
| -elemental_ref_entries = get_elemental_ref_entries(all_mp_computed_entries) |
| 87 | +elemental_ref_entries = get_elemental_ref_entries(mp_computed_entries) |
90 | 88 |
|
91 | 89 | # save elemental_ref_entries to disk as json
|
92 | 90 | with open(f"{module_dir}/{today}-elemental-ref-entries.json", "w") as file:
|
93 | 91 | json.dump(elemental_ref_entries, file, default=lambda x: x.as_dict())
|
94 | 92 |
|
95 | 93 |
|
96 |
| -df_mp = pd.read_json(f"{ROOT}/data/2022-08-13-mp-all-energies.json.gz").set_index( |
| 94 | +df_mp = pd.read_json(f"{ROOT}/data/2022-08-13-mp-energies.json.gz").set_index( |
97 | 95 | "material_id"
|
98 | 96 | )
|
99 | 97 |
|
100 | 98 |
|
101 | 99 | # %%
|
102 | 100 | df_mp["our_mp_e_form"] = [
|
103 |
| - get_e_form_per_atom(all_mp_computed_entries[mp_id]) for mp_id in df_mp.index |
| 101 | + get_e_form_per_atom(mp_computed_entries[mp_id]) for mp_id in df_mp.index |
104 | 102 | ]
|
105 | 103 |
|
106 | 104 |
|
|
0 commit comments