@mat3ra/esse 2024.1.25-7 → 2024.1.26-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,290 @@
1
+ # --------------------------- #
2
+ # Physics Based #
3
+ # --------------------------- #
4
+ - name: physics-based
5
+ slug: pb
6
+ children:
7
+ # --------------------------- #
8
+ # Quantum Mechanical #
9
+ # --------------------------- #
10
+ - name: quantum-mechanical
11
+ slug: qm
12
+ field: type
13
+ children:
14
+ # DFT
15
+ - name: density functional theory
16
+ slug: dft
17
+ field: subtype
18
+ children:
19
+ ## LDA
20
+ - name: local density approximation
21
+ slug: lda
22
+ schema:
23
+ type: object
24
+ properties:
25
+ functional:
26
+ type: object
27
+ enum:
28
+ - name: perdew-zunger
29
+ slug: pz
30
+ reference:
31
+ doi: https://doi.org/10.1103/PhysRevB.23.5048
32
+ - name: perdew-wang
33
+ slug: pw
34
+ reference:
35
+ doi: https://doi.org/10.1103/PhysRevB.45.13244
36
+ - name: vosko-wilk-nusair
37
+ slug: vwn
38
+ reference:
39
+ doi: https://doi.org/10.1139/p80-159
40
+ # modifiers:
41
+ # type: array
42
+ # items:
43
+ # type: object
44
+ # enum:
45
+ # - name: hubbard-corrected
46
+ # schema:
47
+ # type: object
48
+ # properties:
49
+ # hubbardU:
50
+ # type: number
51
+ # - name: spin-resolved
52
+ # schema:
53
+ # type: object
54
+ # properties:
55
+ # non-collinear:
56
+ # type: boolean
57
+ required:
58
+ - functional
59
+ ## GGA
60
+ - name: generalized gradient approximation
61
+ slug: gga
62
+ schema:
63
+ type: object
64
+ properties:
65
+ functional:
66
+ type: object
67
+ enum:
68
+ - name: perdew-burke-ernzerhof
69
+ slug: pbe
70
+ reference:
71
+ doi: https://doi.org/10.1103/PhysRevLett.77.3865
72
+ - name: perdew-burke-ernzerhof-solid
73
+ slug: pbesol
74
+ reference:
75
+ doi: https://doi.org/10.1103/PhysRevLett.100.136406
76
+ # modifiers:
77
+ # type: array
78
+ # items:
79
+ # type: object
80
+ # enum:
81
+ # - name: hubbard-corrected
82
+ # schema:
83
+ # type: object
84
+ # properties:
85
+ # hubbardU:
86
+ # type: number
87
+ # - name: spin-resolved
88
+ # schema:
89
+ # type: object
90
+ # properties:
91
+ # non-collinear:
92
+ # type: boolean
93
+ required:
94
+ - functional
95
+ ## HSE
96
+ - name: hybrid functionals
97
+ slug: hyb
98
+ schema:
99
+ type: object
100
+ properties:
101
+ functional:
102
+ type: object
103
+ enum:
104
+ - name: heyd-scuseria-ernzerhof-03
105
+ slug: hse03
106
+ reference:
107
+ doi: http://dx.doi.org/10.1063/1.1564060
108
+ - name: heyd-scuseria-ernzerhof-06
109
+ slug: hse06
110
+ reference:
111
+ doi: http://dx.doi.org/10.1063/1.2404663
112
+ - name: perdew-burke-ernzerhof-0
113
+ slug: hse03
114
+ reference:
115
+ doi: http://dx.doi.org/10.1063/1.472933
116
+ - name: becke-3-lee-yang-parr
117
+ slug: b3lyp
118
+ reference:
119
+ doi: http://dx.doi.org/10.1063/1.464913
120
+ # modifiers:
121
+ # type: array
122
+ # items:
123
+ # type: object
124
+ # enum:
125
+ # - name: spin-resolved
126
+ # schema:
127
+ # type: object
128
+ # properties:
129
+ # non-collinear:
130
+ # type: boolean
131
+ required:
132
+ - functional
133
+ ## GW
134
+ - name: gw approximation
135
+ omit: true
136
+ slug: gw
137
+ schema:
138
+ type: object
139
+ properties:
140
+ category:
141
+ type: object
142
+ enum:
143
+ - name: one-shot g0w0
144
+ slug: g0w0
145
+ reference:
146
+ doi: https://doi.org/10.1103/PhysRevB.34.5390
147
+ - name: self-consistent gw
148
+ slug: scgw
149
+ reference:
150
+ doi: https://doi.org/10.1103/PhysRevLett.99.246403
151
+ parent:
152
+ oneOf:
153
+ - $ref: "#/1/children/1/children/1/children/1" # LDA
154
+ - $ref: "#/1/children/1/children/1/children/2" # GGA
155
+ modifiers:
156
+ type: array
157
+ items:
158
+ type: object
159
+ enum:
160
+ - name: spin-resolved
161
+ schema:
162
+ type: object
163
+ properties:
164
+ non-collinear:
165
+ type: boolean
166
+ required:
167
+ - category
168
+ - parent
169
+
170
+ # QMC
171
+ - name: quantum monte carlo
172
+ omit: true
173
+ slug: qmc
174
+ children:
175
+ ## DMC
176
+ - name: diffusion monte carlo
177
+ slug: dmc
178
+ schema:
179
+ type: object
180
+ properties:
181
+ category:
182
+ type: object
183
+ enum:
184
+ # only one functional has to be selected
185
+ - name: casino
186
+ slug: csn
187
+ reference:
188
+ url: https://vallico.net/casinoqmc/what-is-casino/
189
+ modifiers:
190
+ type: array
191
+ items:
192
+ type: object
193
+ enum:
194
+ required:
195
+ - category
196
+ # --------------------------- #
197
+ # Molecular modeling #
198
+ # --------------------------- #
199
+ - name: molecular modeling
200
+ omit: true
201
+ slug: md
202
+ children:
203
+ # CL
204
+ - name: classical molecular dynamics
205
+ slug: clmd
206
+ children:
207
+ ## LJ
208
+ - name: lennard-jones
209
+ slug: lj
210
+ schema:
211
+ type: object
212
+ properties:
213
+ # ???: this may need to go into method
214
+ category:
215
+ type: object
216
+ enum:
217
+ - name: <name of source used for potential coefficients>
218
+ slug: <slug>
219
+ reference:
220
+ doi: <url>
221
+ modifiers:
222
+ type: array
223
+ items:
224
+ type: object
225
+ enum:
226
+ required:
227
+ - category
228
+ # AB
229
+ - name: ab-initio molecular dynamics
230
+ slug: aimd
231
+ children:
232
+ ## BO
233
+ - name: born-oppenheimer
234
+ slug: bo
235
+ schema:
236
+ type: object
237
+ properties:
238
+ # ???: this may need to go into method
239
+ parents:
240
+ type: array
241
+ items:
242
+ enum:
243
+ - name: <name of source used for ab-initio calculation>
244
+ slug: <slug>
245
+ reference:
246
+ doi: <url>
247
+ - name: <name of source used for md calculation>
248
+ slug: <slug>
249
+ reference:
250
+ doi: <url>
251
+ minItems: 2
252
+ required:
253
+ - parents
254
+
255
+ ## CP
256
+ - name: car-parinello
257
+ slug: cp
258
+ schema:
259
+ type: object
260
+
261
+ # --------------------------- #
262
+ # Statistical #
263
+ # --------------------------- #
264
+ - name: statistical
265
+ slug: st
266
+ children:
267
+ # --------------------------- #
268
+ # Deterministic #
269
+ # --------------------------- #
270
+ - name: deterministic
271
+ slug: det
272
+ field: type
273
+ children:
274
+ # ML
275
+ - name: machine learning
276
+ slug: ml
277
+ field: subtype
278
+ children:
279
+ ## ML Classification
280
+ - name: classification
281
+ omit: true
282
+ slug: cl
283
+ schema:
284
+ type: object
285
+ ## ML Regression
286
+ - name: regression
287
+ slug: re
288
+ children:
289
+ schema:
290
+ type: object
@@ -0,0 +1,277 @@
1
+ convergence_ionic:
2
+ defaults:
3
+ units: eV
4
+ schemaId: properties-directory/workflow/convergence/ionic
5
+ isMonitor: true
6
+
7
+ convergence_electronic:
8
+ defaults:
9
+ units: eV
10
+ schemaId: properties-directory/workflow/convergence/electronic
11
+ isMonitor: true
12
+
13
+ # SCALAR
14
+ pressure:
15
+ defaults:
16
+ units: kbar
17
+ schemaId: properties-directory/scalar/pressure
18
+ isResult: true
19
+
20
+ total_energy:
21
+ defaults:
22
+ units: eV
23
+ schemaId: properties-directory/scalar/total-energy
24
+ isResult: true
25
+
26
+ surface_energy:
27
+ defaults:
28
+ units: eV/A^2
29
+ schemaId: properties-directory/scalar/surface-energy
30
+ isResult: true
31
+
32
+ fermi_energy:
33
+ defaults:
34
+ units: eV
35
+ schemaId: properties-directory/scalar/fermi-energy
36
+ isResult: true
37
+
38
+ total_force:
39
+ defaults:
40
+ units: eV/angstrom
41
+ schemaId: properties-directory/scalar/total-force
42
+ isResult: true
43
+
44
+ zero_point_energy:
45
+ defaults:
46
+ units: eV
47
+ schemaId: properties-directory/scalar/zero-point-energy
48
+ isResult: true
49
+
50
+ reaction_energy_barrier:
51
+ defaults:
52
+ units: eV
53
+ schemaId: properties-directory/scalar/reaction-energy-barrier
54
+ isResult: true
55
+
56
+ electron_affinity:
57
+ defaults:
58
+ units: eV
59
+ schemaId: properties-directory/scalar/electron-affinity
60
+ isResult: true
61
+
62
+ ionization_potential:
63
+ defaults:
64
+ units: eV
65
+ schemaId: properties-directory/scalar/ionization-potential
66
+ isResult: true
67
+
68
+ valence_band_offset:
69
+ defaults:
70
+ units: eV
71
+ schemaId: properties-directory/scalar/valence-band-offset
72
+
73
+ # NON-SCALAR
74
+ phonon_dos:
75
+ defaults:
76
+ xAxis:
77
+ label: frequency
78
+ units: cm-1
79
+ yAxis:
80
+ label: Phonon DOS
81
+ units: states/cm-1
82
+ schemaId: properties-directory/non-scalar/phonon-dos
83
+ isResult: true
84
+
85
+ phonon_dispersions:
86
+ defaults:
87
+ xAxis:
88
+ label: qpoints
89
+ units: crystal
90
+ yAxis:
91
+ label: frequency
92
+ units: cm-1
93
+ schemaId: properties-directory/non-scalar/phonon-dispersions
94
+ isResult: true
95
+
96
+ total_energy_contributions:
97
+ defaults:
98
+ units: eV
99
+ schemaId: properties-directory/non-scalar/total-energy-contributions
100
+ isResult: true
101
+
102
+ band_gaps:
103
+ types:
104
+ - direct
105
+ - indirect
106
+ defaults:
107
+ units: eV
108
+ schemaId: properties-directory/non-scalar/band-gaps
109
+ isResult: true
110
+
111
+ stress_tensor:
112
+ defaults:
113
+ units: kbar
114
+ schemaId: properties-directory/non-scalar/stress-tensor
115
+ isResult: true
116
+
117
+ band_structure:
118
+ defaults:
119
+ xAxis:
120
+ label: kpoints
121
+ units: crystal
122
+ yAxis:
123
+ label: energy
124
+ units: eV
125
+
126
+ schemaId: properties-directory/non-scalar/band-structure
127
+ isResult: true
128
+
129
+ density_of_states:
130
+ defaults:
131
+ xAxis:
132
+ label: energy
133
+ units: eV
134
+ yAxis:
135
+ label: density of states
136
+ units: states/unitcell
137
+ schemaId: properties-directory/non-scalar/density-of-states
138
+ isResult: true
139
+
140
+ reaction_energy_profile:
141
+ defaults:
142
+ xAxis:
143
+ label: reaction coordinate
144
+ yAxis:
145
+ label: energy
146
+ units: eV
147
+ schemaId: properties-directory/non-scalar/reaction-energy-profile
148
+ isResult: true
149
+
150
+ potential_profile:
151
+ defaults:
152
+ xAxis:
153
+ label: z coordinate
154
+ yAxis:
155
+ label: energy
156
+ units: eV
157
+ schemaId: properties-directory/non-scalar/potential-profile
158
+ isResult: true
159
+
160
+ charge_density_profile:
161
+ defaults:
162
+ xAxis:
163
+ label: z coordinate
164
+ yAxis:
165
+ label: charge density
166
+ units: e/A
167
+ schemaId: properties-directory/non-scalar/charge-density-profile
168
+ isResult: true
169
+
170
+ vibrational_spectrum:
171
+ defaults:
172
+ xAxis:
173
+ label: wavenumber
174
+ units: cm-1
175
+ yAxis:
176
+ label: Absorption coefficient
177
+ units: km/mol
178
+ schemaId: properties-directory/non-scalar/vibrational-spectrum
179
+ isResult: true
180
+
181
+ file_content:
182
+ schemaId: properties-directory/non-scalar/file-content
183
+ isResult: true
184
+
185
+ average_potential_profile:
186
+ defaults:
187
+ xAxis:
188
+ label: z coordinate
189
+ units: angstrom
190
+ yAxis:
191
+ label: energy
192
+ units: eV
193
+ schemaId: properties-directory/non-scalar/average-potential-profile
194
+ isResult: true
195
+
196
+ dielectric_tensor:
197
+ schemaId: properties-directory/non-scalar/dielectric-tensor
198
+ isResult: true
199
+
200
+ # STRUCTURAL
201
+ basis:
202
+ defaults:
203
+ units: angstrom
204
+ schemaId: properties-directory/structural/basis
205
+
206
+ lattice:
207
+ defaults:
208
+ units: angstrom
209
+ schemaId: properties-directory/structural/lattice
210
+
211
+ atomic_forces:
212
+ defaults:
213
+ units: eV/angstrom
214
+ schemaId: properties-directory/structural/atomic-forces
215
+ isResult: true
216
+
217
+ atomic_constraints:
218
+ schemaId: properties-directory/structural/basis/atomic-constraints
219
+
220
+ p-norm:
221
+ schemaId: properties-directory/structural/p-norm
222
+
223
+ volume:
224
+ defaults:
225
+ units: angstrom^3
226
+ schemaId: properties-directory/structural/volume
227
+
228
+ symmetry:
229
+ defaults:
230
+ units: angstrom
231
+ schemaId: properties-directory/structural/symmetry
232
+
233
+ elemental_ratio:
234
+ schemaId: properties-directory/structural/elemental-ratio
235
+
236
+ density:
237
+ defaults:
238
+ units: g/cm^3
239
+ schemaId: properties-directory/structural/density
240
+
241
+ magnetic_moments:
242
+ defaults:
243
+ units: uB
244
+ schemaId: properties-directory/structural/magnetic-moments
245
+ isResult: true
246
+
247
+ bonds:
248
+ defaults:
249
+ units: angstrom
250
+ schemaId: properties-directory/structural/basis/bonds
251
+
252
+ inchi:
253
+ schemaId: properties-directory/structural/inchi
254
+
255
+ inchi_key:
256
+ schemaId: properties-directory/structural/inchi-key
257
+
258
+ material:
259
+ schemaId: material
260
+
261
+ hubbard_u:
262
+ defaults:
263
+ units: eV
264
+ schemaId: properties-directory/non-scalar/hubbard-u
265
+ isResult: true
266
+
267
+ hubbard_v:
268
+ defaults:
269
+ units: eV
270
+ schemaId: properties-directory/non-scalar/hubbard-v
271
+ isResult: true
272
+
273
+ hubbard_v_nn:
274
+ defaults:
275
+ units: eV
276
+ schemaId: properties-directory/non-scalar/hubbard-v-nn
277
+ isResult: true
package/npmignore CHANGED
@@ -1,6 +1,5 @@
1
1
  src/py/
2
2
  tests/
3
3
  pyproject.toml
4
- /manifest/
5
4
  .github
6
5
  .husky
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@mat3ra/esse",
3
- "version": "2024.1.25-7",
3
+ "version": "2024.1.26-1",
4
4
  "description": "Mat3ra's Excellent Source of Schemas and Examples (ESSE) for Digital Materials R&D",
5
5
  "scripts": {
6
6
  "prepublishOnly": "rm -rf lib; npm run transpile",
7
7
  "transpile": "mkdir -p lib; babel src/js --out-dir lib/js; node build_schemas.js",
8
8
  "transpile-and-build-assets": "mkdir -p lib; babel src/js --out-dir lib/js; BUILD_ASSETS=true BUILD_PATH='./lib/js' node build_schemas.js",
9
9
  "build:assets": "node build_schemas.js",
10
+ "build:js-and-python-modules": "BUILD_PYTHON_MODULES=true node build_schemas.js",
10
11
  "build:assets-with-docs": "BUILD_ASSETS=true node build_schemas.js",
11
12
  "test": "nyc --reporter=text mocha --bail --require @babel/register tests/js/",
12
13
  "lint": "eslint src/js && prettier --write src/js",
@@ -1,17 +1,27 @@
1
1
  import Ajv from "ajv";
2
+ import fs from "fs";
3
+ import yaml from "js-yaml";
2
4
 
3
5
  import { buildSchemaDefinitions } from "./schemaUtils";
4
- import { EXAMPLES_DIR, SCHEMAS_DIR } from "./settings";
6
+ import { EXAMPLES_DIR, PROPERTIES_MANIFEST_PATH, SCHEMAS_DIR } from "./settings";
5
7
  import { parseIncludeReferenceStatementsByDir } from "./utils";
6
8
 
7
9
  const SCHEMAS = parseIncludeReferenceStatementsByDir(SCHEMAS_DIR);
8
10
  const EXAMPLES = parseIncludeReferenceStatementsByDir(EXAMPLES_DIR, true);
11
+ const PROPERTIES_MANIFEST = yaml.load(
12
+ fs.readFileSync(PROPERTIES_MANIFEST_PATH, { encoding: "utf-8" }),
13
+ );
14
+ const RESULTS = Object.entries(PROPERTIES_MANIFEST)
15
+ .map((k) => (k[1].isResult ? k[0] : null))
16
+ .filter((x) => x);
9
17
 
10
18
  export class ESSE {
11
- constructor() {
12
- this.schemas = SCHEMAS;
13
- this.wrappedExamples = EXAMPLES;
14
- this.examples = EXAMPLES.map((example) => example.data);
19
+ constructor(config = {}) {
20
+ this.schemas = config.schemas || SCHEMAS;
21
+ this.wrappedExamples = config.wrappedExamples || EXAMPLES;
22
+ this.examples = this.wrappedExamples.map((example) => example.data);
23
+ this.propertiesManifest = config.propertiesManifest || PROPERTIES_MANIFEST;
24
+ this.results = config.results || RESULTS;
15
25
  }
16
26
 
17
27
  getSchemaById(schemaId) {
@@ -2,3 +2,7 @@ import path from "path";
2
2
 
3
3
  export const SCHEMAS_DIR = path.resolve(__dirname, "../../../schema");
4
4
  export const EXAMPLES_DIR = path.resolve(__dirname, "../../../example");
5
+ export const PROPERTIES_MANIFEST_PATH = path.resolve(
6
+ __dirname,
7
+ "../../../manifest/properties.yaml",
8
+ );