Skip to content

Commit

Permalink
Fix KeyError('wyckoff_spglib') in fetch_process_wbm_dataset.py (#34)
Browse files Browse the repository at this point in the history
* fix Generating Aflow labels raised exception=KeyError('wyckoff_spglib') (closes #32)

* move out_dir of site-stats.json.gz to data/(wbm|mp) (closes #33)
  • Loading branch information
janosh authored May 9, 2023
1 parent 5d45021 commit 9a42546
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions data/wbm/fetch_process_wbm_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,11 @@ def fix_bad_struct_index_mismatch(material_id: str) -> str:

wyckoff_col = "wyckoff_spglib"
if wyckoff_col not in df_wbm:
df_wbm[wyckoff_col] = None
df_summary[wyckoff_col] = None

for idx, struct in tqdm(df_wbm.initial_structure.items(), total=len(df_wbm)):
if not pd.isna(df_summary.loc[idx, wyckoff_col]):
continue
continue # Aflow label already computed
try:
struct = Structure.from_dict(struct)
df_summary.loc[idx, wyckoff_col] = get_aflow_label_from_spglib(struct)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ select = [
"PYI", # flakes8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"TID", # tidy imports
Expand Down
2 changes: 1 addition & 1 deletion scripts/compute_struct_fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
slurm_array_task_id = int(os.getenv("SLURM_ARRAY_TASK_ID", 0))
slurm_array_task_count = 100

out_dir = f"{ROOT}/data/{data_name}/structure-fingerprints"
out_dir = f"{ROOT}/data/{data_name}"
os.makedirs(out_dir, exist_ok=True)

slurm_vars = slurm_submit(
Expand Down

0 comments on commit 9a42546

Please sign in to comment.