@mat3ra/wode 2025.10.8-0 → 2025.11.4-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/dist/subworkflows/create.js +9 -5
- package/dist/subworkflows/subworkflow.js +14 -5
- package/dist/units/execution.js +5 -1
- package/dist/workflows/relaxation.js +1 -0
- package/dist/workflows/workflow.js +14 -7
- package/package.json +2 -2
- package/src/subworkflows/create.js +17 -6
- package/src/subworkflows/subworkflow.js +17 -5
- package/src/units/execution.js +6 -1
- package/src/workflows/relaxation.js +1 -0
- package/src/workflows/workflow.js +37 -9
- package/assets/subworkflows/deepmd/deepmd.yml +0 -31
- package/assets/subworkflows/deepmd/espresso_cp_md.yml +0 -16
- package/assets/subworkflows/espresso/average_electrostatic_potential_find_minima.yml +0 -27
- package/assets/subworkflows/espresso/average_electrostatic_potential_via_band_structure.yml +0 -67
- package/assets/subworkflows/espresso/band_gap.yml +0 -21
- package/assets/subworkflows/espresso/band_gap_hse_dos.yml +0 -30
- package/assets/subworkflows/espresso/band_structure.yml +0 -26
- package/assets/subworkflows/espresso/band_structure_dos.yml +0 -34
- package/assets/subworkflows/espresso/band_structure_hse.yml +0 -30
- package/assets/subworkflows/espresso/band_structure_magn.yml +0 -31
- package/assets/subworkflows/espresso/band_structure_soc.yml +0 -30
- package/assets/subworkflows/espresso/dielectric_tensor.yml +0 -35
- package/assets/subworkflows/espresso/dos.yml +0 -24
- package/assets/subworkflows/espresso/electronic_density_mesh.yml +0 -19
- package/assets/subworkflows/espresso/esm.yml +0 -14
- package/assets/subworkflows/espresso/esm_relax.yml +0 -14
- package/assets/subworkflows/espresso/espresso_extract_kpoints.yml +0 -16
- package/assets/subworkflows/espresso/espresso_xml_get_qpt_irr.yml +0 -12
- package/assets/subworkflows/espresso/fixed_cell_relaxation.yml +0 -16
- package/assets/subworkflows/espresso/gw_band_structure_band_gap_full_frequency.yml +0 -22
- package/assets/subworkflows/espresso/gw_band_structure_band_gap_plasmon_pole.yml +0 -22
- package/assets/subworkflows/espresso/hubbard_u_hp.yml +0 -21
- package/assets/subworkflows/espresso/kpoint_convergence.yml +0 -86
- package/assets/subworkflows/espresso/neb.yml +0 -16
- package/assets/subworkflows/espresso/ph_init_qpoints.yml +0 -14
- package/assets/subworkflows/espresso/ph_single_irr_qpt.yml +0 -14
- package/assets/subworkflows/espresso/phonon_dispersions.yml +0 -29
- package/assets/subworkflows/espresso/phonon_dos.yml +0 -29
- package/assets/subworkflows/espresso/phonon_dos_dispersion.yml +0 -34
- package/assets/subworkflows/espresso/phonon_reduce.yml +0 -29
- package/assets/subworkflows/espresso/post_processor.yml +0 -14
- package/assets/subworkflows/espresso/pre_processor.yml +0 -14
- package/assets/subworkflows/espresso/pw_scf.yml +0 -16
- package/assets/subworkflows/espresso/recalculate_bands.yml +0 -19
- package/assets/subworkflows/espresso/surface_energy.yml +0 -16
- package/assets/subworkflows/espresso/total_energy.yml +0 -16
- package/assets/subworkflows/espresso/valence_band_offset_calc_from_previous_esp_vbm.yml +0 -35
- package/assets/subworkflows/espresso/variable_cell_relaxation.yml +0 -18
- package/assets/subworkflows/espresso/zero_point_energy.yml +0 -19
- package/assets/subworkflows/jupyterLab/jupyter_notebook.yml +0 -17
- package/assets/subworkflows/nwchem/total_energy.yml +0 -16
- package/assets/subworkflows/python/ml/classification_tail.yml +0 -56
- package/assets/subworkflows/python/ml/clustering_tail.yml +0 -62
- package/assets/subworkflows/python/ml/regression_tail.yml +0 -56
- package/assets/subworkflows/python/ml/train_head.yml +0 -61
- package/assets/subworkflows/python/python_script.yml +0 -14
- package/assets/subworkflows/shell/batch_espresso_pwscf.yml +0 -14
- package/assets/subworkflows/shell/hello_world.yml +0 -14
- package/assets/subworkflows/vasp/band_gap.yml +0 -21
- package/assets/subworkflows/vasp/band_structure.yml +0 -21
- package/assets/subworkflows/vasp/band_structure_dos.yml +0 -23
- package/assets/subworkflows/vasp/dos.yml +0 -18
- package/assets/subworkflows/vasp/fixed_cell_relaxation.yml +0 -16
- package/assets/subworkflows/vasp/initial_final_total_energies.yml +0 -25
- package/assets/subworkflows/vasp/kpoint_convergence.yml +0 -89
- package/assets/subworkflows/vasp/neb_subworkflow.yml +0 -16
- package/assets/subworkflows/vasp/prepare_images.yml +0 -16
- package/assets/subworkflows/vasp/recalculate_bands.yml +0 -16
- package/assets/subworkflows/vasp/surface_energy.yml +0 -18
- package/assets/subworkflows/vasp/total_energy.yml +0 -16
- package/assets/subworkflows/vasp/variable_cell_relaxation.yml +0 -18
- package/assets/subworkflows/vasp/zero_point_energy.yml +0 -16
- package/assets/workflows/deepmd/deepmd_md.yml +0 -6
- package/assets/workflows/espresso/band_gap.yml +0 -4
- package/assets/workflows/espresso/band_gap_dos_hse.yml +0 -4
- package/assets/workflows/espresso/band_structure.yml +0 -4
- package/assets/workflows/espresso/band_structure_dos.yml +0 -4
- package/assets/workflows/espresso/band_structure_hse.yml +0 -14
- package/assets/workflows/espresso/band_structure_magn.yml +0 -7
- package/assets/workflows/espresso/band_structure_soc.yml +0 -7
- package/assets/workflows/espresso/dielectric_tensor.yml +0 -4
- package/assets/workflows/espresso/dos.yml +0 -4
- package/assets/workflows/espresso/electronic_density_mesh.yml +0 -4
- package/assets/workflows/espresso/esm.yml +0 -4
- package/assets/workflows/espresso/esm_relax.yml +0 -4
- package/assets/workflows/espresso/fixed_cell_relaxation.yml +0 -4
- package/assets/workflows/espresso/gw_band_structure_band_gap_full_frequency.yml +0 -4
- package/assets/workflows/espresso/gw_band_structure_band_gap_plasmon_pole.yml +0 -4
- package/assets/workflows/espresso/hubbard_u_hp.yml +0 -7
- package/assets/workflows/espresso/kpoint_convergence.yml +0 -4
- package/assets/workflows/espresso/neb.yml +0 -4
- package/assets/workflows/espresso/phonon_dispersions.yml +0 -4
- package/assets/workflows/espresso/phonon_dos.yml +0 -4
- package/assets/workflows/espresso/phonon_dos_dispersion.yml +0 -4
- package/assets/workflows/espresso/phonon_map.yml +0 -28
- package/assets/workflows/espresso/recalculate_bands.yml +0 -4
- package/assets/workflows/espresso/surface_energy.yml +0 -4
- package/assets/workflows/espresso/total_energy.yml +0 -4
- package/assets/workflows/espresso/valence_band_offset.yml +0 -171
- package/assets/workflows/espresso/variable_cell_relaxation.yml +0 -4
- package/assets/workflows/espresso/zero_point_energy.yml +0 -4
- package/assets/workflows/jupyterLab/jupyter_notebook.yml +0 -4
- package/assets/workflows/nwchem/total_energy.yml +0 -4
- package/assets/workflows/python/ml/classification_workflow.yml +0 -9
- package/assets/workflows/python/ml/clustering_workflow.yml +0 -9
- package/assets/workflows/python/ml/regression_workflow.yml +0 -9
- package/assets/workflows/python/python_script.yml +0 -4
- package/assets/workflows/shell/batch_espresso_pwscf.yml +0 -4
- package/assets/workflows/shell/hello_world.yml +0 -4
- package/assets/workflows/vasp/band_gap.yml +0 -4
- package/assets/workflows/vasp/band_structure.yml +0 -4
- package/assets/workflows/vasp/band_structure_dos.yml +0 -4
- package/assets/workflows/vasp/dos.yml +0 -4
- package/assets/workflows/vasp/fixed_cell_relaxation.yml +0 -4
- package/assets/workflows/vasp/kpoint_convergence.yml +0 -4
- package/assets/workflows/vasp/neb.yml +0 -8
- package/assets/workflows/vasp/recalculate_bands.yml +0 -4
- package/assets/workflows/vasp/surface_energy.yml +0 -4
- package/assets/workflows/vasp/total_energy.yml +0 -4
- package/assets/workflows/vasp/variable_cell_relaxation.yml +0 -4
- package/assets/workflows/vasp/zero_point_energy.yml +0 -4
|
@@ -51,11 +51,13 @@ function createModel({
|
|
|
51
51
|
* @summary Create method from subworkflow data
|
|
52
52
|
* @param config {Object} method configuration
|
|
53
53
|
* @param methodFactoryCls {any}
|
|
54
|
+
* @param applicationConfig {Object} application configuration
|
|
54
55
|
* @returns {{method, setSearchText}}
|
|
55
56
|
*/
|
|
56
57
|
function createMethod({
|
|
57
58
|
config,
|
|
58
|
-
methodFactoryCls
|
|
59
|
+
methodFactoryCls,
|
|
60
|
+
applicationConfig = {}
|
|
59
61
|
}) {
|
|
60
62
|
const {
|
|
61
63
|
name,
|
|
@@ -63,8 +65,10 @@ function createMethod({
|
|
|
63
65
|
config: methodConfig = {}
|
|
64
66
|
} = config;
|
|
65
67
|
const defaultConfig = _getConfigFromModelOrMethodName(name, "Method");
|
|
68
|
+
const defaultConfigForApp = new _standata.ApplicationMethodStandata().getDefaultMethodConfigForApplication(applicationConfig);
|
|
66
69
|
const method = methodFactoryCls.create({
|
|
67
70
|
...defaultConfig,
|
|
71
|
+
...defaultConfigForApp,
|
|
68
72
|
...methodConfig
|
|
69
73
|
});
|
|
70
74
|
return {
|
|
@@ -102,7 +106,8 @@ function createTopLevel({
|
|
|
102
106
|
setSearchText
|
|
103
107
|
} = createMethod({
|
|
104
108
|
config: methodConfig,
|
|
105
|
-
methodFactoryCls
|
|
109
|
+
methodFactoryCls,
|
|
110
|
+
applicationConfig: appConfig
|
|
106
111
|
});
|
|
107
112
|
return {
|
|
108
113
|
application,
|
|
@@ -238,12 +243,11 @@ function createSubworkflow({
|
|
|
238
243
|
application
|
|
239
244
|
});
|
|
240
245
|
}
|
|
246
|
+
let subworkflow = subworkflowCls.fromArguments(application, model, method, name, units, config);
|
|
241
247
|
const {
|
|
242
248
|
functions = {},
|
|
243
|
-
attributes = {}
|
|
244
|
-
...cfg
|
|
249
|
+
attributes = {}
|
|
245
250
|
} = config;
|
|
246
|
-
let subworkflow = subworkflowCls.fromArguments(application, model, method, name, units, cfg);
|
|
247
251
|
subworkflow = (0, _utils.applyConfig)({
|
|
248
252
|
obj: subworkflow,
|
|
249
253
|
config: {
|
|
@@ -40,9 +40,12 @@ class Subworkflow extends BaseSubworkflow {
|
|
|
40
40
|
application: this.application.toJSON()
|
|
41
41
|
})));
|
|
42
42
|
}
|
|
43
|
-
static generateSubworkflowId(
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
static generateSubworkflowId(name, application = null, model = null, method = null) {
|
|
44
|
+
const appName = application ? application.name || application : "";
|
|
45
|
+
const modelInfo = model ? `${(model.toJSON?.() || model).type}-${(model.toJSON?.() || model).subtype || ""}` : "";
|
|
46
|
+
const methodInfo = method ? `${(method.toJSON?.() || method).type}-${(method.toJSON?.() || method).subtype || ""}` : "";
|
|
47
|
+
const seed = [`subworkflow-${name}`, appName, modelInfo, methodInfo].filter(p => p).join("-");
|
|
48
|
+
if (this.usePredefinedIds) return _utils.Utils.uuid.getUUIDFromNamespace(seed);
|
|
46
49
|
return _utils.Utils.uuid.getUUID();
|
|
47
50
|
}
|
|
48
51
|
static get defaultConfig() {
|
|
@@ -72,9 +75,15 @@ class Subworkflow extends BaseSubworkflow {
|
|
|
72
75
|
* @summary Used to generate initial application tree, therefore omit setting application.
|
|
73
76
|
*/
|
|
74
77
|
static fromArguments(application, model, method, name, units = [], config = {}, Cls = Subworkflow) {
|
|
78
|
+
const nameForIdGeneration = config.attributes?.name || name;
|
|
79
|
+
const {
|
|
80
|
+
functions,
|
|
81
|
+
attributes,
|
|
82
|
+
...cleanConfig
|
|
83
|
+
} = config;
|
|
75
84
|
return new Cls({
|
|
76
|
-
...
|
|
77
|
-
_id: Cls.generateSubworkflowId(
|
|
85
|
+
...cleanConfig,
|
|
86
|
+
_id: Cls.generateSubworkflowId(nameForIdGeneration, application, model, method),
|
|
78
87
|
name,
|
|
79
88
|
application: application.toJSON(),
|
|
80
89
|
properties: _lodash.default.sortedUniq(_lodash.default.flatten(units.filter(x => x.resultNames).map(x => x.resultNames))),
|
package/dist/units/execution.js
CHANGED
|
@@ -205,7 +205,7 @@ class ExecutionUnit extends _base.BaseUnit {
|
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
toJSON() {
|
|
208
|
-
|
|
208
|
+
const json = this.clean({
|
|
209
209
|
...super.toJSON(),
|
|
210
210
|
executable: this.executable.toJSON(),
|
|
211
211
|
flavor: this.flavor.toJSON(),
|
|
@@ -215,6 +215,10 @@ class ExecutionUnit extends _base.BaseUnit {
|
|
|
215
215
|
// TODO: figure out the problem with storing context below
|
|
216
216
|
// context: this.storedContext,
|
|
217
217
|
});
|
|
218
|
+
|
|
219
|
+
// Remove results from executable
|
|
220
|
+
if (json.executable?.results) delete json.executable.results;
|
|
221
|
+
return json;
|
|
218
222
|
}
|
|
219
223
|
}
|
|
220
224
|
exports.ExecutionUnit = ExecutionUnit;
|
|
@@ -11,6 +11,7 @@ const RelaxationLogicMixin = superclass => class extends superclass {
|
|
|
11
11
|
if (!appName) return undefined;
|
|
12
12
|
const subworkflowStandata = new _standata.SubworkflowStandata();
|
|
13
13
|
const relaxationSubworkflow = subworkflowStandata.getRelaxationSubworkflowByApplication(appName);
|
|
14
|
+
if (!relaxationSubworkflow) return undefined;
|
|
14
15
|
return new this._Subworkflow(relaxationSubworkflow);
|
|
15
16
|
}
|
|
16
17
|
isRelaxationSubworkflow(subworkflow) {
|
|
@@ -30,7 +30,9 @@ const {
|
|
|
30
30
|
class BaseWorkflow extends (0, _mixwith.mix)(_entity.NamedDefaultableRepetitionContextAndRenderInMemoryEntity).with(_ide.ComputedEntityMixin, _relaxation.RelaxationLogicMixin) {}
|
|
31
31
|
class Workflow extends BaseWorkflow {
|
|
32
32
|
constructor(config, _Subworkflow = _subworkflow.Subworkflow, _UnitFactory = _factory.UnitFactory, _Workflow = Workflow, _MapUnit = _units.MapUnit) {
|
|
33
|
-
if (!config._id)
|
|
33
|
+
if (!config._id) {
|
|
34
|
+
config._id = Workflow.generateWorkflowId(config.name, config.properties, config.subworkflows, config.applicationName);
|
|
35
|
+
}
|
|
34
36
|
super(config);
|
|
35
37
|
this._Subworkflow = _Subworkflow;
|
|
36
38
|
this._UnitFactory = _UnitFactory;
|
|
@@ -48,9 +50,11 @@ class Workflow extends BaseWorkflow {
|
|
|
48
50
|
static get defaultConfig() {
|
|
49
51
|
return _default.default;
|
|
50
52
|
}
|
|
51
|
-
static generateWorkflowId(
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
static generateWorkflowId(name, properties = null, subworkflows = null, applicationName = null) {
|
|
54
|
+
const propsInfo = properties?.length ? properties.sort().join(",") : "";
|
|
55
|
+
const swInfo = subworkflows?.length ? subworkflows.map(sw => sw.name || "unknown").join(",") : "";
|
|
56
|
+
const seed = [`workflow-${name}`, applicationName, propsInfo, swInfo].filter(p => p).join("-");
|
|
57
|
+
if (this.usePredefinedIds) return _utils.Utils.uuid.getUUIDFromNamespace(seed);
|
|
54
58
|
return _utils.Utils.uuid.getUUID();
|
|
55
59
|
}
|
|
56
60
|
static fromSubworkflow(subworkflow, ClsConstructor = Workflow) {
|
|
@@ -58,7 +62,8 @@ class Workflow extends BaseWorkflow {
|
|
|
58
62
|
name: subworkflow.name,
|
|
59
63
|
subworkflows: [subworkflow.toJSON()],
|
|
60
64
|
units: (0, _utils2.setNextLinks)((0, _utils2.setUnitsHead)([subworkflow.getAsUnit().toJSON()])),
|
|
61
|
-
properties: subworkflow.properties
|
|
65
|
+
properties: subworkflow.properties,
|
|
66
|
+
applicationName: subworkflow.application.name
|
|
62
67
|
};
|
|
63
68
|
return new ClsConstructor(config);
|
|
64
69
|
}
|
|
@@ -243,7 +248,7 @@ class Workflow extends BaseWorkflow {
|
|
|
243
248
|
const workflowConfig = _default.default;
|
|
244
249
|
// eslint-disable-next-line no-case-declarations
|
|
245
250
|
const mapUnit = new this._MapUnit();
|
|
246
|
-
workflowConfig._id = this._Workflow.generateWorkflowId(workflowConfig.name);
|
|
251
|
+
workflowConfig._id = this._Workflow.generateWorkflowId(workflowConfig.name, workflowConfig.properties, workflowConfig.subworkflows, this.applicationName);
|
|
247
252
|
this.prop("workflows").push(workflowConfig);
|
|
248
253
|
this._workflows = this.prop("workflows").map(x => new this._Workflow(x));
|
|
249
254
|
mapUnit.setWorkflowId(workflowConfig._id);
|
|
@@ -258,7 +263,9 @@ class Workflow extends BaseWorkflow {
|
|
|
258
263
|
}
|
|
259
264
|
addMapUnit(mapUnit, mapWorkflow) {
|
|
260
265
|
const mapWorkflowConfig = mapWorkflow.toJSON();
|
|
261
|
-
if (!mapWorkflowConfig._id)
|
|
266
|
+
if (!mapWorkflowConfig._id) {
|
|
267
|
+
mapWorkflowConfig._id = this._Workflow.generateWorkflowId(mapWorkflowConfig.name, mapWorkflowConfig.properties, mapWorkflowConfig.subworkflows, mapWorkflow.applicationName || this.applicationName);
|
|
268
|
+
}
|
|
262
269
|
mapUnit.setWorkflowId(mapWorkflowConfig._id);
|
|
263
270
|
this.addUnit(mapUnit);
|
|
264
271
|
this._json.workflows.push(mapWorkflowConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mat3ra/wode",
|
|
3
|
-
"version": "2025.
|
|
3
|
+
"version": "2025.11.4-0",
|
|
4
4
|
"description": "WOrkflow DEfinitions",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "nyc --reporter=text mocha --recursive --bail --require @babel/register/lib --require tests/setup.js tests",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@mat3ra/code": "2025.7.15-0",
|
|
57
57
|
"@mat3ra/esse": "2025.7.15-0",
|
|
58
58
|
"@mat3ra/made": "2025.7.15-0",
|
|
59
|
-
"@mat3ra/standata": "
|
|
59
|
+
"@mat3ra/standata": "git+https://github.com/Exabyte-io/standata.git#f53b8da6ff0421b8397d606a6d8b0127dc68c64c",
|
|
60
60
|
"chai": "^4.3.4",
|
|
61
61
|
"eslint": "7.32.0",
|
|
62
62
|
"eslint-config-airbnb": "19.0.2",
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
MethodFactory,
|
|
6
6
|
ModelFactory,
|
|
7
7
|
} from "@mat3ra/mode";
|
|
8
|
-
import { workflowSubforkflowMapByApplication } from "@mat3ra/standata";
|
|
8
|
+
import { ApplicationMethodStandata, workflowSubforkflowMapByApplication } from "@mat3ra/standata";
|
|
9
9
|
import _ from "lodash";
|
|
10
10
|
|
|
11
11
|
import { UnitFactory } from "../units";
|
|
@@ -40,12 +40,19 @@ function createModel({ config, modelFactoryCls }) {
|
|
|
40
40
|
* @summary Create method from subworkflow data
|
|
41
41
|
* @param config {Object} method configuration
|
|
42
42
|
* @param methodFactoryCls {any}
|
|
43
|
+
* @param applicationConfig {Object} application configuration
|
|
43
44
|
* @returns {{method, setSearchText}}
|
|
44
45
|
*/
|
|
45
|
-
function createMethod({ config, methodFactoryCls }) {
|
|
46
|
+
function createMethod({ config, methodFactoryCls, applicationConfig = {} }) {
|
|
46
47
|
const { name, setSearchText = null, config: methodConfig = {} } = config;
|
|
47
48
|
const defaultConfig = _getConfigFromModelOrMethodName(name, "Method");
|
|
48
|
-
const
|
|
49
|
+
const defaultConfigForApp =
|
|
50
|
+
new ApplicationMethodStandata().getDefaultMethodConfigForApplication(applicationConfig);
|
|
51
|
+
const method = methodFactoryCls.create({
|
|
52
|
+
...defaultConfig,
|
|
53
|
+
...defaultConfigForApp,
|
|
54
|
+
...methodConfig,
|
|
55
|
+
});
|
|
49
56
|
return { method, setSearchText };
|
|
50
57
|
}
|
|
51
58
|
|
|
@@ -61,7 +68,11 @@ function createTopLevel({ subworkflowData, modelFactoryCls, methodFactoryCls, Ap
|
|
|
61
68
|
const { application: appConfig, model: modelConfig, method: methodConfig } = subworkflowData;
|
|
62
69
|
const application = AppRegistry.createApplication(appConfig);
|
|
63
70
|
const model = createModel({ config: modelConfig, modelFactoryCls });
|
|
64
|
-
const { method, setSearchText } = createMethod({
|
|
71
|
+
const { method, setSearchText } = createMethod({
|
|
72
|
+
config: methodConfig,
|
|
73
|
+
methodFactoryCls,
|
|
74
|
+
applicationConfig: appConfig,
|
|
75
|
+
});
|
|
65
76
|
return {
|
|
66
77
|
application,
|
|
67
78
|
model,
|
|
@@ -168,8 +179,8 @@ function createSubworkflow({
|
|
|
168
179
|
});
|
|
169
180
|
}
|
|
170
181
|
|
|
171
|
-
|
|
172
|
-
|
|
182
|
+
let subworkflow = subworkflowCls.fromArguments(application, model, method, name, units, config);
|
|
183
|
+
const { functions = {}, attributes = {} } = config;
|
|
173
184
|
subworkflow = applyConfig({ obj: subworkflow, config: { functions, attributes } });
|
|
174
185
|
if (setSearchText) subworkflow.model.method.setSearchText(setSearchText);
|
|
175
186
|
return subworkflow;
|
|
@@ -50,9 +50,18 @@ export class Subworkflow extends BaseSubworkflow {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
static generateSubworkflowId(
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
static generateSubworkflowId(name, application = null, model = null, method = null) {
|
|
54
|
+
const appName = application ? application.name || application : "";
|
|
55
|
+
const modelInfo = model
|
|
56
|
+
? `${(model.toJSON?.() || model).type}-${(model.toJSON?.() || model).subtype || ""}`
|
|
57
|
+
: "";
|
|
58
|
+
const methodInfo = method
|
|
59
|
+
? `${(method.toJSON?.() || method).type}-${(method.toJSON?.() || method).subtype || ""}`
|
|
60
|
+
: "";
|
|
61
|
+
const seed = [`subworkflow-${name}`, appName, modelInfo, methodInfo]
|
|
62
|
+
.filter((p) => p)
|
|
63
|
+
.join("-");
|
|
64
|
+
if (this.usePredefinedIds) return Utils.uuid.getUUIDFromNamespace(seed);
|
|
56
65
|
return Utils.uuid.getUUID();
|
|
57
66
|
}
|
|
58
67
|
|
|
@@ -91,9 +100,12 @@ export class Subworkflow extends BaseSubworkflow {
|
|
|
91
100
|
config = {},
|
|
92
101
|
Cls = Subworkflow,
|
|
93
102
|
) {
|
|
103
|
+
const nameForIdGeneration = config.attributes?.name || name;
|
|
104
|
+
const { functions, attributes, ...cleanConfig } = config;
|
|
105
|
+
|
|
94
106
|
return new Cls({
|
|
95
|
-
...
|
|
96
|
-
_id: Cls.generateSubworkflowId(
|
|
107
|
+
...cleanConfig,
|
|
108
|
+
_id: Cls.generateSubworkflowId(nameForIdGeneration, application, model, method),
|
|
97
109
|
name,
|
|
98
110
|
application: application.toJSON(),
|
|
99
111
|
properties: lodash.sortedUniq(
|
package/src/units/execution.js
CHANGED
|
@@ -249,7 +249,7 @@ export class ExecutionUnit extends BaseUnit {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
toJSON() {
|
|
252
|
-
|
|
252
|
+
const json = this.clean({
|
|
253
253
|
...super.toJSON(),
|
|
254
254
|
executable: this.executable.toJSON(),
|
|
255
255
|
flavor: this.flavor.toJSON(),
|
|
@@ -259,5 +259,10 @@ export class ExecutionUnit extends BaseUnit {
|
|
|
259
259
|
// TODO: figure out the problem with storing context below
|
|
260
260
|
// context: this.storedContext,
|
|
261
261
|
});
|
|
262
|
+
|
|
263
|
+
// Remove results from executable
|
|
264
|
+
if (json.executable?.results) delete json.executable.results;
|
|
265
|
+
|
|
266
|
+
return json;
|
|
262
267
|
}
|
|
263
268
|
}
|
|
@@ -8,6 +8,7 @@ export const RelaxationLogicMixin = (superclass) =>
|
|
|
8
8
|
const subworkflowStandata = new SubworkflowStandata();
|
|
9
9
|
const relaxationSubworkflow =
|
|
10
10
|
subworkflowStandata.getRelaxationSubworkflowByApplication(appName);
|
|
11
|
+
if (!relaxationSubworkflow) return undefined;
|
|
11
12
|
return new this._Subworkflow(relaxationSubworkflow);
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -38,10 +38,15 @@ export class Workflow extends BaseWorkflow {
|
|
|
38
38
|
_Workflow = Workflow,
|
|
39
39
|
_MapUnit = MapUnit,
|
|
40
40
|
) {
|
|
41
|
-
if (!config._id)
|
|
42
|
-
|
|
41
|
+
if (!config._id) {
|
|
42
|
+
config._id = Workflow.generateWorkflowId(
|
|
43
|
+
config.name,
|
|
44
|
+
config.properties,
|
|
45
|
+
config.subworkflows,
|
|
46
|
+
config.applicationName,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
43
49
|
super(config);
|
|
44
|
-
|
|
45
50
|
this._Subworkflow = _Subworkflow;
|
|
46
51
|
this._UnitFactory = _UnitFactory;
|
|
47
52
|
this._Workflow = _Workflow;
|
|
@@ -61,9 +66,20 @@ export class Workflow extends BaseWorkflow {
|
|
|
61
66
|
return defaultWorkflowConfig;
|
|
62
67
|
}
|
|
63
68
|
|
|
64
|
-
static generateWorkflowId(
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
static generateWorkflowId(
|
|
70
|
+
name,
|
|
71
|
+
properties = null,
|
|
72
|
+
subworkflows = null,
|
|
73
|
+
applicationName = null,
|
|
74
|
+
) {
|
|
75
|
+
const propsInfo = properties?.length ? properties.sort().join(",") : "";
|
|
76
|
+
const swInfo = subworkflows?.length
|
|
77
|
+
? subworkflows.map((sw) => sw.name || "unknown").join(",")
|
|
78
|
+
: "";
|
|
79
|
+
const seed = [`workflow-${name}`, applicationName, propsInfo, swInfo]
|
|
80
|
+
.filter((p) => p)
|
|
81
|
+
.join("-");
|
|
82
|
+
if (this.usePredefinedIds) return Utils.uuid.getUUIDFromNamespace(seed);
|
|
67
83
|
return Utils.uuid.getUUID();
|
|
68
84
|
}
|
|
69
85
|
|
|
@@ -73,6 +89,7 @@ export class Workflow extends BaseWorkflow {
|
|
|
73
89
|
subworkflows: [subworkflow.toJSON()],
|
|
74
90
|
units: setNextLinks(setUnitsHead([subworkflow.getAsUnit().toJSON()])),
|
|
75
91
|
properties: subworkflow.properties,
|
|
92
|
+
applicationName: subworkflow.application.name,
|
|
76
93
|
};
|
|
77
94
|
return new ClsConstructor(config);
|
|
78
95
|
}
|
|
@@ -294,7 +311,12 @@ export class Workflow extends BaseWorkflow {
|
|
|
294
311
|
const workflowConfig = defaultWorkflowConfig;
|
|
295
312
|
// eslint-disable-next-line no-case-declarations
|
|
296
313
|
const mapUnit = new this._MapUnit();
|
|
297
|
-
workflowConfig._id = this._Workflow.generateWorkflowId(
|
|
314
|
+
workflowConfig._id = this._Workflow.generateWorkflowId(
|
|
315
|
+
workflowConfig.name,
|
|
316
|
+
workflowConfig.properties,
|
|
317
|
+
workflowConfig.subworkflows,
|
|
318
|
+
this.applicationName,
|
|
319
|
+
);
|
|
298
320
|
this.prop("workflows").push(workflowConfig);
|
|
299
321
|
this._workflows = this.prop("workflows").map((x) => new this._Workflow(x));
|
|
300
322
|
mapUnit.setWorkflowId(workflowConfig._id);
|
|
@@ -310,8 +332,14 @@ export class Workflow extends BaseWorkflow {
|
|
|
310
332
|
|
|
311
333
|
addMapUnit(mapUnit, mapWorkflow) {
|
|
312
334
|
const mapWorkflowConfig = mapWorkflow.toJSON();
|
|
313
|
-
if (!mapWorkflowConfig._id)
|
|
314
|
-
mapWorkflowConfig._id = this._Workflow.generateWorkflowId(
|
|
335
|
+
if (!mapWorkflowConfig._id) {
|
|
336
|
+
mapWorkflowConfig._id = this._Workflow.generateWorkflowId(
|
|
337
|
+
mapWorkflowConfig.name,
|
|
338
|
+
mapWorkflowConfig.properties,
|
|
339
|
+
mapWorkflowConfig.subworkflows,
|
|
340
|
+
mapWorkflow.applicationName || this.applicationName,
|
|
341
|
+
);
|
|
342
|
+
}
|
|
315
343
|
mapUnit.setWorkflowId(mapWorkflowConfig._id);
|
|
316
344
|
this.addUnit(mapUnit);
|
|
317
345
|
this._json.workflows.push(mapWorkflowConfig);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
application:
|
|
2
|
-
name: deepmd
|
|
3
|
-
version: "2.0.2"
|
|
4
|
-
method:
|
|
5
|
-
name: UnknownMethod
|
|
6
|
-
model:
|
|
7
|
-
name: UnknownModel
|
|
8
|
-
name: DeePMD
|
|
9
|
-
units:
|
|
10
|
-
- config:
|
|
11
|
-
execName: python
|
|
12
|
-
flavorName: espresso_cp_to_deepmd
|
|
13
|
-
name: espresso_cp_to_deepmd
|
|
14
|
-
functions:
|
|
15
|
-
head: true
|
|
16
|
-
type: executionBuilder
|
|
17
|
-
- config:
|
|
18
|
-
execName: dp
|
|
19
|
-
flavorName: dp_train_se_e2_r
|
|
20
|
-
name: dp_train_se_e2_r
|
|
21
|
-
type: executionBuilder
|
|
22
|
-
- config:
|
|
23
|
-
execName: python
|
|
24
|
-
flavorName: espresso_to_lammps_structure
|
|
25
|
-
name: espresso_to_lammps_structure
|
|
26
|
-
type: executionBuilder
|
|
27
|
-
- config:
|
|
28
|
-
execName: lmp
|
|
29
|
-
flavorName: lammps_md
|
|
30
|
-
name: lammps_md
|
|
31
|
-
type: executionBuilder
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
application:
|
|
2
|
-
name: espresso
|
|
3
|
-
version: "7.2"
|
|
4
|
-
method:
|
|
5
|
-
name: PseudopotentialMethod
|
|
6
|
-
model:
|
|
7
|
-
name: DFTModel
|
|
8
|
-
name: CP-MD
|
|
9
|
-
units:
|
|
10
|
-
- config:
|
|
11
|
-
execName: cp.x
|
|
12
|
-
flavorName: cp
|
|
13
|
-
name: cp
|
|
14
|
-
functions:
|
|
15
|
-
head: true
|
|
16
|
-
type: executionBuilder
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Note: this subworkflow is assumed to be used as part of the valence band offset workflow
|
|
2
|
-
# and is this NOT self-sufficient!
|
|
3
|
-
# Furthermore, this subworkflow expects the following variable(s) to exist in the global context:
|
|
4
|
-
# array_from_context
|
|
5
|
-
application:
|
|
6
|
-
name: python
|
|
7
|
-
version: 3.10.13
|
|
8
|
-
method:
|
|
9
|
-
name: UnknownMethod
|
|
10
|
-
model:
|
|
11
|
-
name: UnknownModel
|
|
12
|
-
name: Find ESP Value
|
|
13
|
-
units:
|
|
14
|
-
- config:
|
|
15
|
-
name: Find Extrema
|
|
16
|
-
execName: python
|
|
17
|
-
flavorName: generic:processing:find_extrema:scipy
|
|
18
|
-
flowchartId: python-find-extrema
|
|
19
|
-
type: executionBuilder
|
|
20
|
-
- config:
|
|
21
|
-
name: Set Average ESP Value
|
|
22
|
-
operand: AVG_ESP
|
|
23
|
-
value: "json.loads(STDOUT)['minima']"
|
|
24
|
-
input:
|
|
25
|
-
- name: STDOUT
|
|
26
|
-
scope: python-find-extrema
|
|
27
|
-
type: assignment
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
config:
|
|
2
|
-
isMultiMaterial: true
|
|
3
|
-
application:
|
|
4
|
-
name: espresso
|
|
5
|
-
version: "6.3"
|
|
6
|
-
method:
|
|
7
|
-
name: PseudopotentialMethod
|
|
8
|
-
model:
|
|
9
|
-
name: DFTModel
|
|
10
|
-
name: Band Structure + average ESP
|
|
11
|
-
units:
|
|
12
|
-
- config:
|
|
13
|
-
name: Set Material Index
|
|
14
|
-
operand: MATERIAL_INDEX
|
|
15
|
-
value: 0
|
|
16
|
-
type: assignment
|
|
17
|
-
- config:
|
|
18
|
-
execName: pw.x
|
|
19
|
-
flavorName: pw_scf
|
|
20
|
-
name: pw_scf
|
|
21
|
-
type: executionBuilder
|
|
22
|
-
- config:
|
|
23
|
-
execName: pw.x
|
|
24
|
-
flavorName: pw_bands
|
|
25
|
-
name: pw_bands
|
|
26
|
-
flowchartId: pw-bands-calculate-band-gap
|
|
27
|
-
type: executionBuilder
|
|
28
|
-
attributes:
|
|
29
|
-
results:
|
|
30
|
-
- name: band_gaps
|
|
31
|
-
- config:
|
|
32
|
-
name: Select indirect band gap
|
|
33
|
-
operand: BAND_GAP_INDIRECT
|
|
34
|
-
value: "[bandgap for bandgap in band_gaps['values'] if bandgap['type'] == 'indirect'][0]"
|
|
35
|
-
input:
|
|
36
|
-
- name: band_gaps
|
|
37
|
-
scope: pw-bands-calculate-band-gap
|
|
38
|
-
type: assignment
|
|
39
|
-
- config:
|
|
40
|
-
name: Set Valence Band Maximum
|
|
41
|
-
operand: VBM
|
|
42
|
-
value: "BAND_GAP_INDIRECT['eigenvalueValence']"
|
|
43
|
-
type: assignment
|
|
44
|
-
- config:
|
|
45
|
-
execName: bands.x
|
|
46
|
-
flavorName: bands
|
|
47
|
-
name: bands
|
|
48
|
-
type: executionBuilder
|
|
49
|
-
- config:
|
|
50
|
-
execName: pp.x
|
|
51
|
-
flavorName: pp_electrostatic_potential
|
|
52
|
-
name: Electrostatic Potential (ESP)
|
|
53
|
-
type: executionBuilder
|
|
54
|
-
- config:
|
|
55
|
-
execName: average.x
|
|
56
|
-
flavorName: average_potential
|
|
57
|
-
name: average ESP
|
|
58
|
-
flowchartId: average-electrostatic-potential
|
|
59
|
-
type: executionBuilder
|
|
60
|
-
- config:
|
|
61
|
-
name: Set Macroscopically Averaged ESP Data
|
|
62
|
-
operand: array_from_context
|
|
63
|
-
value: "average_potential_profile['yDataSeries'][1]"
|
|
64
|
-
input:
|
|
65
|
-
- name: average_potential_profile
|
|
66
|
-
scope: average-electrostatic-potential
|
|
67
|
-
type: assignment
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
application:
|
|
2
|
-
name: espresso
|
|
3
|
-
version: "6.3"
|
|
4
|
-
method:
|
|
5
|
-
name: PseudopotentialMethod
|
|
6
|
-
model:
|
|
7
|
-
name: DFTModel
|
|
8
|
-
name: Band Gap
|
|
9
|
-
units:
|
|
10
|
-
- config:
|
|
11
|
-
execName: pw.x
|
|
12
|
-
flavorName: pw_scf
|
|
13
|
-
name: pw_scf
|
|
14
|
-
functions:
|
|
15
|
-
head: true
|
|
16
|
-
type: executionBuilder
|
|
17
|
-
- config:
|
|
18
|
-
execName: pw.x
|
|
19
|
-
flavorName: pw_nscf
|
|
20
|
-
name: pw_nscf
|
|
21
|
-
type: executionBuilder
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: HSE Band Gap
|
|
2
|
-
application:
|
|
3
|
-
name: espresso
|
|
4
|
-
version: "6.3"
|
|
5
|
-
model:
|
|
6
|
-
name: DFTModel
|
|
7
|
-
config:
|
|
8
|
-
type: dft
|
|
9
|
-
subtype: hybrid
|
|
10
|
-
functional:
|
|
11
|
-
name: hse06
|
|
12
|
-
slug: hse06
|
|
13
|
-
method:
|
|
14
|
-
name: PseudopotentialMethod
|
|
15
|
-
config:
|
|
16
|
-
type: pseudopotential
|
|
17
|
-
subtype: us
|
|
18
|
-
units:
|
|
19
|
-
- config:
|
|
20
|
-
execName: pw.x
|
|
21
|
-
flavorName: pw_scf_hse
|
|
22
|
-
name: pw_scf_hse
|
|
23
|
-
functions:
|
|
24
|
-
head: true
|
|
25
|
-
type: executionBuilder
|
|
26
|
-
- config:
|
|
27
|
-
execName: projwfc.x
|
|
28
|
-
flavorName: projwfc
|
|
29
|
-
name: projwfc
|
|
30
|
-
type: executionBuilder
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
application:
|
|
2
|
-
name: espresso
|
|
3
|
-
version: "6.3"
|
|
4
|
-
method:
|
|
5
|
-
name: PseudopotentialMethod
|
|
6
|
-
model:
|
|
7
|
-
name: DFTModel
|
|
8
|
-
name: Band Structure
|
|
9
|
-
units:
|
|
10
|
-
- config:
|
|
11
|
-
execName: pw.x
|
|
12
|
-
flavorName: pw_scf
|
|
13
|
-
name: pw_scf
|
|
14
|
-
functions:
|
|
15
|
-
head: true
|
|
16
|
-
type: executionBuilder
|
|
17
|
-
- config:
|
|
18
|
-
execName: pw.x
|
|
19
|
-
flavorName: pw_bands
|
|
20
|
-
name: pw_bands
|
|
21
|
-
type: executionBuilder
|
|
22
|
-
- config:
|
|
23
|
-
execName: bands.x
|
|
24
|
-
flavorName: bands
|
|
25
|
-
name: bands
|
|
26
|
-
type: executionBuilder
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
application:
|
|
2
|
-
name: espresso
|
|
3
|
-
version: "6.3"
|
|
4
|
-
method:
|
|
5
|
-
name: PseudopotentialMethod
|
|
6
|
-
model:
|
|
7
|
-
name: DFTModel
|
|
8
|
-
name: Band Structure + Density of States
|
|
9
|
-
units:
|
|
10
|
-
- config:
|
|
11
|
-
execName: pw.x
|
|
12
|
-
flavorName: pw_scf
|
|
13
|
-
name: pw_scf
|
|
14
|
-
type: executionBuilder
|
|
15
|
-
- config:
|
|
16
|
-
execName: pw.x
|
|
17
|
-
flavorName: pw_bands
|
|
18
|
-
name: pw_bands
|
|
19
|
-
type: executionBuilder
|
|
20
|
-
- config:
|
|
21
|
-
execName: bands.x
|
|
22
|
-
flavorName: bands
|
|
23
|
-
name: bands
|
|
24
|
-
type: executionBuilder
|
|
25
|
-
- config:
|
|
26
|
-
execName: pw.x
|
|
27
|
-
flavorName: pw_nscf
|
|
28
|
-
name: pw_nscf
|
|
29
|
-
type: executionBuilder
|
|
30
|
-
- config:
|
|
31
|
-
execName: projwfc.x
|
|
32
|
-
flavorName: projwfc
|
|
33
|
-
name: projwfc
|
|
34
|
-
type: executionBuilder
|