@mat3ra/wode 2025.11.13-0 → 2025.11.26-0

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 (43) hide show
  1. package/dist/js/context/providers/BoundaryConditionsFormDataProvider.js +26 -28
  2. package/dist/js/context/providers/CollinearMagnetizationContextProvider.js +25 -42
  3. package/dist/js/context/providers/HubbardContextProviderLegacy.js +14 -27
  4. package/dist/js/context/providers/HubbardJContextProvider.js +28 -35
  5. package/dist/js/context/providers/HubbardUContextProvider.js +23 -30
  6. package/dist/js/context/providers/HubbardVContextProvider.js +39 -51
  7. package/dist/js/context/providers/IonDynamicsContextProvider.js +27 -31
  8. package/dist/js/context/providers/MLSettingsContextProvider.js +16 -17
  9. package/dist/js/context/providers/MLTrainTestSplitContextProvider.js +13 -14
  10. package/dist/js/context/providers/NEBFormDataProvider.js +18 -14
  11. package/dist/js/context/providers/NonCollinearMagnetizationContextProvider.js +59 -125
  12. package/dist/js/context/providers/PlanewaveCutoffsContextProvider.js +18 -18
  13. package/dist/js/context/providers/PointsGridFormDataProvider.js +23 -32
  14. package/dist/js/context/providers/PointsPathFormDataProvider.js +17 -25
  15. package/dist/js/context/providers/by_application/ExecutableContextProvider.js +2 -3
  16. package/dist/js/index.js +113 -0
  17. package/dist/js/subworkflows/create.js +2 -2
  18. package/dist/js/units/builders/ExecutionUnitConfigBuilder.js +3 -4
  19. package/dist/js/units/execution.js +7 -8
  20. package/dist/js/workflows/index.js +6 -0
  21. package/dist/js/workflows/workflow.js +1 -1
  22. package/package.json +6 -7
  23. package/src/js/context/providers/BoundaryConditionsFormDataProvider.js +19 -27
  24. package/src/js/context/providers/CollinearMagnetizationContextProvider.js +29 -41
  25. package/src/js/context/providers/HubbardContextProviderLegacy.js +19 -27
  26. package/src/js/context/providers/HubbardJContextProvider.js +27 -35
  27. package/src/js/context/providers/HubbardUContextProvider.js +24 -29
  28. package/src/js/context/providers/HubbardVContextProvider.js +39 -54
  29. package/src/js/context/providers/IonDynamicsContextProvider.js +17 -29
  30. package/src/js/context/providers/MLSettingsContextProvider.js +14 -17
  31. package/src/js/context/providers/MLTrainTestSplitContextProvider.js +13 -15
  32. package/src/js/context/providers/NEBFormDataProvider.js +14 -13
  33. package/src/js/context/providers/NonCollinearMagnetizationContextProvider.js +38 -128
  34. package/src/js/context/providers/PlanewaveCutoffsContextProvider.js +15 -18
  35. package/src/js/context/providers/PointsGridFormDataProvider.js +23 -37
  36. package/src/js/context/providers/PointsPathFormDataProvider.js +19 -21
  37. package/src/js/context/providers/by_application/ExecutableContextProvider.js +1 -1
  38. package/src/js/index.js +42 -2
  39. package/src/js/subworkflows/create.js +1 -1
  40. package/src/js/units/builders/ExecutionUnitConfigBuilder.js +1 -1
  41. package/src/js/units/execution.js +1 -2
  42. package/src/js/workflows/index.js +1 -1
  43. package/src/js/workflows/workflow.js +1 -1
@@ -4,12 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.MLTrainTestSplitContextProvider = void 0;
7
- var _ContextProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/ContextProvider"));
7
+ var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  var _ApplicationContextMixin = require("../mixins/ApplicationContextMixin");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- class MLTrainTestSplitContextProvider extends _ContextProvider.default {
11
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
14
+ class MLTrainTestSplitContextProvider extends _ade.ContextProvider {
11
15
  constructor(config) {
12
16
  super(config);
17
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/ml-train-test-split-context-provider");
13
18
  this.initApplicationContextMixin();
14
19
  }
15
20
 
@@ -27,22 +32,16 @@ class MLTrainTestSplitContextProvider extends _ContextProvider.default {
27
32
  fraction_held_as_test_set: 0.2
28
33
  };
29
34
  }
30
- get jsonSchema() {
35
+ get jsonSchemaPatchConfig() {
31
36
  return {
32
- $schema: "http://json-schema.org/draft-07/schema#",
33
- title: " ",
34
- description: "Fraction held as the test set. For example, a value of 0.2 corresponds to an 80/20 train/test split.",
35
- type: "object",
36
- properties: {
37
- fraction_held_as_test_set: {
38
- type: "number",
39
- default: this.defaultData.fraction_held_as_test_set,
40
- minimum: 0,
41
- maximum: 1
42
- }
37
+ fraction_held_as_test_set: {
38
+ default: this.defaultData.fraction_held_as_test_set
43
39
  }
44
40
  };
45
41
  }
42
+ get jsonSchema() {
43
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
44
+ }
46
45
  }
47
46
  exports.MLTrainTestSplitContextProvider = MLTrainTestSplitContextProvider;
48
47
  (0, _ApplicationContextMixin.applicationContextMixin)(MLTrainTestSplitContextProvider.prototype);
@@ -4,15 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.NEBFormDataProvider = void 0;
7
- var _JSONSchemaFormDataProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/JSONSchemaFormDataProvider"));
7
+ var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- class NEBFormDataProvider extends _JSONSchemaFormDataProvider.default {
10
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
12
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ class NEBFormDataProvider extends _ade.JSONSchemaFormDataProvider {
14
+ constructor(...args) {
15
+ super(...args);
16
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/neb-data-provider");
17
+ }
10
18
  // eslint-disable-next-line class-methods-use-this
11
19
  get defaultData() {
12
20
  return {
13
21
  nImages: 1
14
22
  };
15
23
  }
24
+ get jsonSchemaPatchConfig() {
25
+ return {
26
+ nImages: {
27
+ default: this.defaultData.nImages
28
+ }
29
+ };
30
+ }
16
31
 
17
32
  // eslint-disable-next-line class-methods-use-this
18
33
  get uiSchema() {
@@ -21,18 +36,7 @@ class NEBFormDataProvider extends _JSONSchemaFormDataProvider.default {
21
36
  };
22
37
  }
23
38
  get jsonSchema() {
24
- return {
25
- $schema: "http://json-schema.org/draft-07/schema#",
26
- title: " ",
27
- description: "Number of intermediate NEB images.",
28
- type: "object",
29
- properties: {
30
- nImages: {
31
- type: "number",
32
- default: this.defaultData.nImages
33
- }
34
- }
35
- };
39
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
36
40
  }
37
41
  }
38
42
  exports.NEBFormDataProvider = NEBFormDataProvider;
@@ -4,13 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.NonCollinearMagnetizationContextProvider = void 0;
7
- var _JSONSchemaFormDataProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/JSONSchemaFormDataProvider"));
7
+ var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  var _lodash = _interopRequireDefault(require("lodash"));
9
10
  var _MaterialContextMixin = require("../mixins/MaterialContextMixin");
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- class NonCollinearMagnetizationContextProvider extends _JSONSchemaFormDataProvider.default {
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
+ class NonCollinearMagnetizationContextProvider extends _ade.JSONSchemaFormDataProvider {
12
16
  constructor(config) {
13
17
  super(config);
18
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/non-collinear-magnetization-context-provider");
14
19
  this.initMaterialContextMixin();
15
20
  this.isStartingMagnetization = _lodash.default.get(this.data, "isStartingMagnetization", true);
16
21
  this.isConstrainedMagnetization = _lodash.default.get(this.data, "isConstrainedMagnetization", false);
@@ -121,133 +126,62 @@ class NonCollinearMagnetizationContextProvider extends _JSONSchemaFormDataProvid
121
126
  }
122
127
  };
123
128
  }
124
- get jsonSchema() {
129
+ get jsonSchemaPatchConfig() {
125
130
  return {
126
- $schema: "http://json-schema.org/draft-07/schema#",
127
- title: "",
128
- description: "Set initial parameters for non-collinear spin magnetic (SOC) calculation.",
129
- type: "object",
130
- properties: {
131
- isStartingMagnetization: {
132
- type: "boolean",
133
- title: "Set starting magnetization",
134
- default: true
135
- },
136
- startingMagnetization: {
137
- type: "array",
138
- minItems: this.uniqueElementsWithLabels.length,
139
- maxItems: this.uniqueElementsWithLabels.length,
140
- items: {
141
- type: "object",
142
- properties: {
143
- atomicSpecies: {
144
- type: "string",
145
- title: "Atomic species"
146
- },
147
- value: {
148
- type: "number",
149
- title: "Starting magnetization",
150
- default: 0.0,
151
- minimum: -1.0,
152
- maximum: 1.0
153
- }
154
- }
155
- }
156
- },
157
- isExistingChargeDensity: {
158
- type: "boolean",
159
- title: "Start calculation from existing charge density",
160
- default: false
161
- },
162
- lforcet: {
163
- title: "Set lforcet to",
164
- type: "boolean",
165
- oneOf: [{
166
- const: true,
167
- title: "True"
168
- }, {
169
- const: false,
170
- title: "False"
171
- }]
172
- },
173
- isArbitrarySpinDirection: {
174
- type: "boolean",
175
- title: "Set spin directions",
176
- default: false
177
- },
178
- spinAngles: {
179
- type: "array",
180
- minItems: this.uniqueElementsWithLabels.length,
181
- maxItems: this.uniqueElementsWithLabels.length,
182
- items: {
183
- type: "object",
184
- properties: {
185
- atomicSpecies: {
186
- type: "string",
187
- title: "Atomic species"
188
- },
189
- angle1: {
190
- type: "number",
191
- title: "Angle1 (deg)",
192
- default: 0.0
193
- },
194
- angle2: {
195
- type: "number",
196
- title: "Angle2 (deg)",
197
- default: 0.0
198
- }
199
- }
200
- }
201
- },
202
- isConstrainedMagnetization: {
203
- type: "boolean",
204
- title: "Set constrained magnetization",
205
- default: false
206
- },
207
- constrainedMagnetization: {
208
- type: "object",
209
- properties: {
210
- constrainType: {
211
- type: "string",
212
- title: "Constrain type",
213
- enum: ["none", "total", "atomic", "total direction", "atomic direction"],
214
- default: "atomic direction"
215
- },
216
- lambda: {
217
- type: "number",
218
- title: "lambda",
219
- default: 0.0
220
- }
221
- }
222
- },
223
- isFixedMagnetization: {
224
- type: "boolean",
225
- title: "Set Fixed magnetization (only applicable to constrained magnetization of 'total' type)",
226
- default: true
227
- },
228
- fixedMagnetization: {
229
- type: "object",
230
- properties: {
231
- x: {
232
- type: "number",
233
- title: "X-component",
234
- default: 0.0
235
- },
236
- y: {
237
- type: "number",
238
- title: "Y-component",
239
- default: 0.0
240
- },
241
- z: {
242
- type: "number",
243
- title: "Z-component",
244
- default: 0.0
245
- }
246
- }
247
- }
131
+ isExistingChargeDensity: {
132
+ default: false
133
+ },
134
+ isStartingMagnetization: {
135
+ default: true
136
+ },
137
+ isArbitrarySpinAngle: {
138
+ default: false
139
+ },
140
+ isConstrainedMagnetization: {
141
+ default: false
142
+ },
143
+ isFixedMagnetization: {
144
+ default: true
145
+ },
146
+ startingMagnetization: {
147
+ minItems: this.uniqueElementsWithLabels.length,
148
+ maxItems: this.uniqueElementsWithLabels.length
149
+ },
150
+ "startingMagnetization.items.properties.value": {
151
+ default: 0.0,
152
+ minimum: -1.0,
153
+ maximum: 1.0
154
+ },
155
+ spinAngles: {
156
+ minItems: this.uniqueElementsWithLabels.length,
157
+ maxItems: this.uniqueElementsWithLabels.length
158
+ },
159
+ "spinAngles.items.properties.angle1": {
160
+ default: 0.0
161
+ },
162
+ "spinAngles.items.properties.angle2": {
163
+ default: 0.0
164
+ },
165
+ "constrainedMagnetization.properties.constrainType": {
166
+ default: "atomic direction"
167
+ },
168
+ "constrainedMagnetization.properties.lambda": {
169
+ default: 0.0
170
+ },
171
+ "fixedMagnetization.properties.x": {
172
+ default: 0.0
173
+ },
174
+ "fixedMagnetization.properties.y": {
175
+ default: 0.0
176
+ },
177
+ "fixedMagnetization.properties.z": {
178
+ default: 0.0
248
179
  }
249
180
  };
250
181
  }
182
+ get jsonSchema() {
183
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
184
+ }
251
185
  }
252
186
  exports.NonCollinearMagnetizationContextProvider = NonCollinearMagnetizationContextProvider;
253
187
  (0, _MaterialContextMixin.materialContextMixin)(NonCollinearMagnetizationContextProvider.prototype);
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PlanewaveCutoffsContextProvider = void 0;
7
- var _ContextProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/ContextProvider"));
7
+ var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  var _ApplicationContextMixin = require("../mixins/ApplicationContextMixin");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
13
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
14
  const cutoffConfig = {
11
15
  vasp: {},
12
16
  // assuming default cutoffs for VASP
@@ -16,9 +20,10 @@ const cutoffConfig = {
16
20
  density: 200
17
21
  }
18
22
  };
19
- class PlanewaveCutoffsContextProvider extends _ContextProvider.default {
23
+ class PlanewaveCutoffsContextProvider extends _ade.ContextProvider {
20
24
  constructor(config) {
21
25
  super(config);
26
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/planewave-cutoffs-context-provider");
22
27
  this.initApplicationContextMixin();
23
28
  }
24
29
 
@@ -35,6 +40,16 @@ class PlanewaveCutoffsContextProvider extends _ContextProvider.default {
35
40
  density: this.defaultECUTRHO
36
41
  };
37
42
  }
43
+ get jsonSchemaPatchConfig() {
44
+ return {
45
+ wavefunction: {
46
+ default: this.defaultData.wavefunction
47
+ },
48
+ density: {
49
+ default: this.defaultData.density
50
+ }
51
+ };
52
+ }
38
53
  get _cutoffConfigPerApplication() {
39
54
  return cutoffConfig[this.application.name];
40
55
  }
@@ -45,22 +60,7 @@ class PlanewaveCutoffsContextProvider extends _ContextProvider.default {
45
60
  return this._cutoffConfigPerApplication.density || null;
46
61
  }
47
62
  get jsonSchema() {
48
- return {
49
- $schema: "http://json-schema.org/draft-07/schema#",
50
- title: " ",
51
- description: "Planewave cutoff parameters for electronic wavefunctions and density. Units are specific to simulation engine.",
52
- type: "object",
53
- properties: {
54
- wavefunction: {
55
- type: "number",
56
- default: this.defaultECUTWFC
57
- },
58
- density: {
59
- type: "number",
60
- default: this.defaultECUTRHO
61
- }
62
- }
63
- };
63
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
64
64
  }
65
65
  }
66
66
  exports.PlanewaveCutoffsContextProvider = PlanewaveCutoffsContextProvider;
@@ -4,17 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PointsGridFormDataProvider = void 0;
7
- var _JSONSchemaFormDataProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/JSONSchemaFormDataProvider"));
7
+ var _ade = require("@mat3ra/ade");
8
8
  var _constants = require("@mat3ra/code/dist/js/constants");
9
9
  var _math = require("@mat3ra/code/dist/js/math");
10
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
10
11
  var _made = require("@mat3ra/made");
11
12
  var _lodash = _interopRequireDefault(require("lodash"));
12
13
  var _MaterialContextMixin = require("../mixins/MaterialContextMixin");
13
14
  var _settings = require("./settings");
14
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- class PointsGridFormDataProvider extends _JSONSchemaFormDataProvider.default {
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
+ class PointsGridFormDataProvider extends _ade.JSONSchemaFormDataProvider {
16
20
  constructor(config) {
17
21
  super(config);
22
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/points-grid-data-provider");
18
23
  this.initMaterialContextMixin();
19
24
  this._divisor = config.divisor || 1; // KPPRA will be divided by this number
20
25
  this.reciprocalLattice = new _made.Made.ReciprocalLattice(this.material.lattice);
@@ -87,50 +92,34 @@ class PointsGridFormDataProvider extends _JSONSchemaFormDataProvider.default {
87
92
  get reciprocalVectorRatios() {
88
93
  return this.reciprocalLattice.reciprocalVectorRatios.map(r => Number(_math.math.numberToPrecision(r, 3)));
89
94
  }
90
- get jsonSchema() {
91
- const vector = {
92
- type: "array",
93
- items: {
94
- type: "number"
95
- },
96
- minItems: 3,
97
- maxItems: 3
98
- };
95
+ get jsonSchemaPatchConfig() {
96
+ // Helper function to create vector schema with defaults
99
97
  const vector_ = (defaultValue, isStringType = false) => {
100
98
  const isArray = Array.isArray(defaultValue);
101
99
  return {
102
- ...vector,
100
+ type: "array",
103
101
  items: {
104
102
  type: isStringType ? "string" : "number",
105
103
  ...(isArray ? {} : {
106
104
  default: defaultValue
107
105
  })
108
106
  },
107
+ minItems: 3,
108
+ maxItems: 3,
109
109
  ...(isArray ? {
110
110
  default: defaultValue
111
111
  } : {})
112
112
  };
113
113
  };
114
114
  return {
115
- $schema: "http://json-schema.org/draft-07/schema#",
116
- description: `3D grid with shifts. Default min value for ${this._metricDescription[this.gridMetricType]} is ${this._getDefaultGridMetricValue(this.gridMetricType)}.`,
117
- type: "object",
118
- properties: {
119
- dimensions: vector_(this._defaultDimensions, this.isUsingJinjaVariables),
120
- shifts: vector_(this.getDefaultShift()),
121
- reciprocalVectorRatios: vector_(this.reciprocalVectorRatios),
122
- gridMetricType: {
123
- type: "string",
124
- enum: ["KPPRA", "spacing"],
125
- default: "KPPRA"
126
- },
127
- gridMetricValue: {
128
- type: "number"
129
- },
130
- preferGridMetric: {
131
- type: "boolean"
132
- }
115
+ dimensions: vector_(this._defaultDimensions, this.isUsingJinjaVariables),
116
+ shifts: vector_(this.getDefaultShift()),
117
+ reciprocalVectorRatios: vector_(this.reciprocalVectorRatios),
118
+ gridMetricType: {
119
+ default: "KPPRA"
133
120
  },
121
+ description: `3D grid with shifts. Default min value for ${this._metricDescription[this.gridMetricType]} is ${this._getDefaultGridMetricValue(this.gridMetricType)}.`,
122
+ required: ["dimensions", "shifts"],
134
123
  dependencies: {
135
124
  gridMetricType: {
136
125
  oneOf: [{
@@ -169,10 +158,12 @@ class PointsGridFormDataProvider extends _JSONSchemaFormDataProvider.default {
169
158
  }
170
159
  }]
171
160
  }
172
- },
173
- required: ["dimensions", "shifts"]
161
+ }
174
162
  };
175
163
  }
164
+ get jsonSchema() {
165
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
166
+ }
176
167
  get uiSchema() {
177
168
  const _arraySubStyle = (emptyValue = 0) => {
178
169
  return {
@@ -4,21 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PointsPathFormDataProvider = exports.ExplicitPointsPathFormDataProvider = exports.ExplicitPointsPath2PIBAFormDataProvider = void 0;
7
- var _JSONSchemaFormDataProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/JSONSchemaFormDataProvider"));
7
+ var _ade = require("@mat3ra/ade");
8
8
  var _math = require("@mat3ra/code/dist/js/math");
9
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
9
10
  var _made = require("@mat3ra/made");
10
11
  var _underscore = _interopRequireDefault(require("underscore.string"));
11
12
  var _ApplicationContextMixin = require("../mixins/ApplicationContextMixin");
12
13
  var _MaterialContextMixin = require("../mixins/MaterialContextMixin");
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- /* eslint-disable max-classes-per-file */
15
- /* eslint react/prop-types: 0 */
16
-
15
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable max-classes-per-file */ /* eslint react/prop-types: 0 */
17
18
  const defaultPoint = "Г";
18
19
  const defaultSteps = 10;
19
- class PointsPathFormDataProvider extends _JSONSchemaFormDataProvider.default {
20
+ class PointsPathFormDataProvider extends _ade.JSONSchemaFormDataProvider {
20
21
  constructor(config) {
21
22
  super(config);
23
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/points-path-data-provider");
22
24
  this.initMaterialContextMixin();
23
25
  this.initApplicationContextMixin();
24
26
  this.reciprocalLattice = new _made.Made.ReciprocalLattice(this.material.lattice);
@@ -33,31 +35,21 @@ class PointsPathFormDataProvider extends _JSONSchemaFormDataProvider.default {
33
35
  get symmetryPointsFromMaterial() {
34
36
  return this.reciprocalLattice.symmetryPoints;
35
37
  }
36
- get jsonSchema() {
37
- // no need to pass context to get symmetry points on client
38
+ get jsonSchemaPatchConfig() {
38
39
  const points = [].concat(this.symmetryPoints).map(x => x.point);
39
40
  return {
40
- $schema: "http://json-schema.org/draft-07/schema#",
41
- title: " ",
42
- description: "path in reciprocal space",
43
- type: "array",
44
- items: {
45
- type: "object",
46
- properties: {
47
- point: {
48
- type: "string",
49
- default: defaultPoint,
50
- enum: points
51
- },
52
- steps: {
53
- type: "integer",
54
- default: defaultSteps
55
- }
56
- }
41
+ "items.properties.point": {
42
+ default: defaultPoint,
43
+ enum: points
57
44
  },
58
- minItems: 1
45
+ "items.properties.steps": {
46
+ default: defaultSteps
47
+ }
59
48
  };
60
49
  }
50
+ get jsonSchema() {
51
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
52
+ }
61
53
 
62
54
  // eslint-disable-next-line class-methods-use-this
63
55
  get uiSchema() {
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _ContextProvider = _interopRequireDefault(require("@mat3ra/ade/dist/js/context/ContextProvider"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- class ExecutableContextProvider extends _ContextProvider.default {
7
+ var _ade = require("@mat3ra/ade");
8
+ class ExecutableContextProvider extends _ade.ContextProvider {
10
9
  constructor(config) {
11
10
  super({
12
11
  ...config,