Skip to content

Fix KeyError('wyckoff_spglib') in fetch_process_wbm_dataset.py #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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