Skip to content

Commit df4f827

Browse files
committed
add figshare article link to /contribute page
1 parent 071174a commit df4f827

File tree

9 files changed

+89
-70
lines changed

9 files changed

+89
-70
lines changed

data/figshare/1.0.0.json

+43-40
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
11
{
2-
"alignn_checkpoint": [
3-
"https://figshare.com/ndownloader/files/41233560",
4-
"2023-06-02-pbenner-best-alignn-model.pth.zip"
5-
],
6-
"mace_checkpoint": [
7-
"https://figshare.com/ndownloader/files/42374049",
8-
"2023-08-14-mace-yuan-trained-mptrj-04.model"
9-
],
10-
"mp_computed_structure_entries": [
11-
"https://figshare.com/ndownloader/files/40344436",
12-
"2023-02-07-mp-computed-structure-entries.json.gz"
13-
],
14-
"mp_elemental_ref_entries": [
15-
"https://figshare.com/ndownloader/files/40387775",
16-
"2023-02-07-mp-elemental-reference-entries.json.gz"
17-
],
18-
"mp_energies": [
19-
"https://figshare.com/ndownloader/files/41296875",
20-
"2023-01-10-mp-energies.csv.gz"
21-
],
22-
"mp_patched_phase_diagram": [
23-
"https://figshare.com/ndownloader/files/40344451",
24-
"2023-02-07-ppd-mp.pkl.gz"
25-
],
26-
"wbm_computed_structure_entries": [
27-
"https://figshare.com/ndownloader/files/40344463",
28-
"2022-10-19-wbm-computed-structure-entries.json.bz2"
29-
],
30-
"wbm_initial_structures": [
31-
"https://figshare.com/ndownloader/files/40344466",
32-
"2022-10-19-wbm-init-structs.json.bz2"
33-
],
34-
"wbm_cses_plus_init_structs": [
35-
"https://figshare.com/ndownloader/files/40344469",
36-
"2022-10-19-wbm-computed-structure-entries+init-structs.json.bz2"
37-
],
38-
"wbm_summary": [
39-
"https://figshare.com/ndownloader/files/41296866",
40-
"2022-10-19-wbm-summary.csv.gz"
41-
]
2+
"files": {
3+
"alignn_checkpoint": [
4+
"https://figshare.com/ndownloader/files/41233560",
5+
"2023-06-02-pbenner-best-alignn-model.pth.zip"
6+
],
7+
"mace_checkpoint": [
8+
"https://figshare.com/ndownloader/files/42374049",
9+
"2023-08-14-mace-yuan-trained-mptrj-04.model"
10+
],
11+
"mp_computed_structure_entries": [
12+
"https://figshare.com/ndownloader/files/40344436",
13+
"2023-02-07-mp-computed-structure-entries.json.gz"
14+
],
15+
"mp_elemental_ref_entries": [
16+
"https://figshare.com/ndownloader/files/40387775",
17+
"2023-02-07-mp-elemental-reference-entries.json.gz"
18+
],
19+
"mp_energies": [
20+
"https://figshare.com/ndownloader/files/41296875",
21+
"2023-01-10-mp-energies.csv.gz"
22+
],
23+
"mp_patched_phase_diagram": [
24+
"https://figshare.com/ndownloader/files/40344451",
25+
"2023-02-07-ppd-mp.pkl.gz"
26+
],
27+
"wbm_computed_structure_entries": [
28+
"https://figshare.com/ndownloader/files/40344463",
29+
"2022-10-19-wbm-computed-structure-entries.json.bz2"
30+
],
31+
"wbm_initial_structures": [
32+
"https://figshare.com/ndownloader/files/40344466",
33+
"2022-10-19-wbm-init-structs.json.bz2"
34+
],
35+
"wbm_cses_plus_init_structs": [
36+
"https://figshare.com/ndownloader/files/40344469",
37+
"2022-10-19-wbm-computed-structure-entries+init-structs.json.bz2"
38+
],
39+
"wbm_summary": [
40+
"https://figshare.com/ndownloader/files/41296866",
41+
"2022-10-19-wbm-summary.csv.gz"
42+
]
43+
},
44+
"article": "https://figshare.com/articles/dataset/22715158"
4245
}

matbench_discovery/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# ComputedStructureEntries or using PatchedPhaseDiagram to get e_above_hull
2828
# warnings are:
2929
# > No electronegativity for Ne. Setting to NaN. This has no physical meaning
30-
warnings.filterwarnings(
31-
action="ignore", category=UserWarning, module="pymatgen", lineno=221
32-
)
30+
for lineno in (120, 221, 1043):
31+
warnings.filterwarnings(
32+
action="ignore", category=UserWarning, module="pymatgen", lineno=lineno
33+
)

matbench_discovery/data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def load(
8686
raise ValueError(f"Unknown {data_key=}, must be one of {list(DATA_FILES)}.")
8787

8888
with open(f"{FIGSHARE}/{version}.json") as json_file:
89-
file_urls = json.load(json_file)
89+
file_urls = json.load(json_file)["files"]
9090

9191
file = DataFiles.__dict__[data_key]
9292

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
</h4>
1515

16-
> TL;DR: We benchmark ML models on crystal stability prediction from unrelaxed structures finding universal interatomic potentials (UIP) like [CHGNet](https://github.com/CederGroupHub/chgnet), [M3GNet](https://github.com/materialsvirtuallab/m3gnet) and [MACE](https://github.com/ACEsuit/mace) to be highly accurate, robust across chemistries and ready for production use in high-throughput discovery pipelines.
16+
> TL;DR: We benchmark ML models on crystal stability prediction from unrelaxed structures finding universal interatomic potentials (UIP) like [CHGNet](https://github.com/CederGroupHub/chgnet), [M3GNet](https://github.com/materialsvirtuallab/m3gnet) and [MACE](https://github.com/ACEsuit/mace) to be highly accurate, robust across chemistries and ready for production use in high-throughput materials discovery.
1717
1818
Matbench Discovery is an [interactive leaderboard](https://janosh.github.io/matbench-discovery/models) and associated [PyPI package](https://pypi.org/project/matbench-discovery) which together make it easy to rank ML energy models on a task designed to closely simulate a high-throughput discovery campaign for new stable inorganic crystals.
1919

scripts/upload_to_figshare.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,12 @@ def main() -> int:
162162
print(f"{file_path}: {file_url}")
163163

164164
# write uploaded file keys mapped to their URLs to JSON
165+
figshare_urls = {
166+
"files": uploaded_files,
167+
"article": f"https://figshare.com/articles/dataset/{article_id}",
168+
}
165169
with open(file_urls_out_path, "w") as file:
166-
json.dump(uploaded_files, file)
170+
json.dump(figshare_urls, file)
167171
except Exception as exc: # prompt to delete article if something went wrong
168172
answer = ""
169173
print(f"Encountered {exc=}")

site/src/app.css

+10
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,13 @@ input:focus {
221221
outline: none;
222222
background: rgba(255, 255, 255, 0.2);
223223
}
224+
kbd {
225+
border: 1px solid #666;
226+
display: inline-block;
227+
font-weight: 600;
228+
line-height: 1;
229+
white-space: nowrap;
230+
background-color: rgba(255, 255, 255, 0.1);
231+
padding: 1pt 3pt;
232+
border-radius: 2pt;
233+
}

site/src/lib/Footer.svelte

+13-12
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import { repository } from '$site/package.json'
33
import Icon from '@iconify/svelte'
44
5-
let show_tips: boolean
6-
const tips_title = `Usage Tips`
7-
let dialog: HTMLDialogElement
8-
let btn: HTMLButtonElement
5+
export let show_tips: boolean = false
6+
export let tips_title = `Usage Tips`
7+
export let dialog: HTMLDialogElement
8+
export let btn: HTMLButtonElement
99
1010
function close_if_outside_click(event: MouseEvent) {
1111
const is_outside = dialog && !dialog.contains(event.target as Node)
@@ -47,10 +47,17 @@
4747
<dialog bind:this={dialog} open={show_tips}>
4848
<h3>{tips_title}</h3>
4949
<p title="For keyboard-only site navigation">
50-
<kbd>cmd+k</kbd> to bring up a nav palette.
50+
<kbd>cmd</kbd> + <kbd>k</kbd> to bring up a nav palette.
5151
</p>
5252
<p title="For keyboard-only site navigation">
53-
<kbd>cmd+j</kbd> to bring up these site options.
53+
<kbd>cmd</kbd> + <kbd>j</kbd> to bring up these site options.
54+
</p>
55+
<p title="single click to hide a trace">
56+
<kbd>single click</kbd> a legend handle to hide its corresponding trace in a plot
57+
</p>
58+
<p title="double click to hide all other traces">
59+
<kbd>double click</kbd> the legend handle of any trace in a plot to hide all others. double
60+
click again to show all.
5461
</p>
5562
</dialog>
5663

@@ -90,10 +97,4 @@
9097
dialog > :is(p, h3) {
9198
margin: 0;
9299
}
93-
p kbd {
94-
background-color: rgba(255, 255, 255, 0.1);
95-
padding: 1pt 3pt;
96-
font-size: larger;
97-
border-radius: 2pt;
98-
}
99100
</style>

site/src/routes/contribute/+page.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
`Computed material properties only, no structures. Available properties are VASP energy, formation energy, energy above the convex hull, volume, band gap, number of sites per unit cell, and more.`,
2525
}
2626
const desc_keys = Object.keys(descriptions).sort()
27-
const figshare_keys = Object.keys(figshare_urls).sort()
27+
const figshare_keys = Object.keys(figshare_urls.files).sort()
2828
const missing = figshare_keys.filter((key) => !desc_keys.includes(key))
2929
if (missing.length > 0) {
3030
throw `descriptions must contain all figshare_urls keys, missing=${missing}`
@@ -60,12 +60,15 @@ assert sorted(DATA_FILES) == [
6060
"wbm_summary",
6161
]
6262

63-
# version defaults to latest, set a specific version to avoid breaking changes
63+
# 1st arg can be any DATA_FILES key
64+
# version defaults to latest, set a specific version like 1.0.0 to avoid breaking changes
6465
df_wbm = load("wbm_summary", version="1.0.0")
6566

66-
assert df_wbm.shape == (256963, 15)
67+
# test set size
68+
assert df_wbm.shape == (256_963, 15)
6769

68-
assert list(df_wbm) == [
70+
# available columns in WBM summary data
71+
assert tuple(df_wbm) == [
6972
"formula",
7073
"n_sites",
7174
"volume",
@@ -107,15 +110,12 @@ assert list(df_wbm) == [
107110

108111
## 📥 &thinsp; Direct Download
109112

110-
You can download the data files from Figshare:
113+
You can download all Matbench Discovery data files from <a href={figshare_urls.article}>this Figshare article</a>:
111114

112115
<ol>
113-
{#each Object.entries(figshare_urls) as [key, lst]}
114-
{@const [href, file_name] = lst}
115-
<li>
116-
<Tooltip text={file_name}>
117-
<a {href}>{key}</a>:
118-
</Tooltip>
116+
{#each Object.entries(figshare_urls.files) as [key, [href, file_name]]}
117+
<li style="margin-top: 1ex;">
118+
<strong>{key}</strong> (<a {href}>{file_name}</a>)<br/>
119119
{@html descriptions[key]}
120120
</li>
121121
{/each}

tests/test_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
)
2424

2525
with open(f"{FIGSHARE}/{figshare_versions[-1]}.json") as file:
26-
figshare_urls = json.load(file)
26+
figshare_urls = json.load(file)["files"]
2727

2828
structure = Structure(
2929
lattice=Lattice.cubic(5),

0 commit comments

Comments
 (0)