Skip to content

Commit

Permalink
hide test_set_std_key from <Select /> in Per-Element Model Error Heat…
Browse files Browse the repository at this point in the history
…maps on /models page

update preprint: import and display some commented out figures in closing EDA SI section (too lazy to fix in prev PR)
  • Loading branch information
janosh committed Feb 11, 2024
1 parent 1dcb588 commit 07555b5
Show file tree
Hide file tree
Showing 21 changed files with 642 additions and 598 deletions.
10 changes: 5 additions & 5 deletions matbench_discovery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import matplotlib.pyplot as plt
import plotly.express as px
import plotly.io as pio
import pymatviz # noqa: F401

from matbench_discovery.enums import ( # noqa: F401
Key,
Expand All @@ -22,8 +23,8 @@
Task,
)

pkg_name = "matbench-discovery"
direct_url = Distribution.from_name(pkg_name).read_text("direct_url.json") or "{}"
PKG_NAME = "matbench-discovery"
direct_url = Distribution.from_name(PKG_NAME).read_text("direct_url.json") or "{}"
pkg_is_editable = json.loads(direct_url).get("dir_info", {}).get("editable", False)

PKG_DIR = os.path.dirname(__file__)
Expand Down Expand Up @@ -70,16 +71,15 @@
# --- start global plot settings
px.defaults.labels = Quantity.dict() | Model.dict()


global_layout = dict(
paper_bgcolor="rgba(0,0,0,0)",
font_size=13,
# increase legend marker size and make background transparent
legend=dict(itemsizing="constant", bgcolor="rgba(0, 0, 0, 0)"),
)
pio.templates["global"] = dict(layout=global_layout)
pio.templates.default = "plotly_dark+global"
px.defaults.template = "plotly_dark+global"
pio.templates.default = "pymatviz_dark+global"
px.defaults.template = "pymatviz_dark+global"

# https://github.com/plotly/Kaleido/issues/122#issuecomment-994906924
# when seeing MathJax "loading" message in exported PDFs,
Expand Down
2 changes: 1 addition & 1 deletion matbench_discovery/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def cumulative_metrics(
# sort targets by model ranking
each_true = e_above_hull_true.loc[each_pred.index]

true_pos_cum, false_neg_cum, false_pos_cum, true_neg_cum = map(
true_pos_cum, false_neg_cum, false_pos_cum, _true_neg_cum = map(
np.cumsum, classify_stable(each_true, each_pred, stability_threshold)
)

Expand Down
4 changes: 2 additions & 2 deletions scripts/model_figs/make_hull_dist_box_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
label.set_y(label.get_position()[1] - 0.05)


# %%
# %% take only 1_000 samples for speed (should not be used only for inspection)
px.violin(
df_each_err[models].melt(),
df_each_err[models].sample(1_000).melt(),
x="variable",
y="value",
color="variable",
Expand Down
2 changes: 1 addition & 1 deletion scripts/model_figs/per_element_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


# %%
test_subset = globals().get("test_subset", TestSubset.full)
test_subset = globals().get("test_subset", TestSubset.uniq_protos)

if test_subset == TestSubset.uniq_protos:
df_preds = df_preds.query(Key.uniq_proto)
Expand Down
12 changes: 5 additions & 7 deletions site/src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,23 @@ declare module '*package.json' {
export default pkg
}

// model metadata files
declare module 'models/*.yml' {
const data: import('$lib').ModelMetadata
const data: import('$lib/model-metadata').ModelMetadata
export default data
}
} // model metadata files

// paper metadata
declare module '*citation.cff' {
const data: import('$lib').Citation
export = data
}
} // paper metadata

declare module '*references.yaml' {
export const references: import('$lib').Reference[]
}
} // paper references (auto-exported by Zotero)

declare module '*model-metadata-schema.yml' {
export const ModelMetadata: import('$lib/model-metadata').ModelMetadata
}
} // model metadata schema

declare module '*element-counts.json' {
const map: Record<string, number>
Expand Down
Loading

0 comments on commit 07555b5

Please sign in to comment.