@mat3ra/esse 2025.5.13-0 → 2025.5.16-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.
Files changed (51) hide show
  1. package/dist/js/esse/JSONSchemasGenerator.js +10 -2
  2. package/dist/js/esse/utils.js +6 -0
  3. package/dist/js/example/apse/materials/builders/slab/pymatgen/parameters.json +6 -0
  4. package/dist/js/example/material/builders/base/selector_parameters.json +3 -0
  5. package/dist/js/example/material/builders/single_material/two_dimensional/slab/selector_parameters.json +6 -0
  6. package/dist/js/example/materials_category/defects/configuration.json +130 -0
  7. package/dist/js/example/materials_category/defects/zero_dimensional/point/configuration.json +138 -0
  8. package/dist/js/schema/apse/materials/builders/slab/pymatgen/parameters.json +33 -0
  9. package/dist/js/schema/element.json +120 -2
  10. package/dist/js/schema/enums/chemical_elements.json +267 -0
  11. package/dist/js/schema/material/builders/base/selector_parameters.json +15 -0
  12. package/dist/js/schema/material/builders/single_material/two_dimensional/slab/builder_parameters.json +33 -0
  13. package/dist/js/schema/material/builders/single_material/two_dimensional/slab/selector_parameters.json +159 -0
  14. package/dist/js/schema/material/reusable/slab/enums/exposed_face.json +11 -0
  15. package/dist/js/schema/material/reusable/slab/number_of_layers.json +1 -1
  16. package/dist/js/schema/material/reusable/slab/termination.json +130 -2
  17. package/dist/js/schema/material/reusable/slab/vacuum.json +1 -1
  18. package/dist/js/schema/material.json +133 -2
  19. package/dist/js/schema/materials_category/defects/configuration.json +772 -0
  20. package/dist/js/schema/materials_category/defects/enums/point_defect_type.json +11 -0
  21. package/dist/js/schema/materials_category/defects/zero_dimensional/point/configuration.json +919 -0
  22. package/dist/js/schema/materials_category/single_material/two_dimensional/slab/configuration.json +135 -4
  23. package/dist/js/schema/properties_directory/structural/basis/atomic_element.json +133 -2
  24. package/dist/js/schema/properties_directory/structural/basis/atomic_elements.json +133 -2
  25. package/dist/js/schema/properties_directory/structural/basis.json +133 -2
  26. package/dist/js/schemas.json +1 -1
  27. package/dist/js/types.d.ts +836 -217
  28. package/example/apse/materials/builders/slab/pymatgen/parameters.json +6 -0
  29. package/example/material/builders/base/selector_parameters.json +3 -0
  30. package/example/material/builders/single_material/two_dimensional/slab/selector_parameters.json +6 -0
  31. package/example/materials_category/defects/configuration.json +5 -0
  32. package/example/materials_category/defects/zero_dimensional/point/configuration.json +11 -0
  33. package/package.json +1 -1
  34. package/schema/apse/materials/builders/slab/pymatgen/parameters.json +33 -0
  35. package/schema/definitions/chemical_elements.json +144 -0
  36. package/schema/element.json +1 -2
  37. package/schema/material/builders/base/selector_parameters.json +15 -0
  38. package/schema/material/builders/single_material/two_dimensional/slab/builder_parameters.json +12 -0
  39. package/schema/material/builders/single_material/two_dimensional/slab/selector_parameters.json +12 -0
  40. package/schema/material/reusable/slab/enums/exposed_face.json +11 -0
  41. package/schema/material/reusable/slab/number_of_layers.json +1 -1
  42. package/schema/material/reusable/slab/termination.json +11 -2
  43. package/schema/material/reusable/slab/vacuum.json +1 -1
  44. package/schema/materials_category/defects/configuration.json +21 -0
  45. package/schema/materials_category/defects/zero_dimensional/point/configuration.json +30 -0
  46. package/schema/materials_category/defects/zero_dimensional/point/enums/type.json +11 -0
  47. package/schema/properties_directory/structural/basis/atomic_element.json +6 -1
  48. package/src/js/esse/JSONSchemasGenerator.ts +11 -1
  49. package/src/js/esse/utils.ts +8 -2
  50. package/dist/js/schema/material/reusable/slab/enums.json +0 -11
  51. package/schema/material/reusable/slab/enums.json +0 -11
@@ -39,10 +39,18 @@ class JSONSchemasGenerator {
39
39
  resolvers: { defaultResolver: json_schema_merge_allof_1.default.options.resolvers.title },
40
40
  };
41
41
  const schemas = this.schemas.map((schema) => {
42
- var _a;
43
42
  console.log(`Resolving schema: ${schema.$id}`);
44
43
  const mergedSchema = skipMergeAllOff ? schema : (0, json_schema_merge_allof_1.default)(schema, mergeAllOfConfig);
45
- const idAsPath = (_a = mergedSchema.$id) === null || _a === void 0 ? void 0 : _a.replace(/-/g, "_");
44
+ let idAsPath = mergedSchema.$id;
45
+ if (!idAsPath) {
46
+ throw new Error(`Schema ID is missing:
47
+ ${JSON.stringify(mergedSchema)}`);
48
+ }
49
+ const schemaHasDash = idAsPath.includes("-");
50
+ if (schemaHasDash) {
51
+ // replace dashes with underscores
52
+ idAsPath = idAsPath.replace(/-/g, "_");
53
+ }
46
54
  const fullPath = `${schemasFolder}/${idAsPath}.json`;
47
55
  fs_1.default.mkdirSync(path_1.default.dirname(fullPath), { recursive: true });
48
56
  fs_1.default.writeFileSync(fullPath, JSON.stringify(mergedSchema, null, 4), "utf8");
@@ -17,11 +17,17 @@ function parseIncludeReferenceStatements(filePath) {
17
17
  const jsonResolver = new json_include_1.JSONInclude();
18
18
  const parsed = jsonResolver.parseIncludeStatements(filePath);
19
19
  const dirPath = path_1.default.dirname(filePath);
20
+ // Store the original $id before dereferencing
21
+ const originalId = parsed.$id;
20
22
  let dereferenced = (0, json_schema_deref_sync_1.default)(parsed, { baseFolder: dirPath, removeIds: true });
21
23
  // handle circular references and use non-dereferenced source
22
24
  if (dereferenced instanceof Error && dereferenced.message === "Circular self reference") {
23
25
  dereferenced = parsed;
24
26
  }
27
+ // Restore the original $id after dereferencing
28
+ if (originalId) {
29
+ dereferenced.$id = originalId;
30
+ }
25
31
  return dereferenced;
26
32
  }
27
33
  exports.parseIncludeReferenceStatements = parseIncludeReferenceStatements;
@@ -0,0 +1,6 @@
1
+ {
2
+ "min_vacuum_size": 1,
3
+ "in_unit_planes": true,
4
+ "reorient_lattice": true,
5
+ "symmetrize": false
6
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "default_index": 0
3
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "termination": {
3
+ "chemical_elements": "C",
4
+ "space_group_symmetry_label": "P6/mmm"
5
+ }
6
+ }
@@ -0,0 +1,130 @@
1
+ {
2
+ "host": {
3
+ "_id": "LCthJ6E2QabYCZqf3",
4
+ "basis": {
5
+ "coordinates": [
6
+ {
7
+ "id": 1,
8
+ "value": [
9
+ 0,
10
+ 0,
11
+ 0
12
+ ]
13
+ },
14
+ {
15
+ "id": 2,
16
+ "value": [
17
+ 0.25,
18
+ 0.25,
19
+ 0.25
20
+ ]
21
+ }
22
+ ],
23
+ "elements": [
24
+ {
25
+ "id": 1,
26
+ "value": "Si"
27
+ },
28
+ {
29
+ "id": 2,
30
+ "value": "Si"
31
+ }
32
+ ],
33
+ "name": "basis",
34
+ "units": "crystal"
35
+ },
36
+ "createdAt": "2016-04-03T05:25:37.430Z",
37
+ "creator": {
38
+ "_id": "HtxACY2wX4b2hS8Rv",
39
+ "cls": "User",
40
+ "slug": "exadmin"
41
+ },
42
+ "derivedProperties": [
43
+ {
44
+ "name": "volume",
45
+ "units": "angstrom^3",
46
+ "value": 131.1
47
+ },
48
+ {
49
+ "name": "density",
50
+ "units": "g/cm^3",
51
+ "value": 2.33
52
+ },
53
+ {
54
+ "name": "symmetry",
55
+ "spaceGroupSymbol": "Fd-3m",
56
+ "tolerance": {
57
+ "units": "angstrom",
58
+ "value": 0.3
59
+ }
60
+ },
61
+ {
62
+ "degree": 10,
63
+ "name": "p-norm",
64
+ "value": 0.71
65
+ },
66
+ {
67
+ "element": "Si",
68
+ "name": "elemental_ratio",
69
+ "value": 0.71
70
+ },
71
+ {
72
+ "name": "inchi",
73
+ "value": ""
74
+ },
75
+ {
76
+ "name": "inchi_key",
77
+ "value": ""
78
+ }
79
+ ],
80
+ "exabyteId": "RKiswuxHKkF3uvLyA",
81
+ "formula": "Si",
82
+ "hash": "4ac3fa057e3530628eb1295c77110eaa",
83
+ "isDefault": false,
84
+ "isNonPeriodic": false,
85
+ "lattice": {
86
+ "name": "lattice",
87
+ "a": 5.14,
88
+ "alpha": 90,
89
+ "b": 5.14,
90
+ "beta": 90,
91
+ "c": 5.14,
92
+ "gamma": 90,
93
+ "type": "CUB",
94
+ "units": {
95
+ "angle": "degree",
96
+ "length": "angstrom"
97
+ },
98
+ "vectors": {
99
+ "a": [
100
+ 5,
101
+ 0.000121312,
102
+ 0.000131415
103
+ ],
104
+ "alat": 1,
105
+ "b": [
106
+ 0.000121312,
107
+ 5,
108
+ 0.000121314
109
+ ],
110
+ "c": [
111
+ 0.000121313,
112
+ 0.000121312,
113
+ 5
114
+ ],
115
+ "units": "angstrom"
116
+ }
117
+ },
118
+ "name": "Silicon FCC",
119
+ "owner": {
120
+ "_id": "HtxACY2wX4b2hS8Rv",
121
+ "cls": "Account",
122
+ "slug": "exabyte"
123
+ },
124
+ "scaledHash": "5bd4eb168e3530628eb1295d88221cbb",
125
+ "schemaVersion": "0.2.0",
126
+ "slug": "silicon-fcc",
127
+ "unitCellFormula": "Si2",
128
+ "updatedAt": "2016-04-04T17:58:42.867Z"
129
+ }
130
+ }
@@ -0,0 +1,138 @@
1
+ {
2
+ "type": "vacancy",
3
+ "coordinate": [
4
+ 0.25,
5
+ 0.25,
6
+ 0.25
7
+ ],
8
+ "use_cartesian_coordinates": false,
9
+ "placement_method": "crystal_site",
10
+ "host": {
11
+ "_id": "LCthJ6E2QabYCZqf3",
12
+ "basis": {
13
+ "coordinates": [
14
+ {
15
+ "id": 1,
16
+ "value": [
17
+ 0,
18
+ 0,
19
+ 0
20
+ ]
21
+ },
22
+ {
23
+ "id": 2,
24
+ "value": [
25
+ 0.25,
26
+ 0.25,
27
+ 0.25
28
+ ]
29
+ }
30
+ ],
31
+ "elements": [
32
+ {
33
+ "id": 1,
34
+ "value": "Si"
35
+ },
36
+ {
37
+ "id": 2,
38
+ "value": "Si"
39
+ }
40
+ ],
41
+ "name": "basis",
42
+ "units": "crystal"
43
+ },
44
+ "createdAt": "2016-04-03T05:25:37.430Z",
45
+ "creator": {
46
+ "_id": "HtxACY2wX4b2hS8Rv",
47
+ "cls": "User",
48
+ "slug": "exadmin"
49
+ },
50
+ "derivedProperties": [
51
+ {
52
+ "name": "volume",
53
+ "units": "angstrom^3",
54
+ "value": 131.1
55
+ },
56
+ {
57
+ "name": "density",
58
+ "units": "g/cm^3",
59
+ "value": 2.33
60
+ },
61
+ {
62
+ "name": "symmetry",
63
+ "spaceGroupSymbol": "Fd-3m",
64
+ "tolerance": {
65
+ "units": "angstrom",
66
+ "value": 0.3
67
+ }
68
+ },
69
+ {
70
+ "degree": 10,
71
+ "name": "p-norm",
72
+ "value": 0.71
73
+ },
74
+ {
75
+ "element": "Si",
76
+ "name": "elemental_ratio",
77
+ "value": 0.71
78
+ },
79
+ {
80
+ "name": "inchi",
81
+ "value": ""
82
+ },
83
+ {
84
+ "name": "inchi_key",
85
+ "value": ""
86
+ }
87
+ ],
88
+ "exabyteId": "RKiswuxHKkF3uvLyA",
89
+ "formula": "Si",
90
+ "hash": "4ac3fa057e3530628eb1295c77110eaa",
91
+ "isDefault": false,
92
+ "isNonPeriodic": false,
93
+ "lattice": {
94
+ "name": "lattice",
95
+ "a": 5.14,
96
+ "alpha": 90,
97
+ "b": 5.14,
98
+ "beta": 90,
99
+ "c": 5.14,
100
+ "gamma": 90,
101
+ "type": "CUB",
102
+ "units": {
103
+ "angle": "degree",
104
+ "length": "angstrom"
105
+ },
106
+ "vectors": {
107
+ "a": [
108
+ 5,
109
+ 0.000121312,
110
+ 0.000131415
111
+ ],
112
+ "alat": 1,
113
+ "b": [
114
+ 0.000121312,
115
+ 5,
116
+ 0.000121314
117
+ ],
118
+ "c": [
119
+ 0.000121313,
120
+ 0.000121312,
121
+ 5
122
+ ],
123
+ "units": "angstrom"
124
+ }
125
+ },
126
+ "name": "Silicon FCC",
127
+ "owner": {
128
+ "_id": "HtxACY2wX4b2hS8Rv",
129
+ "cls": "Account",
130
+ "slug": "exabyte"
131
+ },
132
+ "scaledHash": "5bd4eb168e3530628eb1295d88221cbb",
133
+ "schemaVersion": "0.2.0",
134
+ "slug": "silicon-fcc",
135
+ "unitCellFormula": "Si2",
136
+ "updatedAt": "2016-04-04T17:58:42.867Z"
137
+ }
138
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$id": "apse/materials/builders/slab/pymatgen/parameters",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "title": "Pymatgen Slab Generator Parameters Schema",
5
+ "description": "Parameters for the Pymatgen slab generator. https://github.com/materialsproject/pymatgen/blob/585bb673c4aa222669c4b0d72ffeec3dbf092630/pymatgen/core/surface.py#L1187",
6
+ "type": "object",
7
+ "properties": {
8
+ "min_vacuum_size": {
9
+ "description": "Minimum size of the vacuum in layers or angstroms",
10
+ "type": [
11
+ "integer",
12
+ "number"
13
+ ],
14
+ "minimum": 0,
15
+ "default": 1
16
+ },
17
+ "in_unit_planes": {
18
+ "description": "Whether to cleave in unit planes",
19
+ "type": "boolean",
20
+ "default": true
21
+ },
22
+ "reorient_lattice": {
23
+ "description": "Whether to reorient the lattice",
24
+ "type": "boolean",
25
+ "default": true
26
+ },
27
+ "symmetrize": {
28
+ "description": "Whether to symmetrize the slab",
29
+ "type": "boolean",
30
+ "default": true
31
+ }
32
+ }
33
+ }
@@ -5,8 +5,126 @@
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "symbol": {
8
- "description": "Element symbol.",
9
- "type": "string"
8
+ "enum": [
9
+ "H",
10
+ "He",
11
+ "Li",
12
+ "Be",
13
+ "B",
14
+ "C",
15
+ "N",
16
+ "O",
17
+ "F",
18
+ "Ne",
19
+ "Na",
20
+ "Mg",
21
+ "Al",
22
+ "Si",
23
+ "P",
24
+ "S",
25
+ "Cl",
26
+ "Ar",
27
+ "K",
28
+ "Ca",
29
+ "Sc",
30
+ "Ti",
31
+ "V",
32
+ "Cr",
33
+ "Mn",
34
+ "Fe",
35
+ "Co",
36
+ "Ni",
37
+ "Cu",
38
+ "Zn",
39
+ "Ga",
40
+ "Ge",
41
+ "As",
42
+ "Se",
43
+ "Br",
44
+ "Kr",
45
+ "Rb",
46
+ "Sr",
47
+ "Y",
48
+ "Zr",
49
+ "Nb",
50
+ "Mo",
51
+ "Tc",
52
+ "Ru",
53
+ "Rh",
54
+ "Pd",
55
+ "Ag",
56
+ "Cd",
57
+ "In",
58
+ "Sn",
59
+ "Sb",
60
+ "Te",
61
+ "I",
62
+ "Xe",
63
+ "Cs",
64
+ "Ba",
65
+ "La",
66
+ "Ce",
67
+ "Pr",
68
+ "Nd",
69
+ "Pm",
70
+ "Sm",
71
+ "Eu",
72
+ "Gd",
73
+ "Tb",
74
+ "Dy",
75
+ "Ho",
76
+ "Er",
77
+ "Tm",
78
+ "Yb",
79
+ "Lu",
80
+ "Hf",
81
+ "Ta",
82
+ "W",
83
+ "Re",
84
+ "Os",
85
+ "Ir",
86
+ "Pt",
87
+ "Au",
88
+ "Hg",
89
+ "Tl",
90
+ "Pb",
91
+ "Bi",
92
+ "Po",
93
+ "At",
94
+ "Rn",
95
+ "Fr",
96
+ "Ra",
97
+ "Ac",
98
+ "Th",
99
+ "Pa",
100
+ "U",
101
+ "Np",
102
+ "Pu",
103
+ "Am",
104
+ "Cm",
105
+ "Bk",
106
+ "Cf",
107
+ "Es",
108
+ "Fm",
109
+ "Md",
110
+ "No",
111
+ "Lr",
112
+ "Rf",
113
+ "Db",
114
+ "Sg",
115
+ "Bh",
116
+ "Hs",
117
+ "Mt",
118
+ "Ds",
119
+ "Rg",
120
+ "Cn",
121
+ "Nh",
122
+ "Fl",
123
+ "Mc",
124
+ "Lv",
125
+ "Ts",
126
+ "Og"
127
+ ]
10
128
  },
11
129
  "properties": {
12
130
  "type": "array",