Skip to content

Commit 036b1e1

Browse files
authored
Improve GeoOptMetricsTable and remove duplicate scatter plot controls (#317)
* Improve GeoOptMetricsTable and remove duplicate scatter plot controls - Add unit (Å) to RMSD and display units in thin font in column headers - Add (higher/lower=better) hints to column tooltips - Group columns under Symmetry and Hyperparams headers - Add initial sort by RMSD ascending, sort_hint, and default_num_format - Add n_layers and graph_construction_radius as hidden-by-default columns - Fix z-index of ToggleMenu dropdown above sticky table headers - Remove duplicate fullscreen buttons and settings panes from DynamicScatter and GitHubActivityScatter (use ScatterPlot built-ins) - Move DynamicScatter controls into controls_extra snippet - Bump pre-commit hooks and site dependencies - Use rsplit/maxsplit=1 for safer string splits in Python - Add tests for units, group headers, hidden columns, and tooltips * Add RMSD unit and improve GeoOptMetricsTable tests - Add missing unit: 'Å' to ALL_METRICS.RMSD label definition - Test units in column headers (RMSD, f_max), group headers (Symmetry, Hyperparams), hidden-by-default columns, and initial sort via aria-sort attribute - Test n_layers presence in assemble_row_data output - Consolidate 3 redundant structure tests into 1 * Update DynamicScatter tests for refactored controls Custom fullscreen button and DraggablePane were replaced with ScatterPlot's built-in FullscreenToggle and controls_extra snippet. Tests now verify component mounting and structure without depending on removed DOM elements (.settings-toggle, button[title$="fullscreen"]). * Simplify DynamicScatter and fix GeoOptMetricsTable column handling - Remove dead size_value date re-conversion (get_label_value already handles it) - Use isFinite() instead of !isNaN() to also reject Infinity values - Consolidate axis_options/color_options into single prop_options derived - Inline date_key/params_key constants (each used only once) - Remove intermediate color_prop derived (inline into axes) - Use const for grid/tick settings (PlotControls manages the UI) - Fix enrich_col override order so enrichments aren't silently discarded - Use ALL_METRICS.RMSD.key for initial_sort instead of hardcoded string - Use .key instead of .label for cell_filter in assemble_row_data - Drop dead ?? col.label fallback in key_remap - Merge RMSD unit test into test.each, merge overlapping mount tests * fix lints
1 parent 93cc690 commit 036b1e1

31 files changed

+385
-693
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
with:
2222
deno-version: 2.3.7
2323

24+
- name: Set up pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 10
28+
2429
- name: Run prek
2530
uses: j178/prek-action@v1
2631
env: # skip eslint because it's additional deps are not installed correctly

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ default_install_hook_types: [pre-commit, commit-msg]
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.14.14
7+
rev: v0.15.0
88
hooks:
99
- id: ruff-check
1010
args: [--fix]
@@ -55,7 +55,7 @@ repos:
5555
language: system
5656
- id: svelte-check
5757
name: Svelte type check
58-
entry: bash -c 'cd site && deno install --allow-scripts && deno run -A --node-modules-dir npm:@sveltejs/kit sync && deno run -A --node-modules-dir npm:svelte-check-rs@latest --threshold error'
58+
entry: bash -c 'cd site && pnpm install && pnpm exec svelte-kit sync && pnpm exec svelte-check-rs --threshold error'
5959
language: system
6060
types_or: [ts, svelte]
6161
pass_filenames: false
@@ -82,7 +82,7 @@ repos:
8282
exclude: changelog\.md$
8383

8484
- repo: https://github.com/pre-commit/mirrors-eslint
85-
rev: v10.0.0-rc.2
85+
rev: v10.0.0
8686
hooks:
8787
- id: eslint
8888
types: [file]
@@ -108,7 +108,7 @@ repos:
108108
- id: check-github-actions
109109

110110
- repo: https://github.com/crate-ci/typos
111-
rev: v1.42.3
111+
rev: v1.43.4
112112
hooks:
113113
- id: typos
114114
types: [text]

data/mp/eda_mp_trj.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def info_dict_to_id(info: dict[str, int | str]) -> str:
421421
xref="x3",
422422
yref="y3",
423423
)
424-
fig.layout.yaxis3.update(showgrid=False, rangemode="tozero")
424+
fig.update_layout(yaxis3=dict(showgrid=False, rangemode="tozero"))
425425

426426
fig.layout.margin = dict(l=5, r=5, b=5, t=5)
427427
fig.layout.legend.update(x=0.96, y=0.18, xanchor="right", bgcolor="rgba(0,0,0,0)")

matbench_discovery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
STABILITY_THRESHOLD = 0
4747

4848
timestamp = f"{datetime.now(tz=UTC):%Y-%m-%d@%H-%M-%S}"
49-
today = timestamp.split("@")[0]
49+
today = timestamp.split("@", maxsplit=1)[0]
5050

5151
# filter pymatgen warnings that spam the logs when e.g. applying corrections to
5252
# ComputedStructureEntries or using PatchedPhaseDiagram to get e_above_hull

matbench_discovery/plots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ def cumulative_metrics(
688688
last_idx = pd.Series(trace.y).last_valid_index()
689689
last_x = trace.x[last_idx]
690690
last_y = trace.y[last_idx]
691-
color = dict(color=trace.line.color)
691+
color = dict(color=trace.line["color"])
692692

693693
fig.add_scatter(
694694
x=[last_x],

matbench_discovery/remote/fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def download_file(file_path: str, url: str) -> None:
1818
# Convert Figshare URLs to API download URLs to avoid WAF bot detection
1919
# https://figshare.com/files/12345 -> https://api.figshare.com/v2/file/download/12345
2020
if "figshare.com/files/" in url:
21-
file_id = url.split("/files/")[-1]
21+
file_id = url.rsplit("/files/", maxsplit=1)[-1]
2222
url = f"https://api.figshare.com/v2/file/download/{file_id}"
2323

2424
try:

models/chgnet/join_chgnet_preds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
# %% compute corrected formation energies
5454
e_pred_col = "chgnet_energy"
55-
e_form_chgnet_col = f"e_form_per_atom_{e_pred_col.split('_energy')[0]}"
55+
e_form_chgnet_col = f"e_form_per_atom_{e_pred_col.split('_energy', maxsplit=1)[0]}"
5656
df_chgnet[Key.formula] = df_preds[Key.formula]
5757
df_chgnet[e_form_chgnet_col] = [
5858
get_e_form_per_atom(dict(energy=ene, composition=formula))

models/deepmd/dpa-3.1-3m-ft.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ hyperparams:
6868
virial: 0.02 -> 1
6969
initial_learning_rate: 0.001
7070
learning_rate_schedule: ExpLR - start_lr=0.001, decay_steps=5000, stop_lr=0.00001
71-
training_steps: 4000000
71+
training_steps: 4_000_000
7272
batch_size: 960 # 120 (gpus) * 8 (batch per gpu) = 960 (total batch size)
7373
epochs: 23.5
7474
finetune:
@@ -79,7 +79,7 @@ hyperparams:
7979
virial: 2.5
8080
initial_learning_rate: 0.0001
8181
learning_rate_schedule: ExpLR - start_lr=0.0001, decay_steps=5000, stop_lr=0.000006
82-
training_steps: 2000000
82+
training_steps: 2_000_000
8383
batch_size: 256 # 32 (gpus) * 8 (batch per gpu) = 256 (total batch size)
8484
epochs: 45
8585
graph_construction_radius: 6.0 # Å

models/deepmd/dpa-3.1-mptrj.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ hyperparams:
6868
virial: 0.02 -> 1
6969
initial_learning_rate: 0.001
7070
learning_rate_schedule: ExpLR - start_lr=0.001, decay_steps=5000, stop_lr=0.00001
71-
training_steps: 2000000
71+
training_steps: 2_000_000
7272
round2:
7373
loss: Huber
7474
loss_weights:
@@ -77,7 +77,7 @@ hyperparams:
7777
virial: 2.5
7878
initial_learning_rate: 0.0002
7979
learning_rate_schedule: ExpLR - start_lr=0.0002, decay_steps=5000, stop_lr=0.00001
80-
training_steps: 1000000
80+
training_steps: 1_000_000
8181
batch_size: 64 # 16 (gpus) * 4 (batch per gpu) = 64 (total batch size)
8282
epochs: 120 # round1 80 + round2 40
8383
graph_construction_radius: 6.0 # Å

models/deepmd/dpa3-v1-mptrj.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ hyperparams:
7070
virial: 0.02 -> 1
7171
initial_learning_rate: 0.001
7272
learning_rate_schedule: ExpLR - start_lr=0.001, decay_steps=5000, stop_lr=0.00001
73-
training_steps: 2000000
73+
training_steps: 2_000_000
7474
round2:
7575
loss: Huber
7676
loss_weights:
@@ -79,7 +79,7 @@ hyperparams:
7979
virial: 2.5
8080
initial_learning_rate: 0.0002
8181
learning_rate_schedule: ExpLR - start_lr=0.0002, decay_steps=5000, stop_lr=0.00001
82-
training_steps: 2000000
82+
training_steps: 2_000_000
8383
batch_size: 64 # 16 (gpus) * 4 (batch per gpu) = 64 (total batch size)
8484
epochs: 160 # round1 80 + round2 80
8585
graph_construction_radius: 6.0 # Å

0 commit comments

Comments
 (0)