@mat3ra/esse 2026.6.16-0 → 2026.7.13-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.
@@ -1,5 +1,5 @@
1
1
  repos:
2
- - repo: https://github.com/Exabyte-io/pre-commit-hooks
2
+ - repo: https://github.com/mat3ra/pre-commit-hooks
3
3
  rev: 2023.6.13
4
4
  hooks:
5
5
  - id: ruff
package/README.md CHANGED
@@ -69,7 +69,7 @@ validate_and_clean(data, schema)
69
69
  print(data) # {"a": "x", "b": 1}
70
70
 
71
71
  # alternative: schema-aware cleaning via generated pydantic models
72
- # also see how it is used in ade: https://github.com/Exabyte-io/ade/blob/main/src/py/mat3ra/ade/application.py
72
+ # also see how it is used in ade: https://github.com/mat3ra/ade/blob/main/src/py/mat3ra/ade/application.py
73
73
  from pydantic import ConfigDict
74
74
  from mat3ra.esse.models.software.application import ApplicationSchemaBase
75
75
 
@@ -66,5 +66,5 @@ class JSONSchemasInterface {
66
66
  return patchedSchema;
67
67
  }
68
68
  }
69
- exports.default = JSONSchemasInterface;
70
69
  JSONSchemasInterface.schemasCache = new Map();
70
+ exports.default = JSONSchemasInterface;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.readSchemaFolderSync = void 0;
6
+ exports.readSchemaFolderSync = readSchemaFolderSync;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const filesystem_1 = require("../utils/filesystem");
@@ -19,7 +19,6 @@ function readSchemaFolderSync(folderPath) {
19
19
  });
20
20
  return schemas;
21
21
  }
22
- exports.readSchemaFolderSync = readSchemaFolderSync;
23
22
  class JSONSchemasInterfaceServer extends JSONSchemasInterface_1.default {
24
23
  static setSchemaFolder(schemaFolder) {
25
24
  if (this.schemaFolder !== schemaFolder) {
@@ -42,5 +41,5 @@ class JSONSchemasInterfaceServer extends JSONSchemasInterface_1.default {
42
41
  return super.getSchemaById(schemaId);
43
42
  }
44
43
  }
45
- exports.default = JSONSchemasInterfaceServer;
46
44
  JSONSchemasInterfaceServer.schemaFolder = path_1.default.resolve(__dirname, "./../schema");
45
+ exports.default = JSONSchemasInterfaceServer;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapObjectDeep = void 0;
3
+ exports.mapObjectDeep = mapObjectDeep;
4
4
  function mapObjectDeep(object, mapValue) {
5
5
  if (typeof object !== "object" || object === null) {
6
6
  return object;
@@ -14,4 +14,3 @@ function mapObjectDeep(object, mapValue) {
14
14
  });
15
15
  return Object.fromEntries(entries);
16
16
  }
17
- exports.mapObjectDeep = mapObjectDeep;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parseIncludeReferenceStatementsByDir = exports.parseIncludeReferenceStatements = void 0;
6
+ exports.parseIncludeReferenceStatements = parseIncludeReferenceStatements;
7
+ exports.parseIncludeReferenceStatementsByDir = parseIncludeReferenceStatementsByDir;
7
8
  /**
8
9
  * Server-side schema parsing utilities.
9
10
  *
@@ -37,7 +38,6 @@ function parseIncludeReferenceStatements(filePath) {
37
38
  }
38
39
  return dereferenced;
39
40
  }
40
- exports.parseIncludeReferenceStatements = parseIncludeReferenceStatements;
41
41
  /**
42
42
  * Resolves `include` and `$ref` statements for all the JSON files inside a given directory.
43
43
  * @param dirPath directory to parse.
@@ -65,4 +65,3 @@ function parseIncludeReferenceStatementsByDir(dirPath, wrapInDataAndPath = false
65
65
  });
66
66
  return wrapInDataAndPath ? schemasWithPath : schemas;
67
67
  }
68
- exports.parseIncludeReferenceStatementsByDir = parseIncludeReferenceStatementsByDir;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyPatchTree = exports.applyPatchWithDotNotation = void 0;
3
+ exports.applyPatchWithDotNotation = applyPatchWithDotNotation;
4
+ exports.applyPatchTree = applyPatchTree;
4
5
  function isPlainObject(value) {
5
6
  return value !== null && typeof value === "object" && !Array.isArray(value);
6
7
  }
@@ -28,7 +29,6 @@ function applyPatchWithDotNotation(target, path, patchValue) {
28
29
  }
29
30
  // If existingValue is undefined, we skip;
30
31
  }
31
- exports.applyPatchWithDotNotation = applyPatchWithDotNotation;
32
32
  function applyPatchTree(schema, patchNode, pathPrefix) {
33
33
  Object.entries(patchNode).forEach(([key, value]) => {
34
34
  if (key.includes(".")) {
@@ -49,4 +49,3 @@ function applyPatchTree(schema, patchNode, pathPrefix) {
49
49
  }
50
50
  });
51
51
  }
52
- exports.applyPatchTree = applyPatchTree;
@@ -1,5 +1,5 @@
1
1
  {
2
- "&CONTROL": {
2
+ "CONTROL": {
3
3
  "calculation": "scf",
4
4
  "title": "",
5
5
  "verbosity": "low",
@@ -12,7 +12,7 @@
12
12
  "prefix": "__prefix__",
13
13
  "pseudo_dir": "{{ JOB_WORK_DIR }}/pseudo"
14
14
  },
15
- "&SYSTEM": {
15
+ "SYSTEM": {
16
16
  "ibrav": 0,
17
17
  "nat": 2,
18
18
  "ntyp": 2,
@@ -37,15 +37,15 @@
37
37
  ]
38
38
  ]
39
39
  },
40
- "&ELECTRONS": {
40
+ "ELECTRONS": {
41
41
  "diagonalization": "david",
42
42
  "diago_david_ndim": 4,
43
43
  "diago_full_acc": true,
44
44
  "mixing_beta": 0.3,
45
45
  "startingwfc": "atomic+random"
46
46
  },
47
- "&IONS": null,
48
- "&CELL": null,
47
+ "IONS": null,
48
+ "CELL": null,
49
49
  "ATOMIC_SPECIES": {
50
50
  "values": [
51
51
  {
@@ -5,7 +5,7 @@
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
- "&CONTROL": {
8
+ "CONTROL": {
9
9
  "$schema": "http://json-schema.org/draft-07/schema#",
10
10
  "title": "control schema",
11
11
  "type": "object",
@@ -185,7 +185,7 @@
185
185
  }
186
186
  }
187
187
  },
188
- "&SYSTEM": {
188
+ "SYSTEM": {
189
189
  "$schema": "http://json-schema.org/draft-07/schema#",
190
190
  "title": "system schema",
191
191
  "type": "object",
@@ -836,7 +836,7 @@
836
836
  }
837
837
  }
838
838
  },
839
- "&ELECTRONS": {
839
+ "ELECTRONS": {
840
840
  "$schema": "http://json-schema.org/draft-07/schema#",
841
841
  "title": "electrons schema",
842
842
  "type": "object",
@@ -998,7 +998,7 @@
998
998
  }
999
999
  }
1000
1000
  },
1001
- "&IONS": {
1001
+ "IONS": {
1002
1002
  "oneOf": [
1003
1003
  {
1004
1004
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -1220,7 +1220,7 @@
1220
1220
  }
1221
1221
  ]
1222
1222
  },
1223
- "&CELL": {
1223
+ "CELL": {
1224
1224
  "oneOf": [
1225
1225
  {
1226
1226
  "$schema": "http://json-schema.org/draft-07/schema#",