Skip to content

Commit 07555b5

Browse files
committed
hide test_set_std_key from <Select /> in Per-Element Model Error Heatmaps on /models page
update preprint: import and display some commented out figures in closing EDA SI section (too lazy to fix in prev PR)
1 parent 1dcb588 commit 07555b5

21 files changed

+642
-598
lines changed

matbench_discovery/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import matplotlib.pyplot as plt
1212
import plotly.express as px
1313
import plotly.io as pio
14+
import pymatviz # noqa: F401
1415

1516
from matbench_discovery.enums import ( # noqa: F401
1617
Key,
@@ -22,8 +23,8 @@
2223
Task,
2324
)
2425

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

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

73-
7474
global_layout = dict(
7575
paper_bgcolor="rgba(0,0,0,0)",
7676
font_size=13,
7777
# increase legend marker size and make background transparent
7878
legend=dict(itemsizing="constant", bgcolor="rgba(0, 0, 0, 0)"),
7979
)
8080
pio.templates["global"] = dict(layout=global_layout)
81-
pio.templates.default = "plotly_dark+global"
82-
px.defaults.template = "plotly_dark+global"
81+
pio.templates.default = "pymatviz_dark+global"
82+
px.defaults.template = "pymatviz_dark+global"
8383

8484
# https://github.com/plotly/Kaleido/issues/122#issuecomment-994906924
8585
# when seeing MathJax "loading" message in exported PDFs,

matbench_discovery/plots.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ def cumulative_metrics(
636636
# sort targets by model ranking
637637
each_true = e_above_hull_true.loc[each_pred.index]
638638

639-
true_pos_cum, false_neg_cum, false_pos_cum, true_neg_cum = map(
639+
true_pos_cum, false_neg_cum, false_pos_cum, _true_neg_cum = map(
640640
np.cumsum, classify_stable(each_true, each_pred, stability_threshold)
641641
)
642642

scripts/model_figs/make_hull_dist_box_plot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
label.set_y(label.get_position()[1] - 0.05)
4848

4949

50-
# %%
50+
# %% take only 1_000 samples for speed (should not be used only for inspection)
5151
px.violin(
52-
df_each_err[models].melt(),
52+
df_each_err[models].sample(1_000).melt(),
5353
x="variable",
5454
y="value",
5555
color="variable",

scripts/model_figs/per_element_errors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929

3030
# %%
31-
test_subset = globals().get("test_subset", TestSubset.full)
31+
test_subset = globals().get("test_subset", TestSubset.uniq_protos)
3232

3333
if test_subset == TestSubset.uniq_protos:
3434
df_preds = df_preds.query(Key.uniq_proto)

site/src/app.d.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@ declare module '*package.json' {
88
export default pkg
99
}
1010

11-
// model metadata files
1211
declare module 'models/*.yml' {
13-
const data: import('$lib').ModelMetadata
12+
const data: import('$lib/model-metadata').ModelMetadata
1413
export default data
15-
}
14+
} // model metadata files
1615

17-
// paper metadata
1816
declare module '*citation.cff' {
1917
const data: import('$lib').Citation
2018
export = data
21-
}
19+
} // paper metadata
2220

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

2725
declare module '*model-metadata-schema.yml' {
2826
export const ModelMetadata: import('$lib/model-metadata').ModelMetadata
29-
}
27+
} // model metadata schema
3028

3129
declare module '*element-counts.json' {
3230
const map: Record<string, number>

0 commit comments

Comments
 (0)