18
18
from pymatviz .io import save_fig
19
19
from tqdm import tqdm
20
20
21
- from matbench_discovery import SITE_FIGS , today
21
+ from matbench_discovery import SITE_FIGS , id_col , today
22
22
from matbench_discovery .data import DATA_FILES
23
23
from matbench_discovery .energy import get_e_form_per_atom
24
24
from matbench_discovery .plots import pio
@@ -156,7 +156,7 @@ def increment_wbm_material_id(wbm_id: str) -> str:
156
156
157
157
158
158
df_wbm .index = df_wbm .index .map (increment_wbm_material_id )
159
- df_wbm .index .name = "material_id"
159
+ df_wbm .index .name = id_col
160
160
assert df_wbm .index [0 ] == "wbm-1-1"
161
161
assert df_wbm .index [- 1 ] == "wbm-5-23308"
162
162
@@ -296,13 +296,13 @@ def increment_wbm_material_id(wbm_id: str) -> str:
296
296
"e_form" : "e_form_per_atom_wbm" ,
297
297
"e_hull" : "e_above_hull_wbm" ,
298
298
"gap" : "bandgap_pbe" ,
299
- "id" : "material_id" ,
299
+ "id" : id_col ,
300
300
}
301
301
# WBM summary was shared twice, once on google drive, once on materials cloud
302
302
# download both and check for consistency
303
303
df_summary = pd .read_csv (
304
304
f"{ module_dir } /raw/wbm-summary.txt" , sep = "\t " , names = col_map .values ()
305
- ).set_index ("material_id" )
305
+ ).set_index (id_col )
306
306
307
307
df_summary_bz2 = pd .read_csv (
308
308
f"{ mat_cloud_url } &filename=summary.txt.bz2" , sep = "\t "
@@ -618,7 +618,7 @@ def fix_bad_struct_index_mismatch(material_id: str) -> str:
618
618
suggest = "not found, run scripts/compute_struct_fingerprints.py to generate"
619
619
fp_diff_col = "site_stats_fingerprint_init_final_norm_diff"
620
620
try :
621
- df_fp = pd .read_json (fingerprints_path ).set_index ("material_id" )
621
+ df_fp = pd .read_json (fingerprints_path ).set_index (id_col )
622
622
df_summary [fp_diff_col ] = df_fp [fp_diff_col ]
623
623
except FileNotFoundError :
624
624
print (f"{ fingerprints_path = } { suggest } " )
@@ -633,11 +633,11 @@ def fix_bad_struct_index_mismatch(material_id: str) -> str:
633
633
# %% only here to load data for later inspection
634
634
if False :
635
635
df_summary = pd .read_csv (f"{ module_dir } /2022-10-19-wbm-summary.csv.gz" ).set_index (
636
- "material_id"
636
+ id_col
637
637
)
638
638
df_wbm = pd .read_json (
639
639
f"{ module_dir } /2022-10-19-wbm-computed-structure-entries+init-structs.json.bz2"
640
- ).set_index ("material_id" )
640
+ ).set_index (id_col )
641
641
642
642
df_wbm ["cse" ] = [
643
643
ComputedStructureEntry .from_dict (dct )
0 commit comments