Skip to content

Commit 5405005

Browse files
committed
add usage example code fence and WBM summary column glossary to how-to-use/+page.svx
update package.json deps
1 parent 5084886 commit 5405005

File tree

4 files changed

+54
-35
lines changed

4 files changed

+54
-35
lines changed

site/package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@
1717
},
1818
"devDependencies": {
1919
"@iconify/svelte": "^3.0.1",
20-
"@sveltejs/adapter-static": "1.0.0-next.48",
21-
"@sveltejs/kit": "1.0.0-next.571",
22-
"@sveltejs/vite-plugin-svelte": "^1.4.0",
23-
"@typescript-eslint/eslint-plugin": "^5.45.0",
24-
"@typescript-eslint/parser": "^5.45.0",
25-
"eslint": "^8.29.0",
20+
"@sveltejs/adapter-static": "1.0.0",
21+
"@sveltejs/kit": "1.0.1",
22+
"@sveltejs/vite-plugin-svelte": "^2.0.2",
23+
"@typescript-eslint/eslint-plugin": "^5.47.0",
24+
"@typescript-eslint/parser": "^5.47.0",
25+
"eslint": "^8.30.0",
2626
"eslint-plugin-svelte3": "^4.0.0",
2727
"hastscript": "^7.1.0",
2828
"highlight.js": "^11.7.0",
2929
"mdsvex": "^0.10.6",
30-
"prettier": "^2.8.0",
31-
"prettier-plugin-svelte": "^2.8.1",
30+
"prettier": "^2.8.1",
31+
"prettier-plugin-svelte": "^2.9.0",
3232
"rehype-autolink-headings": "^6.1.1",
3333
"rehype-slug": "^5.1.0",
34-
"svelte": "^3.53.1",
35-
"svelte-check": "^2.10.0",
34+
"svelte": "^3.55.0",
35+
"svelte-check": "^3.0.1",
3636
"svelte-github-corner": "^0.1.0",
37-
"svelte-preprocess": "^4.10.7",
38-
"svelte-toc": "^0.5.0",
39-
"svelte2tsx": "^0.5.21",
37+
"svelte-preprocess": "^5.0.0",
38+
"svelte-toc": "^0.5.1",
39+
"svelte2tsx": "^0.6.0",
4040
"tslib": "^2.4.1",
41-
"typescript": "^4.9.3",
42-
"vite": "^3.2.4"
41+
"typescript": "^4.9.4",
42+
"vite": "^4.0.3"
4343
},
4444
"prettier": {
4545
"semi": false,

site/src/app.css

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ a:hover {
4444
}
4545
code {
4646
overflow-wrap: break-word;
47-
padding: 0 2pt;
47+
padding: 1pt 3pt;
4848
border-radius: 2pt;
4949
font-size: 1.2em;
50-
background-color: rgba(255, 255, 255, 0.15);
50+
background-color: rgba(0, 255, 255, 0.1);
5151
}
5252
pre code {
5353
background-color: transparent;
@@ -57,8 +57,9 @@ pre {
5757
border-radius: 4pt;
5858
font-size: 9.5pt;
5959
background-color: rgba(255, 255, 255, 0.05);
60-
padding: 1em;
6160
overflow-x: auto;
61+
padding: 6pt 8pt;
62+
margin: 1em auto;
6263
}
6364
ul {
6465
padding-left: 1em;

site/src/routes/how-to-use/+page.svx

+35-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1-
<script lang="ts">
2-
// import * as d3 from 'd3'
1+
## Installation
32

4-
// const promise = d3.csv('https://github.com/janosh/matbench-discovery/raw/main/data/wbm/2022-10-19-wbm-summary.csv')
5-
// const promise = d3.csv('https://raw.githubusercontent.com/janosh/pymatviz/main/pymatviz/elements.csv')
6-
</script>
7-
8-
The primary way to use this benchmark is through the [PyPI Python package](https://pypi.org/project/matbench-discovery):
3+
The recommended way to use this benchmark is through the [PyPI Python package](https://pypi.org/project/matbench-discovery):
94

105
```zsh
116
pip install matbench-discovery
127
```
138

9+
## Usage
10+
11+
Here's an example script of how to download the training and test set files for training a new model, recording the results and submitting them via pull request to this benchmark:
12+
13+
```py
14+
from matbench_discovery.data import load_train_test
15+
16+
df_wbm = load_train_test("wbm-summary", version="v1.0.0")
17+
18+
print(df_wbm.shape)
19+
>>> (256963, 17)
20+
21+
print(list(df_wbm))
22+
>>> ['formula', 'n_sites', 'volume', 'uncorrected_energy', 'e_form_per_atom_wbm', 'e_hull_wbm', 'bandgap_pbe', 'uncorrected_energy_from_cse', 'e_correction_per_atom_legacy', 'e_correction_per_atom_mp2020', 'e_above_hull_uncorrected_ppd_mp', 'e_above_hull_mp2020_corrected_ppd_mp', 'e_above_hull_legacy_corrected_ppd_mp', 'e_form_per_atom_uncorrected', 'e_form_per_atom_mp2020_corrected', 'e_form_per_atom_legacy_corrected', 'wyckoff_spglib']
23+
```
24+
25+
Column glossary
26+
27+
1. `formula`: A compound's unreduced alphabetical formula
28+
1. `n_sites`: Number of sites in the structure's unit cell
29+
1. `volume`: Relaxed structure volume in cubic Angstrom
30+
1. `uncorrected_energy`: Raw VASP-computed energy
31+
1. `e_form_per_atom_wbm`: Original formation energy per atom from [WBM paper]
32+
1. `e_hull_wbm`: Original energy above the convex hull in (eV/atom) from [WBM paper]
33+
1. `bandgap_pbe`: PBE-level DFT band gap from [WBM paper]
34+
1. `uncorrected_energy_from_cse`: Should be the same as `uncorrected_energy`. There are 2 cases where the absolute difference reported in the summary file and in the computed structure entries exceeds 0.1 eV (`wbm-2-3218`, `wbm-1-56320`) which we attribute to rounding errors.
35+
1. `e_form_per_atom_mp2020_corrected`: Matbench Discovery takes these as ground truth for the formation energy. Includes MP2020 energy corrections (latest correction scheme at time of release).
36+
1. `e_above_hull_mp2020_corrected_ppd_mp`: Energy above hull distances in eV/atom after applying the MP2020 correction scheme and with respect to the Materials Project convex hull. Matbench Discovery takes these as ground truth for material stability. Any value above 0 is assumed to be an unstable/metastable material.
37+
<!-- TODO document remaining columns, or maybe drop them from df -->
38+
39+
## Direct Download
40+
1441
You can also download the data files directly:
1542

1643
1. [`2022-10-19-wbm-summary.csv`](https://github.com/janosh/matbench-discovery/raw/v1.0.0/data/wbm/2022-10-19-wbm-summary.csv) [[GitHub](https://github.com/janosh/matbench-discovery/blob/v1/data/wbm/2022-10-19-wbm-summary.csv)]: 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. e_form_per_atom and e_above_hull each have 3 separate columns for old, new and no Materials
@@ -21,6 +48,4 @@ You can also download the data files directly:
2148
1. [`2022-09-18-ppd-mp.pkl.gz`](https://github.com/janosh/matbench-discovery/raw/v1.0.0/data/wbm/2022-09-18-ppd-mp.pkl.gz) [[GitHub](https://github.com/janosh/matbench-discovery/blob/v1/data/wbm/2022-09-18-ppd-mp.pkl.gz)]: [PatchedPhaseDiagram](https://pymatgen.org/pymatgen.analysis.phase_diagram.html#pymatgen.analysis.phase_diagram.PatchedPhaseDiagram) constructed from all MP ComputedStructureEntries
2249
1. [`2022-09-19-mp-elemental-ref-energies.json`](https://github.com/janosh/matbench-discovery/raw/v1.0.0/data/wbm/2022-09-19-mp-elemental-ref-energies.json) [[GitHub](https://github.com/janosh/matbench-discovery/blob/v1/data/wbm/2022-09-19-mp-elemental-ref-energies.json)]: Minimum energy PDEntries for each element present in the Materials Project
2350

24-
<!-- {#await promise then data}
25-
{JSON.stringify(data)}
26-
{/await} -->
51+
[wbm paper]: https://nature.com/articles/s41524-020-00481-6

site/static/prism-vsc-dark-plus.css

-7
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ code[class*='language-'] ::selection {
5050
}
5151
}
5252

53-
/* Code blocks */
54-
pre[class*='language-'] {
55-
padding: 1em;
56-
margin: 0.5em 0;
57-
overflow: auto;
58-
}
59-
6053
:not(pre) > code[class*='language-'],
6154
pre[class*='language-'] {
6255
color: white;

0 commit comments

Comments
 (0)