|
24 | 24 | ).set_index("material_id")
|
25 | 25 |
|
26 | 26 |
|
27 |
| -# %% spread M3GNet post-pseudo-relaxation lattice params into separate columns |
| 27 | +# %% |
28 | 28 | df_m3gnet = pd.read_json(
|
29 |
| - f"{ROOT}/data/2022-07-17@20-27-m3gnet-wbm-relax-results.json.gz" |
| 29 | + f"{ROOT}/data/2022-07-17-m3gnet-wbm-relax-results.json.gz" |
30 | 30 | ).set_index("material_id")
|
31 | 31 |
|
32 | 32 | print("Number of WBM crystals for which we have M3GNet results:")
|
33 | 33 | print(f"{len(df_m3gnet):,} / {len(df_wbm):,} = {len(df_m3gnet)/len(df_wbm):.1%}")
|
34 | 34 |
|
35 | 35 |
|
36 |
| -# %% |
| 36 | +# %% spread M3GNet post-pseudo-relaxation lattice params into separate columns |
37 | 37 | df_m3gnet["final_energy"] = df_m3gnet.trajectory.map(lambda x: x["energies"][-1][0])
|
38 | 38 |
|
39 | 39 | df_m3gnet_lattice = pd.json_normalize(
|
40 |
| - df_m3gnet.final_structure.map(lambda x: x["lattice"]) |
| 40 | + df_m3gnet.initial_structure.map(lambda x: x["lattice"]) |
41 | 41 | ).add_prefix("m3gnet_")
|
42 | 42 | df_m3gnet[df_m3gnet_lattice.columns] = df_m3gnet_lattice.to_numpy()
|
43 | 43 | df_m3gnet
|
44 | 44 |
|
45 | 45 |
|
46 | 46 | # %% spread WBM initial and final lattice params into separate columns
|
47 |
| -df_m3gnet["cse"] = df_wbm.cse |
| 47 | +df_m3gnet["final_wbm_structure"] = df_wbm.cse.map(lambda x: x["structure"]) |
48 | 48 | df_wbm_final_lattice = pd.json_normalize(
|
49 |
| - df_m3gnet.cse.map(lambda x: x["structure"]["lattice"]) |
| 49 | + df_m3gnet.final_wbm_structure.map(lambda x: x["lattice"]) |
50 | 50 | ).add_prefix("final_wbm_")
|
51 | 51 | df_m3gnet[df_wbm_final_lattice.columns] = df_wbm_final_lattice.to_numpy()
|
52 | 52 |
|
53 | 53 |
|
54 |
| -df_m3gnet["initial_structure"] = df_wbm.initial_structure |
| 54 | +df_m3gnet["initial_wbm_structure"] = df_wbm.initial_structure |
55 | 55 | df_wbm_initial_lattice = pd.json_normalize(
|
56 | 56 | df_m3gnet.initial_structure.map(lambda x: x["lattice"])
|
57 | 57 | ).add_prefix("initial_wbm_")
|
|
67 | 67 | df_wbm_initial_lattice = pd.json_normalize(
|
68 | 68 | df_wbm.initial_structure.map(lambda x: x["lattice"])
|
69 | 69 | ).add_prefix("initial_wbm_")
|
70 |
| -df_wbm[df_wbm_initial_lattice.columns] = df_wbm_initial_lattice |
| 70 | +df_wbm[df_wbm_initial_lattice.columns] = df_wbm_initial_lattice.to_numpy() |
71 | 71 |
|
72 | 72 | print(f"{df_wbm.isna().sum()=}")
|
73 | 73 |
|
|
102 | 102 | fig = px.histogram(
|
103 | 103 | df_m3gnet.filter(like="alpha"), nbins=1000, barmode="overlay", log_y=True
|
104 | 104 | )
|
105 |
| -# fig.write_image("plots/alpha-wbm-angles.png", scale=2) |
106 | 105 | fig.show()
|
107 | 106 |
|
108 | 107 |
|
|
0 commit comments