@mat3ra/wode 2026.10.26-0 → 2026.11.17-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.
package/README.md CHANGED
@@ -21,7 +21,7 @@ a single JS file so that workflow configurations can be accessed in the browser
21
21
  in a NodeJS process.
22
22
 
23
23
  The relevant data parameterizing supported entities is housed in the
24
- [Standata](https://github.com/Exabyte-io/standata) repository.
24
+ [Standata](https://github.com/mat3ra/standata) repository.
25
25
 
26
26
  ## Installation
27
27
 
@@ -34,7 +34,7 @@ npm install @mat3ra/wode
34
34
  For development:
35
35
 
36
36
  ```bash
37
- git clone https://github.com/Exabyte-io/wode.git
37
+ git clone https://github.com/mat3ra/wode.git
38
38
  ```
39
39
 
40
40
 
@@ -78,7 +78,7 @@ This repository is an [open-source](LICENSE.md) work-in-progress and we welcome
78
78
  We regularly deploy the latest code containing all accepted contributions online as part of the
79
79
  [Mat3ra.com](https://mat3ra.com) platform, so contributors will see their code in action there.
80
80
 
81
- See [ESSE](https://github.com/Exabyte-io/esse) for additional context regarding the data schemas used here.
81
+ See [ESSE](https://github.com/mat3ra/esse) for additional context regarding the data schemas used here.
82
82
 
83
83
  Useful commands for development:
84
84
 
@@ -154,7 +154,7 @@ Workflows defined as configuration conform to the following specification:
154
154
  - `method: Object` - a method specification
155
155
  - `name: String` - a named method class exported from MeDe
156
156
  - `config: Optional[Object]` - see `Config` defined below
157
- - `model: Object` - a model specification
157
+ - `model: Object` - a model specification
158
158
  - `name: String` - a named model class exported from MeDe
159
159
  - `config: Optional[Object]` - see `Config` defined below
160
160
  - `config: Optional[Object]` - see `Config` defined below
@@ -7,7 +7,7 @@ import type { BaseInMemoryEntitySchema, JobSchema, SubworkflowSchema } from "@ma
7
7
  import { type ComputedEntityMixin } from "@mat3ra/ide/dist/js/compute";
8
8
  import type { Material } from "@mat3ra/made";
9
9
  import { Model, ModelFactory } from "@mat3ra/mode";
10
- import type { MetaPropertyHolder } from "@mat3ra/prode";
10
+ import { type MetaPropertyHolder } from "@mat3ra/prode";
11
11
  import type { WorkflowExternalContext } from "./context/providers/base/ContextProvider";
12
12
  import { type SubworkflowSchemaMixin } from "./generated/SubworkflowSchemaMixin";
13
13
  import { SubworkflowUnit } from "./units";
@@ -20,6 +20,18 @@ const units_1 = require("./units");
20
20
  function isAssignmentUnitSchema(unit) {
21
21
  return unit.type === enums_1.UnitType.assignment;
22
22
  }
23
+ /**
24
+ * Selects the pseudopotential meta-properties whose apps list includes this application.
25
+ */
26
+ function selectMetaPropertiesForApplication(metaProperties, elements, appName) {
27
+ return metaProperties
28
+ .filter((metaProperty) => {
29
+ // @ts-ignore TODO: fix types
30
+ const { element, apps } = metaProperty.data;
31
+ return elements.includes(element) && apps.includes(appName);
32
+ })
33
+ .map((metaProperty) => metaProperty.property);
34
+ }
23
35
  class Subworkflow extends entity_1.InMemoryEntity {
24
36
  static get jsonSchema() {
25
37
  return JSONSchemasInterface_1.default.getSchemaById("workflow/subworkflow");
@@ -243,14 +255,7 @@ class Subworkflow extends entity_1.InMemoryEntity {
243
255
  const { model } = this;
244
256
  const uniqueElements = [...new Set(materials.map((m) => m.uniqueElements).flat())];
245
257
  const appName = this.application.name;
246
- const methodDataItems = metaProperties
247
- .filter((metaProperty) => {
248
- return (
249
- // @ts-ignore TODO: fix types
250
- uniqueElements.includes(metaProperty.data.element) &&
251
- metaProperty.data.apps.includes(appName));
252
- })
253
- .map((metaProperty) => metaProperty.property);
258
+ const methodDataItems = selectMetaPropertiesForApplication(metaProperties, uniqueElements, appName);
254
259
  if (method.type !== "pseudopotential" || !methodDataItems.length) {
255
260
  return;
256
261
  }
@@ -8,12 +8,13 @@ const ApplicationContextMixin_1 = __importDefault(require("../mixins/Application
8
8
  const ContextProvider_1 = __importDefault(require("./base/ContextProvider"));
9
9
  // Type guard to check if a string is a valid ApplicationName
10
10
  function isApplicationName(name) {
11
- return name === "vasp" || name === "espresso";
11
+ return name === "vasp" || name === "espresso" || name === "q3";
12
12
  }
13
13
  // TODO: create a task to move this handling to standata
14
14
  const cutoffConfig = {
15
15
  vasp: { wavefunction: undefined, density: undefined },
16
16
  espresso: { wavefunction: 40, density: 200 },
17
+ q3: { wavefunction: 30, density: 240 },
17
18
  };
18
19
  const defaultData = {
19
20
  wavefunction: undefined,
@@ -1,7 +1,7 @@
1
1
  import type { BaseMethod, InputContextItemSchema, QEPwxContextProviderSchema } from "@mat3ra/esse/dist/js/types";
2
2
  import type { AtomicElementValue } from "@mat3ra/made/dist/js/basis/elements";
3
3
  import type { JSONSchema7 } from "json-schema";
4
- import { type MaterialContextMixin, type MaterialExternalContext } from "../../../mixins/MaterialContextMixin";
4
+ import { type MaterialContextMixin, type MaterialExternalContext, type OrderedMaterial } from "../../../mixins/MaterialContextMixin";
5
5
  import { type MaterialsContextMixin, type MaterialsExternalContext } from "../../../mixins/MaterialsContextMixin";
6
6
  import type { JobExternalContext, UnitContext, WorkflowExternalContext } from "../../base/ContextProvider";
7
7
  import JSONSchemaDataProvider, { type JinjaExternalContext } from "../../base/JSONSchemaDataProvider";
@@ -33,7 +33,13 @@ declare class QEPWXInputDataManager extends JSONSchemaDataProvider<Schema, Exter
33
33
  static createFromUnitContext(unitContext: UnitContext, externalContext: ExternalContext): QEPWXInputDataManager;
34
34
  readonly jsonSchema: JSONSchema7;
35
35
  constructor(config: Partial<Schema>, externalContext: ExternalContext);
36
- private buildQEPWXContext;
36
+ /**
37
+ * The reference to the pseudopotential file written into the input: pw.x resolves it inside
38
+ * `pseudo_dir`, so only the file name is used. Applications reading the files from elsewhere
39
+ * override this.
40
+ */
41
+ protected getPseudopotentialReference(element: AtomicElementValue): string;
42
+ protected buildQEPWXContext(material: OrderedMaterial): Data;
37
43
  getDefaultData(): {
38
44
  perMaterial: QEPwxContextProviderSchema[];
39
45
  IBRAV: number;
@@ -13,7 +13,7 @@ const jsonSchemaId = "context-providers-directory/by-application/qe-pwx-context-
13
13
  class QEPWXInputDataManager extends JSONSchemaDataProvider_1.default {
14
14
  static createFromUnitContext(unitContext, externalContext) {
15
15
  const contextItem = this.findContextItem(unitContext, "input");
16
- return new QEPWXInputDataManager(contextItem, externalContext);
16
+ return new this(contextItem, externalContext);
17
17
  }
18
18
  constructor(config, externalContext) {
19
19
  super(config, externalContext);
@@ -32,29 +32,36 @@ class QEPWXInputDataManager extends JSONSchemaDataProvider_1.default {
32
32
  }
33
33
  this.jsonSchema = jsonSchema;
34
34
  }
35
+ /**
36
+ * The reference to the pseudopotential file written into the input: pw.x resolves it inside
37
+ * `pseudo_dir`, so only the file name is used. Applications reading the files from elsewhere
38
+ * override this.
39
+ */
40
+ getPseudopotentialReference(element) {
41
+ var _a;
42
+ const pseudo = (((_a = this.methodData) === null || _a === void 0 ? void 0 : _a.pseudo) || []).find((p) => p.element === element);
43
+ return (pseudo === null || pseudo === void 0 ? void 0 : pseudo.filename) || path_1.default.basename((pseudo === null || pseudo === void 0 ? void 0 : pseudo.path) || "");
44
+ }
35
45
  buildQEPWXContext(material) {
36
46
  const basis = material.getBasis();
37
47
  const lattice = material.getLattice();
38
48
  const { jobHasParent, workflowHasRelaxation } = this;
39
49
  const ATOMIC_SPECIES = basis.uniqueElements.map((symbol) => {
40
- var _a;
41
- const pseudo = (((_a = this.methodData) === null || _a === void 0 ? void 0 : _a.pseudo) || []).find((p) => p.element === symbol);
42
50
  return {
43
51
  X: symbol,
44
52
  Mass_X: periodic_table_js_1.PERIODIC_TABLE[symbol].atomic_mass,
45
- PseudoPot_X: (pseudo === null || pseudo === void 0 ? void 0 : pseudo.filename) || path_1.default.basename((pseudo === null || pseudo === void 0 ? void 0 : pseudo.path) || ""),
53
+ PseudoPot_X: this.getPseudopotentialReference(symbol),
46
54
  };
47
55
  });
48
56
  const uniqueElementsWithLabels = [...new Set(basis.elementsWithLabelsArray)];
49
57
  const ATOMIC_SPECIES_WITH_LABELS = uniqueElementsWithLabels.map((symbol) => {
50
- var _a, _b;
58
+ var _a;
51
59
  const symbolWithoutLabel = symbol.replace(/\d$/, "");
52
60
  const label = symbol.match(/\d$/g) ? (_a = symbol.match(/\d$/g)) === null || _a === void 0 ? void 0 : _a[0] : "";
53
- const pseudo = (((_b = this.methodData) === null || _b === void 0 ? void 0 : _b.pseudo) || []).find((p) => p.element === symbolWithoutLabel);
54
61
  return {
55
62
  X: `${symbolWithoutLabel}${label}`,
56
63
  Mass_X: periodic_table_js_1.PERIODIC_TABLE[symbolWithoutLabel].atomic_mass,
57
- PseudoPot_X: (pseudo === null || pseudo === void 0 ? void 0 : pseudo.filename) || path_1.default.basename((pseudo === null || pseudo === void 0 ? void 0 : pseudo.path) || ""),
64
+ PseudoPot_X: this.getPseudopotentialReference(symbolWithoutLabel),
58
65
  };
59
66
  });
60
67
  const CELL_PARAMETERS = {
@@ -0,0 +1,10 @@
1
+ import type { AtomicElementValue } from "@mat3ra/made/dist/js/basis/elements";
2
+ import QEPWXInputDataManager from "../espresso/QEPWXInputDataManager";
3
+ /**
4
+ * q3 reads the same UPF files as pw.x, but takes their full location from the input instead of a
5
+ * `pseudo_dir` plus file name, so nothing has to be staged next to the input file.
6
+ */
7
+ declare class Q3InputDataManager extends QEPWXInputDataManager {
8
+ protected getPseudopotentialReference(element: AtomicElementValue): string;
9
+ }
10
+ export default Q3InputDataManager;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const QEPWXInputDataManager_1 = __importDefault(require("../espresso/QEPWXInputDataManager"));
7
+ /**
8
+ * q3 reads the same UPF files as pw.x, but takes their full location from the input instead of a
9
+ * `pseudo_dir` plus file name, so nothing has to be staged next to the input file.
10
+ */
11
+ class Q3InputDataManager extends QEPWXInputDataManager_1.default {
12
+ getPseudopotentialReference(element) {
13
+ var _a;
14
+ const pseudo = (((_a = this.methodData) === null || _a === void 0 ? void 0 : _a.pseudo) || []).find((p) => p.element === element);
15
+ return (pseudo === null || pseudo === void 0 ? void 0 : pseudo.path) || (pseudo === null || pseudo === void 0 ? void 0 : pseudo.filename) || "";
16
+ }
17
+ }
18
+ exports.default = Q3InputDataManager;
@@ -9,6 +9,7 @@ import BoundaryConditionsFormDataManager from "./BoundaryConditionsFormDataManag
9
9
  import QENEBInputDataManager from "./by_application/espresso/QENEBInputDataManager";
10
10
  import QEPWXInputDataManager, { type MethodDataExternalContext } from "./by_application/espresso/QEPWXInputDataManager";
11
11
  import NWChemInputDataManager from "./by_application/nwchem/NWChemInputDataManager";
12
+ import Q3InputDataManager from "./by_application/q3/Q3InputDataManager";
12
13
  import VASPInputDataManager from "./by_application/vasp/VASPInputDataManager";
13
14
  import VASPNEBInputDataManager from "./by_application/vasp/VASPNEBInputDataManager";
14
15
  import CollinearMagnetizationDataManager from "./CollinearMagnetizationDataManager";
@@ -57,6 +58,7 @@ export declare const PROVIDER_REGISTRY: {
57
58
  readonly NonCollinearMagnetizationDataManager: typeof NonCollinearMagnetizationDataManager;
58
59
  readonly QEPWXInputDataManager: typeof QEPWXInputDataManager;
59
60
  readonly QENEBInputDataManager: typeof QENEBInputDataManager;
61
+ readonly Q3InputDataManager: typeof Q3InputDataManager;
60
62
  readonly VASPInputDataManager: typeof VASPInputDataManager;
61
63
  readonly VASPNEBInputDataManager: typeof VASPNEBInputDataManager;
62
64
  readonly NWChemInputDataManager: typeof NWChemInputDataManager;
@@ -92,4 +94,4 @@ export type AnyContextProvider = InstanceType<(typeof PROVIDER_REGISTRY)[Provide
92
94
  * @throws Error if the provider name is unknown
93
95
  */
94
96
  export declare function createProvider(name: ProviderName, context: UnitContext, externalContext: ExternalContext): AnyContextProvider;
95
- export { BoundaryConditionsFormDataManager, QENEBInputDataManager, QEPWXInputDataManager, NWChemInputDataManager, VASPInputDataManager, VASPNEBInputDataManager, CollinearMagnetizationDataManager, HubbardContextManagerLegacy, HubbardJContextManager, HubbardUContextManager, HubbardVContextManager, IonDynamicsDataManager, MLSettingsDataManager, MLTrainTestSplitDataManager, NEBFormDataManager, NonCollinearMagnetizationDataManager, PlanewaveCutoffDataManager, IGridFormDataManager, KGridFormDataManager, QGridFormDataManager, ExplicitKPath2PIBAFormDataManager, ExplicitKPathFormDataManager, IPathFormDataManager, KPathFormDataManager, QPathFormDataManager, };
97
+ export { BoundaryConditionsFormDataManager, Q3InputDataManager, QENEBInputDataManager, QEPWXInputDataManager, NWChemInputDataManager, VASPInputDataManager, VASPNEBInputDataManager, CollinearMagnetizationDataManager, HubbardContextManagerLegacy, HubbardJContextManager, HubbardUContextManager, HubbardVContextManager, IonDynamicsDataManager, MLSettingsDataManager, MLTrainTestSplitDataManager, NEBFormDataManager, NonCollinearMagnetizationDataManager, PlanewaveCutoffDataManager, IGridFormDataManager, KGridFormDataManager, QGridFormDataManager, ExplicitKPath2PIBAFormDataManager, ExplicitKPathFormDataManager, IPathFormDataManager, KPathFormDataManager, QPathFormDataManager, };
@@ -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.QPathFormDataManager = exports.KPathFormDataManager = exports.IPathFormDataManager = exports.ExplicitKPathFormDataManager = exports.ExplicitKPath2PIBAFormDataManager = exports.QGridFormDataManager = exports.KGridFormDataManager = exports.IGridFormDataManager = exports.PlanewaveCutoffDataManager = exports.NonCollinearMagnetizationDataManager = exports.NEBFormDataManager = exports.MLTrainTestSplitDataManager = exports.MLSettingsDataManager = exports.IonDynamicsDataManager = exports.HubbardVContextManager = exports.HubbardUContextManager = exports.HubbardJContextManager = exports.HubbardContextManagerLegacy = exports.CollinearMagnetizationDataManager = exports.VASPNEBInputDataManager = exports.VASPInputDataManager = exports.NWChemInputDataManager = exports.QEPWXInputDataManager = exports.QENEBInputDataManager = exports.BoundaryConditionsFormDataManager = exports.PROVIDER_REGISTRY = void 0;
6
+ exports.QPathFormDataManager = exports.KPathFormDataManager = exports.IPathFormDataManager = exports.ExplicitKPathFormDataManager = exports.ExplicitKPath2PIBAFormDataManager = exports.QGridFormDataManager = exports.KGridFormDataManager = exports.IGridFormDataManager = exports.PlanewaveCutoffDataManager = exports.NonCollinearMagnetizationDataManager = exports.NEBFormDataManager = exports.MLTrainTestSplitDataManager = exports.MLSettingsDataManager = exports.IonDynamicsDataManager = exports.HubbardVContextManager = exports.HubbardUContextManager = exports.HubbardJContextManager = exports.HubbardContextManagerLegacy = exports.CollinearMagnetizationDataManager = exports.VASPNEBInputDataManager = exports.VASPInputDataManager = exports.NWChemInputDataManager = exports.QEPWXInputDataManager = exports.QENEBInputDataManager = exports.Q3InputDataManager = exports.BoundaryConditionsFormDataManager = exports.PROVIDER_REGISTRY = void 0;
7
7
  exports.createProvider = createProvider;
8
8
  const BoundaryConditionsFormDataManager_1 = __importDefault(require("./BoundaryConditionsFormDataManager"));
9
9
  exports.BoundaryConditionsFormDataManager = BoundaryConditionsFormDataManager_1.default;
@@ -13,6 +13,8 @@ const QEPWXInputDataManager_1 = __importDefault(require("./by_application/espres
13
13
  exports.QEPWXInputDataManager = QEPWXInputDataManager_1.default;
14
14
  const NWChemInputDataManager_1 = __importDefault(require("./by_application/nwchem/NWChemInputDataManager"));
15
15
  exports.NWChemInputDataManager = NWChemInputDataManager_1.default;
16
+ const Q3InputDataManager_1 = __importDefault(require("./by_application/q3/Q3InputDataManager"));
17
+ exports.Q3InputDataManager = Q3InputDataManager_1.default;
16
18
  const VASPInputDataManager_1 = __importDefault(require("./by_application/vasp/VASPInputDataManager"));
17
19
  exports.VASPInputDataManager = VASPInputDataManager_1.default;
18
20
  const VASPNEBInputDataManager_1 = __importDefault(require("./by_application/vasp/VASPNEBInputDataManager"));
@@ -83,6 +85,7 @@ exports.PROVIDER_REGISTRY = {
83
85
  NonCollinearMagnetizationDataManager: NonCollinearMagnetizationDataManager_1.default,
84
86
  QEPWXInputDataManager: QEPWXInputDataManager_1.default,
85
87
  QENEBInputDataManager: QENEBInputDataManager_1.default,
88
+ Q3InputDataManager: Q3InputDataManager_1.default,
86
89
  VASPInputDataManager: VASPInputDataManager_1.default,
87
90
  VASPNEBInputDataManager: VASPNEBInputDataManager_1.default,
88
91
  NWChemInputDataManager: NWChemInputDataManager_1.default,
@@ -138,6 +138,10 @@ class ExecutionUnit extends BaseUnit_1.default {
138
138
  setDefaultInput({ reusePersistedInput = true } = {}) {
139
139
  const driverTemplates = new standata_1.ApplicationRegistry().getInput(this.application, this.flavor);
140
140
  const persistedItems = reusePersistedInput ? this.matchPersistedInput(driverTemplates) : [];
141
+ // `matchPersistedInput` returns rows of `this.input` itself, so identity is the match.
142
+ const addedItems = reusePersistedInput
143
+ ? this.input.filter((item) => !persistedItems.includes(item) && this.isPersistedInputItemCompatible(item))
144
+ : [];
141
145
  this.inputInstances = driverTemplates.map((driverTemplate, index) => {
142
146
  const persistedItem = persistedItems[index];
143
147
  if (persistedItem && this.isPersistedInputItemCompatible(persistedItem)) {
@@ -145,6 +149,7 @@ class ExecutionUnit extends BaseUnit_1.default {
145
149
  }
146
150
  return ExecutionUnitInput_1.default.createFromTemplate(driverTemplate);
147
151
  });
152
+ this.inputInstances.push(...addedItems.map((item) => new ExecutionUnitInput_1.default(item)));
148
153
  this.input = this.inputInstances.map((input) => input.toJSON());
149
154
  }
150
155
  render(externalContext, convergence) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mat3ra/wode",
3
- "version": "2026.10.26-0",
3
+ "version": "2026.11.17-0",
4
4
  "description": "WOrkflow DEfinitions",
5
5
  "scripts": {
6
6
  "test": "mocha --recursive --bail --require ts-node/register 'tests/js/**/*.ts'",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com/Exabyte-io/wode.git"
21
+ "url": "https://github.com/mat3ra/wode.git"
22
22
  },
23
23
  "main": "dist/js/index.js",
24
24
  "files": [
@@ -28,10 +28,10 @@
28
28
  ],
29
29
  "author": "Exabyte Inc.",
30
30
  "bugs": {
31
- "url": "https://github.com/Exabyte-io/wode/issues"
31
+ "url": "https://github.com/mat3ra/wode/issues"
32
32
  },
33
33
  "license": "Apache-2.0",
34
- "homepage": "https://github.com/Exabyte-io/wode",
34
+ "homepage": "https://github.com/mat3ra/wode",
35
35
  "dependencies": {
36
36
  "@exabyte-io/periodic-table.js": "2022.6.8-0",
37
37
  "@types/json-schema": "^7.0.15",
@@ -40,32 +40,32 @@
40
40
  "underscore.string": "^3.3.6"
41
41
  },
42
42
  "devDependencies": {
43
- "@exabyte-io/eslint-config": "2025.5.13-0",
44
43
  "@mat3ra/ade": "2026.8.18-0",
45
44
  "@mat3ra/code": "2026.8.18-0",
45
+ "@mat3ra/eslint-config": "^2026.7.12-0",
46
46
  "@mat3ra/esse": "2026.8.18-2",
47
47
  "@mat3ra/ide": "2026.10.8-0",
48
48
  "@mat3ra/made": "2026.8.18-0",
49
49
  "@mat3ra/mode": "2026.8.18-0",
50
- "@mat3ra/prode": "2026.8.18-0",
51
- "@mat3ra/standata": "2026.8.18-0",
50
+ "@mat3ra/prode": "^2026.11.2-1",
51
+ "@mat3ra/standata": "^2026.11.2-0",
52
52
  "@mat3ra/tsconfig": "^2024.6.3-0",
53
53
  "@mat3ra/utils": "2026.8.18-1",
54
54
  "@typescript-eslint/eslint-plugin": "^5.62.0",
55
55
  "@typescript-eslint/parser": "^5.62.0",
56
56
  "chai": "^4.3.4",
57
57
  "eslint": "^7.32.0",
58
- "eslint-config-airbnb": "^19.0.2",
59
- "eslint-config-prettier": "^8.5.0",
58
+ "eslint-config-airbnb": "^19.0.4",
59
+ "eslint-config-prettier": "^8.10.2",
60
60
  "eslint-import-resolver-exports": "^1.0.0-beta.5",
61
61
  "eslint-import-resolver-meteor": "^0.4.0",
62
- "eslint-import-resolver-node": "^0.3.9",
63
- "eslint-plugin-import": "^2.25.3",
64
- "eslint-plugin-jsdoc": "^37.1.0",
65
- "eslint-plugin-jsx-a11y": "^6.5.1",
66
- "eslint-plugin-mui-path-imports": "0.0.15",
67
- "eslint-plugin-prettier": "^4.2.1",
68
- "eslint-plugin-react": "^7.30.0",
62
+ "eslint-import-resolver-node": "^0.4.0",
63
+ "eslint-plugin-import": "^2.32.0",
64
+ "eslint-plugin-jsdoc": "^50.8.0",
65
+ "eslint-plugin-jsx-a11y": "^6.10.2",
66
+ "eslint-plugin-mui-path-imports": "^0.0.15",
67
+ "eslint-plugin-prettier": "^4.2.5",
68
+ "eslint-plugin-react": "^7.37.5",
69
69
  "eslint-plugin-simple-import-sort": "^7.0.0",
70
70
  "husky": "^7.0.4",
71
71
  "lint-staged": "^12.1.2",
@@ -82,6 +82,7 @@
82
82
  "@mat3ra/ide": "*",
83
83
  "@mat3ra/made": "*",
84
84
  "@mat3ra/mode": "*",
85
+ "@mat3ra/prode": "*",
85
86
  "@mat3ra/standata": "*",
86
87
  "@mat3ra/utils": "*"
87
88
  },
@@ -22,7 +22,7 @@ import type {
22
22
  import { type ComputedEntityMixin, computedEntityMixin } from "@mat3ra/ide/dist/js/compute";
23
23
  import type { Material } from "@mat3ra/made";
24
24
  import { type PseudopotentialMethod, Model, ModelFactory } from "@mat3ra/mode";
25
- import type { MetaPropertyHolder } from "@mat3ra/prode";
25
+ import { type MetaPropertyHolder } from "@mat3ra/prode";
26
26
  import { ApplicationRegistry, setUnitLinks } from "@mat3ra/standata";
27
27
  import { Utils } from "@mat3ra/utils";
28
28
 
@@ -66,6 +66,23 @@ function isAssignmentUnitSchema(
66
66
  return unit.type === UnitType.assignment;
67
67
  }
68
68
 
69
+ /**
70
+ * Selects the pseudopotential meta-properties whose apps list includes this application.
71
+ */
72
+ function selectMetaPropertiesForApplication(
73
+ metaProperties: MetaPropertyHolder[],
74
+ elements: string[],
75
+ appName: string,
76
+ ) {
77
+ return metaProperties
78
+ .filter((metaProperty) => {
79
+ // @ts-ignore TODO: fix types
80
+ const { element, apps } = metaProperty.data;
81
+ return elements.includes(element) && apps.includes(appName);
82
+ })
83
+ .map((metaProperty) => metaProperty.property);
84
+ }
85
+
69
86
  export type SubworkflowEntity = SubworkflowSchema & BaseInMemoryEntitySchema;
70
87
 
71
88
  type Schema = SubworkflowEntity;
@@ -342,15 +359,11 @@ class Subworkflow<S extends Schema = Schema> extends InMemoryEntity<S> {
342
359
  const uniqueElements = [...new Set(materials.map((m) => m.uniqueElements).flat())];
343
360
  const appName = this.application.name;
344
361
 
345
- const methodDataItems = metaProperties
346
- .filter((metaProperty) => {
347
- return (
348
- // @ts-ignore TODO: fix types
349
- uniqueElements.includes(metaProperty.data.element) &&
350
- metaProperty.data.apps.includes(appName)
351
- );
352
- })
353
- .map((metaProperty) => metaProperty.property);
362
+ const methodDataItems = selectMetaPropertiesForApplication(
363
+ metaProperties,
364
+ uniqueElements,
365
+ appName,
366
+ );
354
367
 
355
368
  if (method.type !== "pseudopotential" || !methodDataItems.length) {
356
369
  return;
@@ -11,7 +11,7 @@ import ContextProvider, {
11
11
  type UnitContext,
12
12
  } from "./base/ContextProvider";
13
13
 
14
- type ApplicationName = "vasp" | "espresso";
14
+ type ApplicationName = "vasp" | "espresso" | "q3";
15
15
 
16
16
  type Schema = CutoffsContextItemSchema;
17
17
  type PlanewaveExternalContext = BaseExternalContext & ApplicationExternalContext;
@@ -21,13 +21,14 @@ interface PlanewaveCutoffDataManager extends ApplicationContextMixin {}
21
21
 
22
22
  // Type guard to check if a string is a valid ApplicationName
23
23
  function isApplicationName(name: string): name is ApplicationName {
24
- return name === "vasp" || name === "espresso";
24
+ return name === "vasp" || name === "espresso" || name === "q3";
25
25
  }
26
26
 
27
27
  // TODO: create a task to move this handling to standata
28
28
  const cutoffConfig: Record<ApplicationName, { wavefunction?: number; density?: number }> = {
29
29
  vasp: { wavefunction: undefined, density: undefined },
30
30
  espresso: { wavefunction: 40, density: 200 },
31
+ q3: { wavefunction: 30, density: 240 },
31
32
  };
32
33
 
33
34
  const defaultData = {
@@ -67,7 +67,7 @@ class QEPWXInputDataManager extends JSONSchemaDataProvider<Schema, ExternalConte
67
67
  static createFromUnitContext(unitContext: UnitContext, externalContext: ExternalContext) {
68
68
  const contextItem = this.findContextItem<Schema>(unitContext, "input");
69
69
 
70
- return new QEPWXInputDataManager(contextItem, externalContext);
70
+ return new this(contextItem, externalContext);
71
71
  }
72
72
 
73
73
  readonly jsonSchema: JSONSchema7;
@@ -90,17 +90,26 @@ class QEPWXInputDataManager extends JSONSchemaDataProvider<Schema, ExternalConte
90
90
  this.jsonSchema = jsonSchema;
91
91
  }
92
92
 
93
- private buildQEPWXContext(material: OrderedMaterial): Data {
93
+ /**
94
+ * The reference to the pseudopotential file written into the input: pw.x resolves it inside
95
+ * `pseudo_dir`, so only the file name is used. Applications reading the files from elsewhere
96
+ * override this.
97
+ */
98
+ protected getPseudopotentialReference(element: AtomicElementValue) {
99
+ const pseudo = (this.methodData?.pseudo || []).find((p) => p.element === element);
100
+ return pseudo?.filename || path.basename(pseudo?.path || "");
101
+ }
102
+
103
+ protected buildQEPWXContext(material: OrderedMaterial): Data {
94
104
  const basis = material.getBasis();
95
105
  const lattice = material.getLattice();
96
106
  const { jobHasParent, workflowHasRelaxation } = this;
97
107
 
98
108
  const ATOMIC_SPECIES = basis.uniqueElements.map((symbol) => {
99
- const pseudo = (this.methodData?.pseudo || []).find((p) => p.element === symbol);
100
109
  return {
101
110
  X: symbol,
102
111
  Mass_X: PERIODIC_TABLE[symbol].atomic_mass,
103
- PseudoPot_X: pseudo?.filename || path.basename(pseudo?.path || ""),
112
+ PseudoPot_X: this.getPseudopotentialReference(symbol),
104
113
  };
105
114
  });
106
115
 
@@ -109,13 +118,10 @@ class QEPWXInputDataManager extends JSONSchemaDataProvider<Schema, ExternalConte
109
118
  const ATOMIC_SPECIES_WITH_LABELS = uniqueElementsWithLabels.map((symbol) => {
110
119
  const symbolWithoutLabel = symbol.replace(/\d$/, "") as AtomicElementValue;
111
120
  const label = symbol.match(/\d$/g) ? symbol.match(/\d$/g)?.[0] : "";
112
- const pseudo = (this.methodData?.pseudo || []).find(
113
- (p) => p.element === symbolWithoutLabel,
114
- );
115
121
  return {
116
122
  X: `${symbolWithoutLabel}${label}`,
117
123
  Mass_X: PERIODIC_TABLE[symbolWithoutLabel].atomic_mass,
118
- PseudoPot_X: pseudo?.filename || path.basename(pseudo?.path || ""),
124
+ PseudoPot_X: this.getPseudopotentialReference(symbolWithoutLabel),
119
125
  };
120
126
  });
121
127
 
@@ -0,0 +1,16 @@
1
+ import type { AtomicElementValue } from "@mat3ra/made/dist/js/basis/elements";
2
+
3
+ import QEPWXInputDataManager from "../espresso/QEPWXInputDataManager";
4
+
5
+ /**
6
+ * q3 reads the same UPF files as pw.x, but takes their full location from the input instead of a
7
+ * `pseudo_dir` plus file name, so nothing has to be staged next to the input file.
8
+ */
9
+ class Q3InputDataManager extends QEPWXInputDataManager {
10
+ protected getPseudopotentialReference(element: AtomicElementValue) {
11
+ const pseudo = (this.methodData?.pseudo || []).find((p) => p.element === element);
12
+ return pseudo?.path || pseudo?.filename || "";
13
+ }
14
+ }
15
+
16
+ export default Q3InputDataManager;
@@ -16,6 +16,7 @@ import QEPWXInputDataManager, {
16
16
  type MethodDataExternalContext,
17
17
  } from "./by_application/espresso/QEPWXInputDataManager";
18
18
  import NWChemInputDataManager from "./by_application/nwchem/NWChemInputDataManager";
19
+ import Q3InputDataManager from "./by_application/q3/Q3InputDataManager";
19
20
  import VASPInputDataManager from "./by_application/vasp/VASPInputDataManager";
20
21
  import VASPNEBInputDataManager from "./by_application/vasp/VASPNEBInputDataManager";
21
22
  import CollinearMagnetizationDataManager from "./CollinearMagnetizationDataManager";
@@ -65,6 +66,7 @@ export const PROVIDER_REGISTRY = {
65
66
  NonCollinearMagnetizationDataManager,
66
67
  QEPWXInputDataManager,
67
68
  QENEBInputDataManager,
69
+ Q3InputDataManager,
68
70
  VASPInputDataManager,
69
71
  VASPNEBInputDataManager,
70
72
  NWChemInputDataManager,
@@ -135,6 +137,7 @@ export function createProvider(
135
137
  // Re-export all provider classes for convenience
136
138
  export {
137
139
  BoundaryConditionsFormDataManager,
140
+ Q3InputDataManager,
138
141
  QENEBInputDataManager,
139
142
  QEPWXInputDataManager,
140
143
  NWChemInputDataManager,
@@ -205,6 +205,13 @@ class ExecutionUnit extends BaseUnit<Schema> implements Schema {
205
205
  setDefaultInput({ reusePersistedInput = true }: { reusePersistedInput?: boolean } = {}) {
206
206
  const driverTemplates = new ApplicationRegistry().getInput(this.application, this.flavor);
207
207
  const persistedItems = reusePersistedInput ? this.matchPersistedInput(driverTemplates) : [];
208
+ // `matchPersistedInput` returns rows of `this.input` itself, so identity is the match.
209
+ const addedItems = reusePersistedInput
210
+ ? this.input.filter(
211
+ (item) =>
212
+ !persistedItems.includes(item) && this.isPersistedInputItemCompatible(item),
213
+ )
214
+ : [];
208
215
 
209
216
  this.inputInstances = driverTemplates.map((driverTemplate, index) => {
210
217
  const persistedItem = persistedItems[index];
@@ -215,6 +222,7 @@ class ExecutionUnit extends BaseUnit<Schema> implements Schema {
215
222
 
216
223
  return ExecutionUnitInput.createFromTemplate(driverTemplate);
217
224
  });
225
+ this.inputInstances.push(...addedItems.map((item) => new ExecutionUnitInput(item)));
218
226
 
219
227
  this.input = this.inputInstances.map((input) => input.toJSON());
220
228
  }