Skip to content

Commit

Permalink
more code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Jun 20, 2023
1 parent e61c8c7 commit b957855
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black

Expand All @@ -22,7 +22,7 @@ repos:
- id: flake8

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v2.34.0
hooks:
- id: pyupgrade
args: [--py39-plus]
Expand All @@ -33,7 +33,7 @@ repos:
- id: format-ipy-cells

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- id: check-case-conflict
- id: check-symlinks
Expand All @@ -44,7 +44,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v0.961
hooks:
- id: mypy
additional_dependencies: [types-pyyaml]
Expand Down
11 changes: 6 additions & 5 deletions ml_stability/hist_clf_vary.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@
# %%
fig, ax = plt.subplots(1, 1, figsize=(10, 9))

df_hull = pd.read_csv(f"{ROOT}/data/wbm_e_above_mp.csv")
df_hull = pd.read_csv(f"{ROOT}/data/wbm_e_above_mp_hull.csv").set_index("material_id")

e_hull_dict = dict(zip(df_hull.material_id, df_hull.e_above_hull))

for model_name, color in zip(
# ["wren", "cgcnn", "cgcnn-d"],
# ["tab:blue", "tab:red", "tab:purple"],
["wren", "voronoi", "cgcnn"],
["tab:blue", "tab:orange", "tab:red"],
):
df = pd.read_csv(f"{ROOT}/data/{model_name}-mp-initial-structures.csv")
df = pd.read_csv(f"{ROOT}/data/{model_name}-mp-initial-structures.csv").set_index(
"material_id"
)

df["e_above_hull"] = pd.to_numeric(df["material_id"].map(e_hull_dict))
df["e_above_hull"] = df_hull.e_above_hull

df = df.dropna(axis=0, subset=["e_above_hull"])
df = df.dropna(subset=["e_above_hull"])

rare = "all"

Expand Down

0 comments on commit b957855

Please sign in to comment.