@mat3ra/wode 2025.11.19-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 (29) hide show
  1. package/dist/js/context/providers/BoundaryConditionsFormDataProvider.js +25 -26
  2. package/dist/js/context/providers/CollinearMagnetizationContextProvider.js +23 -40
  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 +22 -28
  6. package/dist/js/context/providers/HubbardVContextProvider.js +39 -51
  7. package/dist/js/context/providers/IonDynamicsContextProvider.js +26 -29
  8. package/dist/js/context/providers/MLSettingsContextProvider.js +15 -15
  9. package/dist/js/context/providers/MLTrainTestSplitContextProvider.js +12 -12
  10. package/dist/js/context/providers/NEBFormDataProvider.js +17 -12
  11. package/dist/js/context/providers/NonCollinearMagnetizationContextProvider.js +57 -123
  12. package/dist/js/context/providers/PlanewaveCutoffsContextProvider.js +17 -16
  13. package/dist/js/context/providers/PointsGridFormDataProvider.js +21 -30
  14. package/dist/js/context/providers/PointsPathFormDataProvider.js +15 -23
  15. package/package.json +2 -2
  16. package/src/js/context/providers/BoundaryConditionsFormDataProvider.js +18 -26
  17. package/src/js/context/providers/CollinearMagnetizationContextProvider.js +28 -40
  18. package/src/js/context/providers/HubbardContextProviderLegacy.js +19 -27
  19. package/src/js/context/providers/HubbardJContextProvider.js +27 -35
  20. package/src/js/context/providers/HubbardUContextProvider.js +23 -28
  21. package/src/js/context/providers/HubbardVContextProvider.js +39 -54
  22. package/src/js/context/providers/IonDynamicsContextProvider.js +16 -28
  23. package/src/js/context/providers/MLSettingsContextProvider.js +13 -16
  24. package/src/js/context/providers/MLTrainTestSplitContextProvider.js +12 -14
  25. package/src/js/context/providers/NEBFormDataProvider.js +13 -12
  26. package/src/js/context/providers/NonCollinearMagnetizationContextProvider.js +37 -127
  27. package/src/js/context/providers/PlanewaveCutoffsContextProvider.js +14 -17
  28. package/src/js/context/providers/PointsGridFormDataProvider.js +22 -36
  29. package/src/js/context/providers/PointsPathFormDataProvider.js +18 -20
@@ -5,12 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.BoundaryConditionsFormDataProvider = void 0;
7
7
  var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  var _made = require("@mat3ra/made");
9
10
  var _utils = require("@mat3ra/utils");
10
11
  var _MaterialContextMixin = require("../mixins/MaterialContextMixin");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ 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; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
+ 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); }
11
16
  class BoundaryConditionsFormDataProvider extends _ade.JSONSchemaFormDataProvider {
12
17
  constructor(config) {
13
18
  super(config);
19
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/boundary-conditions-data-provider");
14
20
  this.initMaterialContextMixin();
15
21
  }
16
22
  get boundaryConditions() {
@@ -26,7 +32,25 @@ class BoundaryConditionsFormDataProvider extends _ade.JSONSchemaFormDataProvider
26
32
  targetFermiEnergy: 0
27
33
  };
28
34
  }
35
+ get jsonSchemaPatchConfig() {
36
+ const defaults = this.defaultData;
37
+ return {
38
+ type: {
39
+ default: defaults.type
40
+ },
41
+ offset: {
42
+ default: defaults.offset
43
+ },
44
+ electricField: {
45
+ default: defaults.electricField
46
+ },
47
+ targetFermiEnergy: {
48
+ default: defaults.targetFermiEnergy
49
+ }
50
+ };
51
+ }
29
52
 
53
+ // TODO: MOVE to WA/wove instantiation
30
54
  // eslint-disable-next-line class-methods-use-this
31
55
  get uiSchema() {
32
56
  return {
@@ -53,32 +77,7 @@ class BoundaryConditionsFormDataProvider extends _ade.JSONSchemaFormDataProvider
53
77
  return data;
54
78
  }
55
79
  get jsonSchema() {
56
- return {
57
- $schema: "http://json-schema.org/draft-07/schema#",
58
- type: "object",
59
- properties: {
60
- type: {
61
- type: "string",
62
- title: "Type",
63
- default: this.defaultData.type
64
- },
65
- offset: {
66
- type: "number",
67
- title: "Offset (A)",
68
- default: this.defaultData.offset
69
- },
70
- electricField: {
71
- type: "number",
72
- title: "Electric Field (eV/A)",
73
- default: this.defaultData.electricField
74
- },
75
- targetFermiEnergy: {
76
- type: "number",
77
- title: "Target Fermi Energy (eV)",
78
- default: this.defaultData.targetFermiEnergy
79
- }
80
- }
81
- };
80
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
82
81
  }
83
82
  }
84
83
  exports.BoundaryConditionsFormDataProvider = BoundaryConditionsFormDataProvider;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.CollinearMagnetizationContextProvider = void 0;
7
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 }; }
@@ -14,6 +15,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
14
15
  class CollinearMagnetizationContextProvider extends _ade.JSONSchemaFormDataProvider {
15
16
  constructor(config) {
16
17
  super(config);
18
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/collinear-magnetization-context-provider");
17
19
  _defineProperty(this, "indexOfElement", element => {
18
20
  return this.uniqueElementsWithLabels.indexOf(element) + 1;
19
21
  });
@@ -46,6 +48,26 @@ class CollinearMagnetizationContextProvider extends _ade.JSONSchemaFormDataProvi
46
48
  totalMagnetization: 0.0
47
49
  };
48
50
  }
51
+ get jsonSchemaPatchConfig() {
52
+ return {
53
+ "properties.startingMagnetization": {
54
+ maxItems: this.uniqueElementsWithLabels.length
55
+ },
56
+ "properties.startingMagnetization.items.properties.atomicSpecies": {
57
+ enum: this.uniqueElementsWithLabels,
58
+ default: this.firstElement
59
+ },
60
+ "properties.startingMagnetization.items.properties.value": {
61
+ default: 0.0
62
+ },
63
+ "properties.isTotalMagnetization": {
64
+ default: false
65
+ },
66
+ "properties.totalMagnetization": {
67
+ default: 0.0
68
+ }
69
+ };
70
+ }
49
71
  get uiSchemaStyled() {
50
72
  return {
51
73
  startingMagnetization: {
@@ -67,46 +89,7 @@ class CollinearMagnetizationContextProvider extends _ade.JSONSchemaFormDataProvi
67
89
  };
68
90
  }
69
91
  get jsonSchema() {
70
- return {
71
- $schema: "http://json-schema.org/draft-07/schema#",
72
- title: "",
73
- description: "Set starting magnetization, can have values in the range [-1, +1].",
74
- type: "object",
75
- properties: {
76
- startingMagnetization: {
77
- type: "array",
78
- maxItems: this.uniqueElementsWithLabels.length,
79
- items: {
80
- type: "object",
81
- properties: {
82
- atomicSpecies: {
83
- type: "string",
84
- title: "Atomic species",
85
- enum: this.uniqueElementsWithLabels,
86
- default: this.firstElement
87
- },
88
- value: {
89
- type: "number",
90
- title: "Starting magnetization",
91
- default: 0.0,
92
- minimum: -1.0,
93
- maximum: 1.0
94
- }
95
- }
96
- }
97
- },
98
- isTotalMagnetization: {
99
- type: "boolean",
100
- title: "Set total magnetization instead",
101
- default: false
102
- },
103
- totalMagnetization: {
104
- type: "number",
105
- title: "Total magnetization",
106
- default: 0.0
107
- }
108
- }
109
- };
92
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
110
93
  }
111
94
  }
112
95
  exports.CollinearMagnetizationContextProvider = CollinearMagnetizationContextProvider;
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HubbardContextProviderLegacy = void 0;
7
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
7
8
  var _HubbardUContextProvider = require("./HubbardUContextProvider");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
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; }
9
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
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); }
@@ -14,6 +16,7 @@ const defaultHubbardConfig = {
14
16
  class HubbardContextProviderLegacy extends _HubbardUContextProvider.HubbardUContextProvider {
15
17
  constructor(...args) {
16
18
  super(...args);
19
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/hubbard-legacy-context-provider");
17
20
  _defineProperty(this, "speciesIndexFromSpecies", species => {
18
21
  return this.uniqueElementsWithLabels?.length > 0 ? this.uniqueElementsWithLabels.indexOf(species) + 1 : null;
19
22
  });
@@ -31,6 +34,16 @@ class HubbardContextProviderLegacy extends _HubbardUContextProvider.HubbardUCont
31
34
  atomicSpeciesIndex: this.uniqueElementsWithLabels?.length > 0 ? 1 : null
32
35
  }];
33
36
  }
37
+ get jsonSchemaPatchConfig() {
38
+ return {
39
+ "items.properties.atomicSpecies": {
40
+ enum: this.uniqueElementsWithLabels
41
+ },
42
+ "items.properties.hubbardUValue": {
43
+ default: defaultHubbardConfig.hubbardUValue
44
+ }
45
+ };
46
+ }
34
47
  get uiSchemaStyled() {
35
48
  return {
36
49
  "ui:options": {
@@ -49,33 +62,7 @@ class HubbardContextProviderLegacy extends _HubbardUContextProvider.HubbardUCont
49
62
  };
50
63
  }
51
64
  get jsonSchema() {
52
- return {
53
- $schema: "http://json-schema.org/draft-07/schema#",
54
- title: "",
55
- description: "Hubbard parameters for DFT+U calculation.",
56
- type: "array",
57
- uniqueItems: true,
58
- minItems: 1,
59
- items: {
60
- type: "object",
61
- properties: {
62
- atomicSpecies: {
63
- type: "string",
64
- title: "Atomic species",
65
- enum: this.uniqueElementsWithLabels
66
- },
67
- atomicSpeciesIndex: {
68
- type: "integer",
69
- title: "Species index"
70
- },
71
- hubbardUValue: {
72
- type: "number",
73
- title: "Hubbard U (eV)",
74
- default: defaultHubbardConfig.hubbardUValue
75
- }
76
- }
77
- }
78
- };
65
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
79
66
  }
80
67
  }
81
68
  exports.HubbardContextProviderLegacy = HubbardContextProviderLegacy;
@@ -4,7 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HubbardJContextProvider = void 0;
7
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
7
8
  var _HubbardUContextProvider = require("./HubbardUContextProvider");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
8
13
  const defaultHubbardConfig = {
9
14
  paramType: "U",
10
15
  atomicSpecies: "",
@@ -12,12 +17,34 @@ const defaultHubbardConfig = {
12
17
  value: 1.0
13
18
  };
14
19
  class HubbardJContextProvider extends _HubbardUContextProvider.HubbardUContextProvider {
20
+ constructor(...args) {
21
+ super(...args);
22
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/hubbard-j-context-provider");
23
+ }
15
24
  get defaultData() {
16
25
  return [{
17
26
  ...defaultHubbardConfig,
18
27
  atomicSpecies: this.firstElement
19
28
  }];
20
29
  }
30
+ get jsonSchemaPatchConfig() {
31
+ return {
32
+ "items.properties.paramType": {
33
+ default: defaultHubbardConfig.paramType
34
+ },
35
+ "items.properties.atomicSpecies": {
36
+ enum: this.uniqueElementsWithLabels,
37
+ default: this.firstElement
38
+ },
39
+ "items.properties.atomicOrbital": {
40
+ enum: this.orbitalList,
41
+ default: defaultHubbardConfig.atomicOrbital
42
+ },
43
+ "items.properties.value": {
44
+ default: defaultHubbardConfig.value
45
+ }
46
+ };
47
+ }
21
48
  get uiSchemaStyled() {
22
49
  return {
23
50
  "ui:options": {
@@ -34,41 +61,7 @@ class HubbardJContextProvider extends _HubbardUContextProvider.HubbardUContextPr
34
61
  };
35
62
  }
36
63
  get jsonSchema() {
37
- return {
38
- $schema: "http://json-schema.org/draft-07/schema#",
39
- title: "",
40
- description: "Hubbard parameters for DFT+U+J calculation.",
41
- type: "array",
42
- items: {
43
- type: "object",
44
- properties: {
45
- paramType: {
46
- type: "string",
47
- title: "Species",
48
- enum: ["U", "J", "B", "E2", "E3"],
49
- default: defaultHubbardConfig.paramType
50
- },
51
- atomicSpecies: {
52
- type: "string",
53
- title: "Species",
54
- enum: this.uniqueElementsWithLabels,
55
- default: this.firstElement
56
- },
57
- atomicOrbital: {
58
- type: "string",
59
- title: "Orbital",
60
- enum: this.orbitalList,
61
- default: defaultHubbardConfig.atomicOrbital
62
- },
63
- value: {
64
- type: "number",
65
- title: "Value (eV)",
66
- default: defaultHubbardConfig.value
67
- }
68
- }
69
- },
70
- minItems: 1
71
- };
64
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
72
65
  }
73
66
  }
74
67
  exports.HubbardJContextProvider = HubbardJContextProvider;
@@ -5,7 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.HubbardUContextProvider = void 0;
7
7
  var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  var _MaterialContextMixin = require("../mixins/MaterialContextMixin");
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); }
9
14
  const defaultHubbardConfig = {
10
15
  atomicSpecies: "",
11
16
  atomicOrbital: "2p",
@@ -14,6 +19,7 @@ const defaultHubbardConfig = {
14
19
  class HubbardUContextProvider extends _ade.JSONSchemaFormDataProvider {
15
20
  constructor(config) {
16
21
  super(config);
22
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/hubbard-u-context-provider");
17
23
  this.initMaterialContextMixin();
18
24
  this.uniqueElements = this.material?.Basis?.uniqueElements || [];
19
25
  this.orbitalList = ["2p", "3s", "3p", "3d", "4s", "4p", "4d", "4f", "5s", "5p", "5d", "5f", "6s", "6p", "6d", "7s", "7p", "7d"];
@@ -27,6 +33,21 @@ class HubbardUContextProvider extends _ade.JSONSchemaFormDataProvider {
27
33
  atomicSpecies: this.firstElement
28
34
  }];
29
35
  }
36
+ get jsonSchemaPatchConfig() {
37
+ return {
38
+ "items.properties.atomicSpecies": {
39
+ enum: this.uniqueElementsWithLabels,
40
+ default: this.firstElement
41
+ },
42
+ "items.properties.atomicOrbital": {
43
+ enum: this.orbitalList,
44
+ default: defaultHubbardConfig.atomicOrbital
45
+ },
46
+ "items.properties.hubbardUValue": {
47
+ default: defaultHubbardConfig.hubbardUValue
48
+ }
49
+ };
50
+ }
30
51
  get uiSchemaStyled() {
31
52
  return {
32
53
  "ui:options": {
@@ -42,34 +63,7 @@ class HubbardUContextProvider extends _ade.JSONSchemaFormDataProvider {
42
63
  };
43
64
  }
44
65
  get jsonSchema() {
45
- return {
46
- $schema: "http://json-schema.org/draft-07/schema#",
47
- title: "",
48
- description: "Hubbard U parameters for DFT+U or DFT+U+V calculation.",
49
- type: "array",
50
- items: {
51
- type: "object",
52
- properties: {
53
- atomicSpecies: {
54
- type: "string",
55
- title: "Atomic species",
56
- enum: this.uniqueElementsWithLabels,
57
- default: this.firstElement
58
- },
59
- atomicOrbital: {
60
- type: "string",
61
- title: "Atomic orbital",
62
- enum: this.orbitalList,
63
- default: defaultHubbardConfig.atomicOrbital
64
- },
65
- hubbardUValue: {
66
- type: "number",
67
- title: "Hubbard U (eV)",
68
- default: defaultHubbardConfig.hubbardUValue
69
- }
70
- }
71
- }
72
- };
66
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
73
67
  }
74
68
  }
75
69
  exports.HubbardUContextProvider = HubbardUContextProvider;
@@ -4,7 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.HubbardVContextProvider = void 0;
7
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
7
8
  var _HubbardUContextProvider = require("./HubbardUContextProvider");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
8
13
  const defaultHubbardConfig = {
9
14
  atomicSpecies: "",
10
15
  atomicOrbital: "2p",
@@ -15,6 +20,10 @@ const defaultHubbardConfig = {
15
20
  hubbardVValue: 1.0
16
21
  };
17
22
  class HubbardVContextProvider extends _HubbardUContextProvider.HubbardUContextProvider {
23
+ constructor(...args) {
24
+ super(...args);
25
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/hubbard-v-context-provider");
26
+ }
18
27
  get defaultData() {
19
28
  return [{
20
29
  ...defaultHubbardConfig,
@@ -29,6 +38,35 @@ class HubbardVContextProvider extends _HubbardUContextProvider.HubbardUContextPr
29
38
  get secondSpecies() {
30
39
  return this.uniqueElementsWithLabels?.length > 1 ? this.uniqueElementsWithLabels[1] : this.firstSpecies;
31
40
  }
41
+ get jsonSchemaPatchConfig() {
42
+ return {
43
+ "items.properties.atomicSpecies": {
44
+ enum: this.uniqueElementsWithLabels,
45
+ default: this.firstSpecies
46
+ },
47
+ "items.properties.siteIndex": {
48
+ default: defaultHubbardConfig.siteIndex
49
+ },
50
+ "items.properties.atomicOrbital": {
51
+ enum: this.orbitalList,
52
+ default: defaultHubbardConfig.atomicOrbital
53
+ },
54
+ "items.properties.atomicSpecies2": {
55
+ enum: this.uniqueElementsWithLabels,
56
+ default: this.secondSpecies
57
+ },
58
+ "items.properties.siteIndex2": {
59
+ default: this.uniqueElementsWithLabels?.length > 1 ? 2 : defaultHubbardConfig.siteIndex2
60
+ },
61
+ "items.properties.atomicOrbital2": {
62
+ enum: this.orbitalList,
63
+ default: defaultHubbardConfig.atomicOrbital
64
+ },
65
+ "items.properties.hubbardVValue": {
66
+ default: defaultHubbardConfig.hubbardVValue
67
+ }
68
+ };
69
+ }
32
70
  get uiSchemaStyled() {
33
71
  return {
34
72
  "ui:options": {
@@ -48,57 +86,7 @@ class HubbardVContextProvider extends _HubbardUContextProvider.HubbardUContextPr
48
86
  };
49
87
  }
50
88
  get jsonSchema() {
51
- return {
52
- $schema: "http://json-schema.org/draft-07/schema#",
53
- title: "",
54
- description: "Hubbard V parameters for DFT+U+V calculation.",
55
- type: "array",
56
- items: {
57
- type: "object",
58
- properties: {
59
- atomicSpecies: {
60
- type: "string",
61
- title: "Species 1",
62
- enum: this.uniqueElementsWithLabels,
63
- default: this.firstSpecies
64
- },
65
- siteIndex: {
66
- type: "integer",
67
- title: "Site no 1",
68
- default: defaultHubbardConfig.siteIndex
69
- },
70
- atomicOrbital: {
71
- type: "string",
72
- title: "Orbital 1",
73
- enum: this.orbitalList,
74
- default: defaultHubbardConfig.atomicOrbital
75
- },
76
- atomicSpecies2: {
77
- type: "string",
78
- title: "Species 2",
79
- enum: this.uniqueElementsWithLabels,
80
- default: this.secondSpecies
81
- },
82
- siteIndex2: {
83
- type: "integer",
84
- title: "Site no 2",
85
- default: this.uniqueElementsWithLabels?.length > 1 ? 2 : defaultHubbardConfig.siteIndex2
86
- },
87
- atomicOrbital2: {
88
- type: "string",
89
- title: "Orbital 2",
90
- enum: this.orbitalList,
91
- default: defaultHubbardConfig.atomicOrbital
92
- },
93
- hubbardVValue: {
94
- type: "number",
95
- title: "V (eV)",
96
- default: defaultHubbardConfig.hubbardVValue
97
- }
98
- }
99
- },
100
- minItems: 1
101
- };
89
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
102
90
  }
103
91
  }
104
92
  exports.HubbardVContextProvider = HubbardVContextProvider;
@@ -5,6 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.IonDynamicsContextProvider = void 0;
7
7
  var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
8
13
  const defaultMDConfig = {
9
14
  numberOfSteps: 100,
10
15
  timeStep: 5.0,
@@ -12,10 +17,30 @@ const defaultMDConfig = {
12
17
  temperature: 300.0
13
18
  };
14
19
  class IonDynamicsContextProvider extends _ade.JSONSchemaFormDataProvider {
20
+ constructor(...args) {
21
+ super(...args);
22
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/ion-dynamics-context-provider");
23
+ }
15
24
  // eslint-disable-next-line class-methods-use-this
16
25
  get defaultData() {
17
26
  return defaultMDConfig;
18
27
  }
28
+ get jsonSchemaPatchConfig() {
29
+ return {
30
+ numberOfSteps: {
31
+ default: this.defaultData.numberOfSteps
32
+ },
33
+ timeStep: {
34
+ default: this.defaultData.timeStep
35
+ },
36
+ electronMass: {
37
+ default: this.defaultData.electronMass
38
+ },
39
+ temperature: {
40
+ default: this.defaultData.temperature
41
+ }
42
+ };
43
+ }
19
44
 
20
45
  // eslint-disable-next-line class-methods-use-this
21
46
  get uiSchema() {
@@ -26,36 +51,8 @@ class IonDynamicsContextProvider extends _ade.JSONSchemaFormDataProvider {
26
51
  temperature: {}
27
52
  };
28
53
  }
29
-
30
- // eslint-disable-next-line class-methods-use-this
31
54
  get jsonSchema() {
32
- return {
33
- $schema: "http://json-schema.org/draft-07/schema#",
34
- type: "object",
35
- description: "Important parameters for molecular dynamics calculation",
36
- properties: {
37
- numberOfSteps: {
38
- type: "integer",
39
- title: "numberOfSteps",
40
- default: defaultMDConfig.numberOfSteps
41
- },
42
- timeStep: {
43
- type: "number",
44
- title: "timeStep (Hartree a.u.)",
45
- default: defaultMDConfig.timeStep
46
- },
47
- electronMass: {
48
- type: "number",
49
- title: "Effective electron mass",
50
- default: defaultMDConfig.electronMass
51
- },
52
- temperature: {
53
- type: "number",
54
- title: "Ionic temperature (K)",
55
- default: defaultMDConfig.temperature
56
- }
57
- }
58
- };
55
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
59
56
  }
60
57
  }
61
58
  exports.IonDynamicsContextProvider = IonDynamicsContextProvider;
@@ -5,10 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.MLSettingsContextProvider = void 0;
7
7
  var _ade = require("@mat3ra/ade");
8
+ var _JSONSchemasInterface = _interopRequireDefault(require("@mat3ra/esse/dist/js/esse/JSONSchemasInterface"));
8
9
  var _ApplicationContextMixin = require("../mixins/ApplicationContextMixin");
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); }
9
14
  class MLSettingsContextProvider extends _ade.ContextProvider {
10
15
  constructor(config) {
11
16
  super(config);
17
+ _defineProperty(this, "jsonSchemaId", "context-providers-directory/ml-settings-context-provider");
12
18
  this.initApplicationContextMixin();
13
19
  }
14
20
 
@@ -27,25 +33,19 @@ class MLSettingsContextProvider extends _ade.ContextProvider {
27
33
  problem_category: "regression"
28
34
  };
29
35
  }
30
- get jsonSchema() {
36
+ get jsonSchemaPatchConfig() {
31
37
  return {
32
- $schema: "http://json-schema.org/draft-07/schema#",
33
- title: " ",
34
- description: "Settings important to machine learning runs.",
35
- type: "object",
36
- properties: {
37
- target_column_name: {
38
- type: "string",
39
- default: this.defaultData.target_column_name
40
- },
41
- problem_category: {
42
- type: "string",
43
- default: this.defaultData.problem_category,
44
- enum: ["regression", "classification", "clustering"]
45
- }
38
+ target_column_name: {
39
+ default: this.defaultData.target_column_name
40
+ },
41
+ problem_category: {
42
+ default: this.defaultData.problem_category
46
43
  }
47
44
  };
48
45
  }
46
+ get jsonSchema() {
47
+ return _JSONSchemasInterface.default.getPatchedSchemaById(this.jsonSchemaId, this.jsonSchemaPatchConfig);
48
+ }
49
49
  }
50
50
  exports.MLSettingsContextProvider = MLSettingsContextProvider;
51
51
  (0, _ApplicationContextMixin.applicationContextMixin)(MLSettingsContextProvider.prototype);