@mat3ra/wode 2026.4.9-0 → 2026.5.29-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/.babelrc +1 -1
- package/dist/js/Subworkflow.d.ts +714 -0
- package/dist/js/Subworkflow.js +397 -0
- package/dist/js/Workflow.d.ts +82 -0
- package/dist/js/Workflow.js +286 -0
- package/dist/js/WorkflowDesignerMaterial.d.ts +21 -0
- package/dist/js/WorkflowDesignerMaterial.js +26 -0
- package/dist/js/context/mixins/ApplicationContextMixin.d.ts +10 -0
- package/dist/js/context/mixins/ApplicationContextMixin.js +10 -17
- package/dist/js/context/mixins/MaterialContextMixin.d.ts +18 -0
- package/dist/js/context/mixins/MaterialContextMixin.js +14 -38
- package/dist/js/context/mixins/MaterialsContextMixin.d.ts +10 -0
- package/dist/js/context/mixins/MaterialsContextMixin.js +11 -17
- package/dist/js/context/mixins/MaterialsSetContextMixin.d.ts +14 -0
- package/dist/js/context/mixins/MaterialsSetContextMixin.js +21 -23
- package/dist/js/context/providers/BoundaryConditionsFormDataManager.d.ts +30 -0
- package/dist/js/context/providers/BoundaryConditionsFormDataManager.js +62 -0
- package/dist/js/context/providers/CollinearMagnetizationDataManager.d.ts +42 -0
- package/dist/js/context/providers/CollinearMagnetizationDataManager.js +101 -0
- package/dist/js/context/providers/Hubbard/HubbardContextManagerLegacy.d.ts +29 -0
- package/dist/js/context/providers/Hubbard/HubbardContextManagerLegacy.js +69 -0
- package/dist/js/context/providers/Hubbard/HubbardContextProvider.d.ts +20 -0
- package/dist/js/context/providers/Hubbard/HubbardContextProvider.js +47 -0
- package/dist/js/context/providers/Hubbard/HubbardJContextManager.d.ts +22 -0
- package/dist/js/context/providers/Hubbard/HubbardJContextManager.js +61 -0
- package/dist/js/context/providers/Hubbard/HubbardUContextManager.d.ts +22 -0
- package/dist/js/context/providers/Hubbard/HubbardUContextManager.js +57 -0
- package/dist/js/context/providers/Hubbard/HubbardVContextManager.d.ts +22 -0
- package/dist/js/context/providers/Hubbard/HubbardVContextManager.js +79 -0
- package/dist/js/context/providers/IonDynamicsDataManager.d.ts +27 -0
- package/dist/js/context/providers/IonDynamicsDataManager.js +48 -0
- package/dist/js/context/providers/MLSettingsDataManager.d.ts +24 -0
- package/dist/js/context/providers/MLSettingsDataManager.js +42 -0
- package/dist/js/context/providers/MLTrainTestSplitDataManager.d.ts +23 -0
- package/dist/js/context/providers/MLTrainTestSplitDataManager.js +40 -0
- package/dist/js/context/providers/NEBFormDataManager.d.ts +23 -0
- package/dist/js/context/providers/NEBFormDataManager.js +39 -0
- package/dist/js/context/providers/NonCollinearMagnetizationDataManager.d.ts +78 -0
- package/dist/js/context/providers/NonCollinearMagnetizationDataManager.js +181 -0
- package/dist/js/context/providers/PlanewaveCutoffDataManager.d.ts +26 -0
- package/dist/js/context/providers/PlanewaveCutoffDataManager.js +69 -0
- package/dist/js/context/providers/PointsGrid/IGridFormDataManager.d.ts +13 -0
- package/dist/js/context/providers/PointsGrid/IGridFormDataManager.js +23 -0
- package/dist/js/context/providers/PointsGrid/KGridFormDataManager.d.ts +15 -0
- package/dist/js/context/providers/PointsGrid/KGridFormDataManager.js +30 -0
- package/dist/js/context/providers/PointsGrid/PointsGridFormDataProvider.d.ts +171 -0
- package/dist/js/context/providers/PointsGrid/PointsGridFormDataProvider.js +270 -0
- package/dist/js/context/providers/PointsGrid/QGridFormDataManager.d.ts +13 -0
- package/dist/js/context/providers/PointsGrid/QGridFormDataManager.js +23 -0
- package/dist/js/context/providers/PointsPath/ExplicitKPath2PIBAFormDataManager.d.ts +10 -0
- package/dist/js/context/providers/PointsPath/ExplicitKPath2PIBAFormDataManager.js +19 -0
- package/dist/js/context/providers/PointsPath/ExplicitKPathFormDataManager.d.ts +9 -0
- package/dist/js/context/providers/PointsPath/ExplicitKPathFormDataManager.js +18 -0
- package/dist/js/context/providers/PointsPath/IPathFormDataManager.d.ts +8 -0
- package/dist/js/context/providers/PointsPath/IPathFormDataManager.js +17 -0
- package/dist/js/context/providers/PointsPath/KPathFormDataManager.d.ts +8 -0
- package/dist/js/context/providers/PointsPath/KPathFormDataManager.js +17 -0
- package/dist/js/context/providers/PointsPath/PointsPathFormDataProvider.d.ts +40 -0
- package/dist/js/context/providers/PointsPath/PointsPathFormDataProvider.js +125 -0
- package/dist/js/context/providers/PointsPath/QPathFormDataManager.d.ts +8 -0
- package/dist/js/context/providers/PointsPath/QPathFormDataManager.js +17 -0
- package/dist/js/context/providers/base/ContextProvider.d.ts +75 -0
- package/dist/js/context/providers/base/ContextProvider.js +87 -0
- package/dist/js/context/providers/base/JSONSchemaDataProvider.d.ts +16 -0
- package/dist/js/context/providers/base/JSONSchemaDataProvider.js +17 -0
- package/dist/js/context/providers/base/JSONSchemaFormDataProvider.d.ts +19 -0
- package/dist/js/context/providers/base/JSONSchemaFormDataProvider.js +32 -0
- package/dist/js/context/providers/by_application/espresso/QENEBInputDataManager.d.ts +26 -0
- package/dist/js/context/providers/by_application/espresso/QENEBInputDataManager.js +54 -0
- package/dist/js/context/providers/by_application/espresso/QEPWXInputDataManager.d.ts +78 -0
- package/dist/js/context/providers/by_application/espresso/QEPWXInputDataManager.js +104 -0
- package/dist/js/context/providers/by_application/nwchem/NWChemInputDataManager.d.ts +36 -0
- package/dist/js/context/providers/by_application/nwchem/NWChemInputDataManager.js +58 -0
- package/dist/js/context/providers/by_application/vasp/VASPInputDataManager.d.ts +36 -0
- package/dist/js/context/providers/by_application/vasp/VASPInputDataManager.js +56 -0
- package/dist/js/context/providers/by_application/vasp/VASPNEBInputDataManager.d.ts +30 -0
- package/dist/js/context/providers/by_application/vasp/VASPNEBInputDataManager.js +50 -0
- package/dist/js/context/providers/index.d.ts +92 -0
- package/dist/js/context/providers/index.js +107 -0
- package/dist/js/context/providers/settings.d.ts +7 -0
- package/dist/js/context/providers/settings.js +11 -33
- package/dist/js/convergence/ConvergenceParameter.d.ts +26 -0
- package/dist/js/convergence/ConvergenceParameter.js +13 -0
- package/dist/js/convergence/NonUniformKGridConvergence.d.ts +12 -0
- package/dist/js/convergence/NonUniformKGridConvergence.js +31 -0
- package/dist/js/convergence/UniformKGridConvergence.d.ts +8 -0
- package/dist/js/convergence/UniformKGridConvergence.js +22 -0
- package/dist/js/convergence/factory.d.ts +8 -0
- package/dist/js/convergence/factory.js +18 -0
- package/dist/js/enums.d.ts +62 -0
- package/dist/js/enums.js +66 -61
- package/dist/js/generated/AssertionUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/AssertionUnitSchemaMixin.js +27 -0
- package/dist/js/generated/AssignmentUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/AssignmentUnitSchemaMixin.js +33 -0
- package/dist/js/generated/BaseUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/BaseUnitSchemaMixin.js +57 -0
- package/dist/js/generated/ConditionUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/ConditionUnitSchemaMixin.js +51 -0
- package/dist/js/generated/ExecutionUnitInputSchemaMixin.d.ts +5 -0
- package/dist/js/generated/ExecutionUnitInputSchemaMixin.js +27 -0
- package/dist/js/generated/ExecutionUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/ExecutionUnitSchemaMixin.js +45 -0
- package/dist/js/generated/IOUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/IOUnitSchemaMixin.js +33 -0
- package/dist/js/generated/MapUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/MapUnitSchemaMixin.js +27 -0
- package/dist/js/generated/ReduceUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/ReduceUnitSchemaMixin.js +27 -0
- package/dist/js/generated/StatusSchemaMixin.d.ts +5 -0
- package/dist/js/generated/StatusSchemaMixin.js +21 -0
- package/dist/js/generated/SubworkflowSchemaMixin.d.ts +5 -0
- package/dist/js/generated/SubworkflowSchemaMixin.js +51 -0
- package/dist/js/generated/SubworkflowUnitSchemaMixin.d.ts +5 -0
- package/dist/js/generated/SubworkflowUnitSchemaMixin.js +15 -0
- package/dist/js/generated/WorkflowSchemaMixin.d.ts +5 -0
- package/dist/js/generated/WorkflowSchemaMixin.js +51 -0
- package/dist/js/index.d.ts +13 -0
- package/dist/js/index.js +66 -176
- package/dist/js/units/AssertionUnit.d.ts +20 -0
- package/dist/js/units/AssertionUnit.js +33 -0
- package/dist/js/units/AssignmentUnit.d.ts +17 -0
- package/dist/js/units/AssignmentUnit.js +35 -0
- package/dist/js/units/BaseUnit.d.ts +39 -0
- package/dist/js/units/BaseUnit.js +70 -0
- package/dist/js/units/ConditionUnit.d.ts +17 -0
- package/dist/js/units/ConditionUnit.js +37 -0
- package/dist/js/units/ExecutionUnit.d.ts +115 -0
- package/dist/js/units/ExecutionUnit.js +181 -0
- package/dist/js/units/ExecutionUnitInput.d.ts +22 -0
- package/dist/js/units/ExecutionUnitInput.js +47 -0
- package/dist/js/units/IOUnit.d.ts +16 -0
- package/dist/js/units/IOUnit.js +31 -0
- package/dist/js/units/MapUnit.d.ts +34 -0
- package/dist/js/units/MapUnit.js +46 -0
- package/dist/js/units/ReduceUnit.d.ts +16 -0
- package/dist/js/units/ReduceUnit.js +30 -0
- package/dist/js/units/SubworkflowUnit.d.ts +16 -0
- package/dist/js/units/SubworkflowUnit.js +28 -0
- package/dist/js/units/factory.d.ts +31 -0
- package/dist/js/units/factory.js +65 -47
- package/dist/js/units/index.d.ts +14 -0
- package/dist/js/units/index.js +25 -81
- package/dist/js/units/mixins/RuntimeItemsUILogicMixin.d.ts +26 -0
- package/dist/js/units/mixins/RuntimeItemsUILogicMixin.js +50 -0
- package/dist/js/utils/baseUnits.d.ts +2 -0
- package/dist/js/utils/baseUnits.js +11 -0
- package/dist/js/utils/index.d.ts +3 -0
- package/dist/js/utils/index.js +39 -0
- package/dist/js/utils/subworkflow.d.ts +2 -0
- package/dist/js/utils/subworkflow.js +29 -0
- package/dist/js/utils/underscoreStringSlugify.d.ts +6 -0
- package/dist/js/utils/underscoreStringSlugify.js +32 -0
- package/dist/js/utils/units.d.ts +4 -0
- package/dist/js/utils/units.js +16 -0
- package/dist/js/utils/workflow.d.ts +9 -0
- package/dist/js/utils/workflow.js +67 -0
- package/dist/js/utils.js +2 -7
- package/dist/js/workflows/default.d.ts +3 -0
- package/dist/js/workflows/default.js +43 -39
- package/dist/js/workflows/workflow.d.ts +4404 -0
- package/dist/js/workflows/workflow.js +310 -306
- package/package.json +56 -44
- package/src/js/Subworkflow.ts +532 -0
- package/src/js/Workflow.ts +390 -0
- package/src/js/context/mixins/ApplicationContextMixin.ts +21 -0
- package/src/js/context/mixins/MaterialContextMixin.ts +35 -0
- package/src/js/context/mixins/MaterialsContextMixin.ts +24 -0
- package/src/js/context/mixins/MaterialsSetContextMixin.ts +42 -0
- package/src/js/context/providers/BoundaryConditionsFormDataManager.ts +88 -0
- package/src/js/context/providers/CollinearMagnetizationDataManager.ts +140 -0
- package/src/js/context/providers/Hubbard/HubbardContextManagerLegacy.ts +93 -0
- package/src/js/context/providers/Hubbard/HubbardContextProvider.ts +85 -0
- package/src/js/context/providers/Hubbard/HubbardJContextManager.ts +82 -0
- package/src/js/context/providers/Hubbard/HubbardUContextManager.ts +78 -0
- package/src/js/context/providers/Hubbard/HubbardVContextManager.ts +100 -0
- package/src/js/context/providers/IonDynamicsDataManager.ts +64 -0
- package/src/js/context/providers/MLSettingsDataManager.ts +61 -0
- package/src/js/context/providers/MLTrainTestSplitDataManager.ts +59 -0
- package/src/js/context/providers/NEBFormDataManager.ts +57 -0
- package/src/js/context/providers/NonCollinearMagnetizationDataManager.ts +229 -0
- package/src/js/context/providers/PlanewaveCutoffDataManager.ts +110 -0
- package/src/js/context/providers/PointsGrid/IGridFormDataManager.ts +36 -0
- package/src/js/context/providers/PointsGrid/KGridFormDataManager.ts +46 -0
- package/src/js/context/providers/PointsGrid/PointsGridFormDataProvider.ts +371 -0
- package/src/js/context/providers/PointsGrid/QGridFormDataManager.ts +36 -0
- package/src/js/context/providers/PointsPath/ExplicitKPath2PIBAFormDataManager.ts +26 -0
- package/src/js/context/providers/PointsPath/ExplicitKPathFormDataManager.ts +24 -0
- package/src/js/context/providers/PointsPath/IPathFormDataManager.ts +22 -0
- package/src/js/context/providers/PointsPath/KPathFormDataManager.ts +22 -0
- package/src/js/context/providers/PointsPath/PointsPathFormDataProvider.ts +192 -0
- package/src/js/context/providers/PointsPath/QPathFormDataManager.ts +22 -0
- package/src/js/context/providers/base/ContextProvider.ts +150 -0
- package/src/js/context/providers/base/JSONSchemaDataProvider.ts +31 -0
- package/src/js/context/providers/base/JSONSchemaFormDataProvider.ts +38 -0
- package/src/js/context/providers/by_application/espresso/QENEBInputDataManager.ts +107 -0
- package/src/js/context/providers/by_application/espresso/QEPWXInputDataManager.ts +178 -0
- package/src/js/context/providers/by_application/nwchem/NWChemInputDataManager.ts +93 -0
- package/src/js/context/providers/by_application/vasp/VASPInputDataManager.ts +89 -0
- package/src/js/context/providers/by_application/vasp/VASPNEBInputDataManager.ts +92 -0
- package/src/js/context/providers/index.ts +155 -0
- package/src/js/context/providers/settings.ts +13 -0
- package/src/js/convergence/ConvergenceParameter.ts +37 -0
- package/src/js/convergence/NonUniformKGridConvergence.ts +38 -0
- package/src/js/convergence/UniformKGridConvergence.ts +26 -0
- package/src/js/convergence/factory.ts +18 -0
- package/src/js/{enums.js → enums.ts} +27 -22
- package/src/js/generated/AssertionUnitSchemaMixin.ts +34 -0
- package/src/js/generated/AssignmentUnitSchemaMixin.ts +40 -0
- package/src/js/generated/BaseUnitSchemaMixin.ts +64 -0
- package/src/js/generated/ConditionUnitSchemaMixin.ts +58 -0
- package/src/js/generated/ExecutionUnitInputSchemaMixin.ts +36 -0
- package/src/js/generated/ExecutionUnitSchemaMixin.ts +52 -0
- package/src/js/generated/IOUnitSchemaMixin.ts +40 -0
- package/src/js/generated/MapUnitSchemaMixin.ts +34 -0
- package/src/js/generated/ReduceUnitSchemaMixin.ts +34 -0
- package/src/js/generated/StatusSchemaMixin.ts +28 -0
- package/src/js/generated/SubworkflowSchemaMixin.ts +58 -0
- package/src/js/generated/SubworkflowUnitSchemaMixin.ts +22 -0
- package/src/js/generated/WorkflowSchemaMixin.ts +58 -0
- package/src/js/index.ts +44 -0
- package/src/js/units/AssertionUnit.ts +49 -0
- package/src/js/units/AssignmentUnit.ts +49 -0
- package/src/js/units/BaseUnit.ts +117 -0
- package/src/js/units/ConditionUnit.ts +52 -0
- package/src/js/units/ExecutionUnit.ts +274 -0
- package/src/js/units/ExecutionUnitInput.ts +71 -0
- package/src/js/units/IOUnit.ts +43 -0
- package/src/js/units/MapUnit.ts +59 -0
- package/src/js/units/ReduceUnit.ts +46 -0
- package/src/js/units/SubworkflowUnit.ts +44 -0
- package/src/js/units/factory.ts +131 -0
- package/src/js/units/index.ts +27 -0
- package/src/js/units/mixins/RuntimeItemsUILogicMixin.ts +81 -0
- package/src/js/utils/baseUnits.ts +11 -0
- package/src/js/utils/index.ts +3 -0
- package/src/js/utils/units.ts +23 -0
- package/src/js/utils/workflow.ts +69 -0
- package/src/js/workflows/{default.js → default.ts} +8 -1
- package/build_workflows.js +0 -65
- package/dist/js/context/context.js +0 -49
- package/dist/js/context/mixins/JobContextMixin.js +0 -39
- package/dist/js/context/mixins/MethodDataContextMixin.js +0 -48
- package/dist/js/context/mixins/WorkflowContextMixin.js +0 -28
- package/dist/js/context/providers/BoundaryConditionsFormDataProvider.js +0 -84
- package/dist/js/context/providers/CollinearMagnetizationContextProvider.js +0 -96
- package/dist/js/context/providers/HubbardContextProviderLegacy.js +0 -68
- package/dist/js/context/providers/HubbardJContextProvider.js +0 -67
- package/dist/js/context/providers/HubbardUContextProvider.js +0 -70
- package/dist/js/context/providers/HubbardVContextProvider.js +0 -92
- package/dist/js/context/providers/IonDynamicsContextProvider.js +0 -58
- package/dist/js/context/providers/MLSettingsContextProvider.js +0 -51
- package/dist/js/context/providers/MLTrainTestSplitContextProvider.js +0 -47
- package/dist/js/context/providers/NEBFormDataProvider.js +0 -42
- package/dist/js/context/providers/NonCollinearMagnetizationContextProvider.js +0 -187
- package/dist/js/context/providers/PlanewaveCutoffsContextProvider.js +0 -67
- package/dist/js/context/providers/PointsGridFormDataProvider.js +0 -263
- package/dist/js/context/providers/PointsPathFormDataProvider.js +0 -147
- package/dist/js/context/providers/by_application/ExecutableContextProvider.js +0 -25
- package/dist/js/context/providers/by_application/espresso/QENEBContextProvider.js +0 -61
- package/dist/js/context/providers/by_application/espresso/QEPWXContextProvider.js +0 -150
- package/dist/js/context/providers/by_application/nwchem/NWChemTotalEnergyContextProvider.js +0 -85
- package/dist/js/context/providers/by_application/vasp/VASPContextProvider.js +0 -65
- package/dist/js/context/providers/by_application/vasp/VASPNEBContextProvider.js +0 -57
- package/dist/js/context/providers.js +0 -199
- package/dist/js/patch.js +0 -19
- package/dist/js/subworkflows/convergence/non_uniform_kgrid.js +0 -31
- package/dist/js/subworkflows/convergence/parameter.js +0 -70
- package/dist/js/subworkflows/convergence/uniform_kgrid.js +0 -26
- package/dist/js/subworkflows/convergence.js +0 -189
- package/dist/js/subworkflows/create.js +0 -293
- package/dist/js/subworkflows/dynamic/espresso/getQpointIrrep.js +0 -34
- package/dist/js/subworkflows/dynamic/index.js +0 -19
- package/dist/js/subworkflows/dynamic/surfaceEnergy.js +0 -67
- package/dist/js/subworkflows/index.js +0 -19
- package/dist/js/units/assertion.js +0 -37
- package/dist/js/units/assignment.js +0 -42
- package/dist/js/units/base.js +0 -91
- package/dist/js/units/builders/AssertionUnitConfigBuilder.js +0 -34
- package/dist/js/units/builders/AssignmentUnitConfigBuilder.js +0 -41
- package/dist/js/units/builders/ExecutionUnitConfigBuilder.js +0 -67
- package/dist/js/units/builders/IOUnitConfigBuilder.js +0 -54
- package/dist/js/units/builders/UnitConfigBuilder.js +0 -85
- package/dist/js/units/builders/index.js +0 -18
- package/dist/js/units/condition.js +0 -52
- package/dist/js/units/execution.js +0 -225
- package/dist/js/units/io.js +0 -148
- package/dist/js/units/map.js +0 -38
- package/dist/js/units/processing.js +0 -41
- package/dist/js/units/reduce.js +0 -24
- package/dist/js/units/subworkflow.js +0 -23
- package/dist/js/workflows/create.js +0 -318
- package/dist/js/workflows/index.js +0 -113
- package/dist/js/workflows/relaxation.js +0 -38
- package/src/js/context/context.js +0 -47
- package/src/js/context/mixins/ApplicationContextMixin.js +0 -19
- package/src/js/context/mixins/JobContextMixin.js +0 -36
- package/src/js/context/mixins/MaterialContextMixin.js +0 -41
- package/src/js/context/mixins/MaterialsContextMixin.js +0 -18
- package/src/js/context/mixins/MaterialsSetContextMixin.js +0 -24
- package/src/js/context/mixins/MethodDataContextMixin.js +0 -48
- package/src/js/context/mixins/WorkflowContextMixin.js +0 -25
- package/src/js/context/providers/BoundaryConditionsFormDataProvider.js +0 -72
- package/src/js/context/providers/CollinearMagnetizationContextProvider.js +0 -105
- package/src/js/context/providers/HubbardContextProviderLegacy.js +0 -67
- package/src/js/context/providers/HubbardJContextProvider.js +0 -65
- package/src/js/context/providers/HubbardUContextProvider.js +0 -95
- package/src/js/context/providers/HubbardVContextProvider.js +0 -96
- package/src/js/context/providers/IonDynamicsContextProvider.js +0 -44
- package/src/js/context/providers/MLSettingsContextProvider.js +0 -45
- package/src/js/context/providers/MLTrainTestSplitContextProvider.js +0 -43
- package/src/js/context/providers/NEBFormDataProvider.js +0 -33
- package/src/js/context/providers/NonCollinearMagnetizationContextProvider.js +0 -179
- package/src/js/context/providers/PlanewaveCutoffsContextProvider.js +0 -65
- package/src/js/context/providers/PointsGridFormDataProvider.js +0 -271
- package/src/js/context/providers/PointsPathFormDataProvider.js +0 -163
- package/src/js/context/providers/by_application/ExecutableContextProvider.js +0 -17
- package/src/js/context/providers/by_application/espresso/QENEBContextProvider.js +0 -58
- package/src/js/context/providers/by_application/espresso/QEPWXContextProvider.js +0 -168
- package/src/js/context/providers/by_application/nwchem/NWChemTotalEnergyContextProvider.js +0 -89
- package/src/js/context/providers/by_application/vasp/VASPContextProvider.js +0 -58
- package/src/js/context/providers/by_application/vasp/VASPNEBContextProvider.js +0 -48
- package/src/js/context/providers/settings.js +0 -38
- package/src/js/context/providers.js +0 -140
- package/src/js/index.js +0 -57
- package/src/js/patch.js +0 -12
- package/src/js/subworkflows/convergence/enums.js +0 -12
- package/src/js/subworkflows/convergence/factory.js +0 -15
- package/src/js/subworkflows/convergence/non_uniform_kgrid.js +0 -28
- package/src/js/subworkflows/convergence/parameter.js +0 -58
- package/src/js/subworkflows/convergence/uniform_kgrid.js +0 -22
- package/src/js/subworkflows/convergence.js +0 -196
- package/src/js/subworkflows/create.js +0 -220
- package/src/js/subworkflows/dynamic/espresso/getQpointIrrep.js +0 -35
- package/src/js/subworkflows/dynamic/index.js +0 -8
- package/src/js/subworkflows/dynamic/surfaceEnergy.js +0 -124
- package/src/js/subworkflows/index.js +0 -2
- package/src/js/subworkflows/subworkflow.js +0 -345
- package/src/js/units/assertion.js +0 -29
- package/src/js/units/assignment.js +0 -34
- package/src/js/units/base.js +0 -97
- package/src/js/units/builders/AssertionUnitConfigBuilder.js +0 -28
- package/src/js/units/builders/AssignmentUnitConfigBuilder.js +0 -36
- package/src/js/units/builders/ExecutionUnitConfigBuilder.js +0 -59
- package/src/js/units/builders/IOUnitConfigBuilder.js +0 -53
- package/src/js/units/builders/UnitConfigBuilder.js +0 -92
- package/src/js/units/builders/index.js +0 -15
- package/src/js/units/condition.js +0 -47
- package/src/js/units/execution.js +0 -267
- package/src/js/units/factory.js +0 -53
- package/src/js/units/index.js +0 -25
- package/src/js/units/io.js +0 -163
- package/src/js/units/map.js +0 -33
- package/src/js/units/processing.js +0 -39
- package/src/js/units/reduce.js +0 -17
- package/src/js/units/subworkflow.js +0 -15
- package/src/js/utils.js +0 -73
- package/src/js/workflows/create.js +0 -227
- package/src/js/workflows/index.js +0 -98
- package/src/js/workflows/relaxation.js +0 -42
- package/src/js/workflows/workflow.js +0 -388
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Constructor } from "@mat3ra/code/dist/js/utils/types";
|
|
2
|
+
import JSONSchemasInterface from "@mat3ra/esse/dist/js/esse/JSONSchemasInterface";
|
|
3
|
+
import type { AnyObject } from "@mat3ra/esse/dist/js/esse/types";
|
|
4
|
+
import type { SubworkflowUnitSchema } from "@mat3ra/esse/dist/js/types";
|
|
5
|
+
|
|
6
|
+
import { UnitType } from "../enums";
|
|
7
|
+
import {
|
|
8
|
+
type SubworkflowUnitSchemaMixin,
|
|
9
|
+
subworkflowUnitSchemaMixin,
|
|
10
|
+
} from "../generated/SubworkflowUnitSchemaMixin";
|
|
11
|
+
import BaseUnit from "./BaseUnit";
|
|
12
|
+
|
|
13
|
+
type Schema = SubworkflowUnitSchema;
|
|
14
|
+
type Base = typeof BaseUnit<Schema> & Constructor<SubworkflowUnitSchemaMixin>;
|
|
15
|
+
|
|
16
|
+
export type SubworkflowUnitConfig = Partial<Omit<Schema, "flowchartId">> &
|
|
17
|
+
Pick<Schema, "flowchartId">;
|
|
18
|
+
|
|
19
|
+
class SubworkflowUnit extends (BaseUnit as Base) implements Schema {
|
|
20
|
+
declare toJSON: () => Schema & AnyObject;
|
|
21
|
+
|
|
22
|
+
declare _json: Schema & AnyObject;
|
|
23
|
+
|
|
24
|
+
static get jsonSchema() {
|
|
25
|
+
return JSONSchemasInterface.getSchemaById("workflow/unit/subworkflow");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
constructor(config: SubworkflowUnitConfig) {
|
|
29
|
+
const schema: Schema = {
|
|
30
|
+
name: "New Subworkflow",
|
|
31
|
+
results: [],
|
|
32
|
+
preProcessors: [],
|
|
33
|
+
postProcessors: [],
|
|
34
|
+
monitors: [],
|
|
35
|
+
...config,
|
|
36
|
+
type: UnitType.subworkflow,
|
|
37
|
+
};
|
|
38
|
+
super(schema);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
subworkflowUnitSchemaMixin(SubworkflowUnit.prototype);
|
|
43
|
+
|
|
44
|
+
export default SubworkflowUnit;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AssertionUnitSchema,
|
|
3
|
+
AssignmentUnitSchema,
|
|
4
|
+
ConditionUnitSchema,
|
|
5
|
+
DataIOUnitSchema,
|
|
6
|
+
ExecutionUnitSchema,
|
|
7
|
+
MapUnitSchema,
|
|
8
|
+
ReduceUnitSchema,
|
|
9
|
+
SubworkflowUnitSchema,
|
|
10
|
+
WorkflowUnitSchema,
|
|
11
|
+
} from "@mat3ra/esse/dist/js/types";
|
|
12
|
+
|
|
13
|
+
import { UnitType } from "../enums";
|
|
14
|
+
import AssertionUnit, { type AssertionUnitConfig } from "./AssertionUnit";
|
|
15
|
+
import AssignmentUnit, { type AssignmentUnitConfig } from "./AssignmentUnit";
|
|
16
|
+
import ConditionUnit, { type ConditionUnitConfig } from "./ConditionUnit";
|
|
17
|
+
import ExecutionUnit, { type ExecutionUnitConfig } from "./ExecutionUnit";
|
|
18
|
+
import IOUnit, { type IOUnitConfig } from "./IOUnit";
|
|
19
|
+
import MapUnit from "./MapUnit";
|
|
20
|
+
import ReduceUnit from "./ReduceUnit";
|
|
21
|
+
import SubworkflowUnit from "./SubworkflowUnit";
|
|
22
|
+
|
|
23
|
+
export type AnyWorkflowUnit = MapUnit | SubworkflowUnit | ReduceUnit;
|
|
24
|
+
|
|
25
|
+
export type AnyWorkflowUnitSchema = MapUnitSchema | SubworkflowUnitSchema | ReduceUnitSchema;
|
|
26
|
+
|
|
27
|
+
export type AnySubworkflowUnit =
|
|
28
|
+
| ExecutionUnit
|
|
29
|
+
| AssignmentUnit
|
|
30
|
+
| ConditionUnit
|
|
31
|
+
| IOUnit
|
|
32
|
+
| AssertionUnit;
|
|
33
|
+
|
|
34
|
+
export type AnySubworkflowUnitSchema =
|
|
35
|
+
| ExecutionUnitSchema
|
|
36
|
+
| AssertionUnitSchema
|
|
37
|
+
| AssignmentUnitSchema
|
|
38
|
+
| ConditionUnitSchema
|
|
39
|
+
| DataIOUnitSchema;
|
|
40
|
+
|
|
41
|
+
type ExcutionConfig = ExecutionUnitConfig & Pick<ExecutionUnitSchema, "type">;
|
|
42
|
+
type AssignmentConfig = AssignmentUnitConfig & Pick<AssignmentUnitSchema, "type">;
|
|
43
|
+
type ConditionConfig = ConditionUnitConfig & Pick<ConditionUnitSchema, "type">;
|
|
44
|
+
type IOConfig = IOUnitConfig & Pick<DataIOUnitSchema, "type">;
|
|
45
|
+
type AssertionConfig = AssertionUnitConfig & Pick<AssertionUnitSchema, "type">;
|
|
46
|
+
|
|
47
|
+
/** Subworkflow unit kinds supported by {@link UnitFactory.createDefaultSubworkflowUnit}. */
|
|
48
|
+
export type DefaultSubworkflowUnitType =
|
|
49
|
+
| "execution"
|
|
50
|
+
| "assignment"
|
|
51
|
+
| "condition"
|
|
52
|
+
| "io"
|
|
53
|
+
| "assertion";
|
|
54
|
+
|
|
55
|
+
export class UnitFactory {
|
|
56
|
+
/**
|
|
57
|
+
* Create a new subworkflow unit with fresh `flowchartId` and constructor defaults.
|
|
58
|
+
* For execution units, pass the subworkflow (or parent) `application` JSON.
|
|
59
|
+
*/
|
|
60
|
+
static createDefaultSubworkflowUnit(
|
|
61
|
+
type: "execution",
|
|
62
|
+
application: ExecutionUnitSchema["application"],
|
|
63
|
+
): AnySubworkflowUnit;
|
|
64
|
+
|
|
65
|
+
static createDefaultSubworkflowUnit(
|
|
66
|
+
type: "assignment" | "condition" | "io" | "assertion",
|
|
67
|
+
): AnySubworkflowUnit;
|
|
68
|
+
|
|
69
|
+
static createDefaultSubworkflowUnit(
|
|
70
|
+
type: DefaultSubworkflowUnitType,
|
|
71
|
+
application?: ExecutionUnitSchema["application"],
|
|
72
|
+
): AnySubworkflowUnit {
|
|
73
|
+
if (type === "execution") {
|
|
74
|
+
if (application === undefined) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
"UnitFactory.createDefaultSubworkflowUnit: application is required when type is execution",
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
return new ExecutionUnit({
|
|
80
|
+
type: UnitType.execution,
|
|
81
|
+
application,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
switch (type) {
|
|
85
|
+
case "assignment":
|
|
86
|
+
return new AssignmentUnit({ type: UnitType.assignment });
|
|
87
|
+
case "condition":
|
|
88
|
+
return new ConditionUnit({ type: UnitType.condition });
|
|
89
|
+
case "io":
|
|
90
|
+
return new IOUnit({ type: UnitType.io });
|
|
91
|
+
case "assertion":
|
|
92
|
+
return new AssertionUnit({ type: UnitType.assertion });
|
|
93
|
+
default: {
|
|
94
|
+
const unreachable: never = type;
|
|
95
|
+
throw new Error(`Unexpected unit type: ${String(unreachable)}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static createInWorkflow(config: WorkflowUnitSchema): AnyWorkflowUnit {
|
|
101
|
+
switch (config.type) {
|
|
102
|
+
case UnitType.map:
|
|
103
|
+
return new MapUnit(config);
|
|
104
|
+
case UnitType.subworkflow:
|
|
105
|
+
return new SubworkflowUnit(config);
|
|
106
|
+
case UnitType.reduce:
|
|
107
|
+
return new ReduceUnit(config);
|
|
108
|
+
default:
|
|
109
|
+
throw new Error(`Unknown unit type: ${config.type}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static createInSubworkflow(
|
|
114
|
+
config: ExcutionConfig | AssignmentConfig | ConditionConfig | IOConfig | AssertionConfig,
|
|
115
|
+
): AnySubworkflowUnit {
|
|
116
|
+
switch (config.type) {
|
|
117
|
+
case UnitType.execution:
|
|
118
|
+
return new ExecutionUnit(config);
|
|
119
|
+
case UnitType.assignment:
|
|
120
|
+
return new AssignmentUnit(config);
|
|
121
|
+
case UnitType.condition:
|
|
122
|
+
return new ConditionUnit(config);
|
|
123
|
+
case UnitType.io:
|
|
124
|
+
return new IOUnit(config);
|
|
125
|
+
case UnitType.assertion:
|
|
126
|
+
return new AssertionUnit(config);
|
|
127
|
+
default:
|
|
128
|
+
throw new Error(`Unknown unit type: ${config.type}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import AssertionUnit from "./AssertionUnit";
|
|
2
|
+
import AssignmentUnit from "./AssignmentUnit";
|
|
3
|
+
import BaseUnit from "./BaseUnit";
|
|
4
|
+
import ConditionUnit from "./ConditionUnit";
|
|
5
|
+
import ExecutionUnit from "./ExecutionUnit";
|
|
6
|
+
import { UnitFactory } from "./factory";
|
|
7
|
+
import IOUnit from "./IOUnit";
|
|
8
|
+
import MapUnit from "./MapUnit";
|
|
9
|
+
import ReduceUnit from "./ReduceUnit";
|
|
10
|
+
import SubworkflowUnit from "./SubworkflowUnit";
|
|
11
|
+
|
|
12
|
+
export type { ReduceUnitConfig } from "./ReduceUnit";
|
|
13
|
+
export type { SubworkflowUnitConfig } from "./SubworkflowUnit";
|
|
14
|
+
export {
|
|
15
|
+
BaseUnit,
|
|
16
|
+
AssertionUnit,
|
|
17
|
+
AssignmentUnit,
|
|
18
|
+
ConditionUnit,
|
|
19
|
+
ExecutionUnit,
|
|
20
|
+
IOUnit,
|
|
21
|
+
MapUnit,
|
|
22
|
+
ReduceUnit,
|
|
23
|
+
SubworkflowUnit,
|
|
24
|
+
UnitFactory,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type { DefaultSubworkflowUnitType } from "./factory";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
+
import type { RuntimeItems } from "@mat3ra/code/dist/js/entity/mixins/RuntimeItemsMixin";
|
|
3
|
+
import type { NameResultSchema } from "@mat3ra/code/dist/js/utils/object";
|
|
4
|
+
import type { RuntimeItemsSchema } from "@mat3ra/esse/dist/js/types";
|
|
5
|
+
|
|
6
|
+
type ItemKey = "results" | "monitors" | "preProcessors" | "postProcessors";
|
|
7
|
+
|
|
8
|
+
export type RuntimeItemsUILogic = {
|
|
9
|
+
_initRuntimeItems(config?: Partial<RuntimeItemsSchema>): void;
|
|
10
|
+
toggleRuntimeItem(key: ItemKey, data: NameResultSchema, isAdding: boolean): void;
|
|
11
|
+
toggleResult(data: NameResultSchema, isAdding: boolean): void;
|
|
12
|
+
toggleMonitor(data: NameResultSchema, isAdding: boolean): void;
|
|
13
|
+
togglePreProcessor(data: NameResultSchema, isAdding: boolean): void;
|
|
14
|
+
togglePostProcessor(data: NameResultSchema, isAdding: boolean): void;
|
|
15
|
+
getResultByName(name: string): NameResultSchema | undefined;
|
|
16
|
+
get resultNames(): string[];
|
|
17
|
+
get monitorNames(): string[];
|
|
18
|
+
get postProcessorNames(): string[];
|
|
19
|
+
get preProcessorNames(): string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type RuntimeItemsUILogicPrivate = {
|
|
23
|
+
toggleRuntimeItem(key: ItemKey, data: NameResultSchema, isAdding: boolean): void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
interface RuntimeItemsUILogicMixinBase extends InMemoryEntity, RuntimeItems {
|
|
27
|
+
defaultResults: NameResultSchema[];
|
|
28
|
+
defaultMonitors: NameResultSchema[];
|
|
29
|
+
defaultPreProcessors: NameResultSchema[];
|
|
30
|
+
defaultPostProcessors: NameResultSchema[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// @ts-expect-error
|
|
34
|
+
const propertiesMixin: RuntimeItemsUILogicMixinBase &
|
|
35
|
+
RuntimeItemsUILogic &
|
|
36
|
+
RuntimeItemsUILogicPrivate = {
|
|
37
|
+
_initRuntimeItems(config) {
|
|
38
|
+
this.results = config?.results || this.defaultResults;
|
|
39
|
+
this.monitors = config?.monitors || this.defaultMonitors;
|
|
40
|
+
this.preProcessors = config?.preProcessors || this.defaultPreProcessors;
|
|
41
|
+
this.postProcessors = config?.postProcessors || this.defaultPostProcessors;
|
|
42
|
+
},
|
|
43
|
+
toggleRuntimeItem(key: ItemKey, data: NameResultSchema, isAdding: boolean) {
|
|
44
|
+
if (isAdding) {
|
|
45
|
+
this[key] = [...this[key], data];
|
|
46
|
+
} else {
|
|
47
|
+
this[key] = this[key].filter((x) => x.name !== data.name);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
toggleResult(data: NameResultSchema, isAdding: boolean) {
|
|
51
|
+
this.toggleRuntimeItem("results", data, isAdding);
|
|
52
|
+
},
|
|
53
|
+
toggleMonitor(data: NameResultSchema, isAdding: boolean) {
|
|
54
|
+
this.toggleRuntimeItem("monitors", data, isAdding);
|
|
55
|
+
},
|
|
56
|
+
togglePreProcessor(data: NameResultSchema, isAdding: boolean) {
|
|
57
|
+
this.toggleRuntimeItem("preProcessors", data, isAdding);
|
|
58
|
+
},
|
|
59
|
+
togglePostProcessor(data: NameResultSchema, isAdding: boolean) {
|
|
60
|
+
this.toggleRuntimeItem("postProcessors", data, isAdding);
|
|
61
|
+
},
|
|
62
|
+
get resultNames() {
|
|
63
|
+
return this.results.map((r) => r.name);
|
|
64
|
+
},
|
|
65
|
+
get monitorNames() {
|
|
66
|
+
return this.monitors.map((r) => r?.name);
|
|
67
|
+
},
|
|
68
|
+
get postProcessorNames() {
|
|
69
|
+
return this.postProcessors.map((r) => r.name);
|
|
70
|
+
},
|
|
71
|
+
get preProcessorNames() {
|
|
72
|
+
return this.preProcessors.map((r) => r.name);
|
|
73
|
+
},
|
|
74
|
+
getResultByName(name: string) {
|
|
75
|
+
return this.results.find((r) => r.name === name);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export function runtimeItemsUILogicMixin<T extends RuntimeItemsUILogicMixinBase>(item: T) {
|
|
80
|
+
Object.defineProperties(item, Object.getOwnPropertyDescriptors(propertiesMixin));
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WorkflowBaseUnitSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
+
|
|
3
|
+
import { UnitStatus } from "../enums";
|
|
4
|
+
|
|
5
|
+
export function resetStatus<T extends WorkflowBaseUnitSchema>(unit: T) {
|
|
6
|
+
return {
|
|
7
|
+
...unit,
|
|
8
|
+
status: UnitStatus.idle,
|
|
9
|
+
statusTrack: [],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SubworkflowSchema, WorkflowUnitSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
+
|
|
3
|
+
import { UnitType } from "../enums";
|
|
4
|
+
import { UnitFactory } from "../units/factory";
|
|
5
|
+
|
|
6
|
+
type SubworkflowUnitSchema = SubworkflowSchema["units"][number];
|
|
7
|
+
|
|
8
|
+
function isWorkflowLevelUnit(
|
|
9
|
+
unit: WorkflowUnitSchema | SubworkflowUnitSchema,
|
|
10
|
+
): unit is WorkflowUnitSchema {
|
|
11
|
+
return (
|
|
12
|
+
unit.type === UnitType.map ||
|
|
13
|
+
unit.type === UnitType.reduce ||
|
|
14
|
+
unit.type === UnitType.subworkflow
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function calculateHash(unit: WorkflowUnitSchema | SubworkflowUnitSchema): string {
|
|
19
|
+
if (isWorkflowLevelUnit(unit)) {
|
|
20
|
+
return UnitFactory.createInWorkflow(unit).calculateHash();
|
|
21
|
+
}
|
|
22
|
+
return UnitFactory.createInSubworkflow(unit).calculateHash();
|
|
23
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ApplicationSchema, WorkflowSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
+
import { MODEL_NAMES } from "@mat3ra/mode/dist/js/tree";
|
|
3
|
+
import s from "underscore.string";
|
|
4
|
+
|
|
5
|
+
import { resetStatus } from "./baseUnits";
|
|
6
|
+
|
|
7
|
+
export function getUsedApplications(workflow: WorkflowSchema): ApplicationSchema[] {
|
|
8
|
+
const swApplications = workflow.subworkflows.map((sw) => sw.application);
|
|
9
|
+
const nestedWorkflows = workflow.workflows as WorkflowSchema[];
|
|
10
|
+
const wfApplications = nestedWorkflows.map(getUsedApplications).flat();
|
|
11
|
+
|
|
12
|
+
return [...swApplications, ...wfApplications].reduce<ApplicationSchema[]>((acc, app) => {
|
|
13
|
+
if (!acc.some((a) => a.name === app.name)) {
|
|
14
|
+
acc.push(app);
|
|
15
|
+
}
|
|
16
|
+
return acc;
|
|
17
|
+
}, []);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function getSystemName(workflow: WorkflowSchema): string {
|
|
21
|
+
const applicationNames = getUsedApplications(workflow).map((a) => a.name);
|
|
22
|
+
return s.slugify(`${applicationNames.join(":")}-${workflow.name}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getUsedModels(workflow: WorkflowSchema) {
|
|
26
|
+
return workflow.subworkflows.map((sw) => sw.model.type);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getDefaultDescription(workflow: WorkflowSchema): string {
|
|
30
|
+
const applicationNames = getUsedApplications(workflow).map((a) => a.name);
|
|
31
|
+
|
|
32
|
+
return `${getUsedModels(workflow)
|
|
33
|
+
.join(", ")
|
|
34
|
+
.toUpperCase()} workflow using ${applicationNames.join(", ")}.`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function getProperties(workflow: WorkflowSchema) {
|
|
38
|
+
return [...new Set(workflow.subworkflows.map((sw) => sw.properties || []).flat())];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getHumanReadableProperties(workflow: WorkflowSchema) {
|
|
42
|
+
return getProperties(workflow).map((name) =>
|
|
43
|
+
name
|
|
44
|
+
.split("_")
|
|
45
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
46
|
+
.join(" "),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function getHumanReadableUsedModels(workflow: WorkflowSchema) {
|
|
51
|
+
return getUsedModels(workflow)
|
|
52
|
+
.filter((m) => m !== "unknown")
|
|
53
|
+
.map((m) => MODEL_NAMES[m]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function resetUnitsStatuses(workflow: WorkflowSchema): WorkflowSchema {
|
|
57
|
+
return {
|
|
58
|
+
...workflow,
|
|
59
|
+
subworkflows: workflow.subworkflows.map((subworkflow) => {
|
|
60
|
+
return {
|
|
61
|
+
...subworkflow,
|
|
62
|
+
units: subworkflow.units.map(resetStatus),
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
workflows: workflow.workflows?.map((wf) =>
|
|
66
|
+
resetUnitsStatuses(wf as WorkflowSchema),
|
|
67
|
+
) as WorkflowSchema[],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { WorkflowSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
+
|
|
3
|
+
const defaultWorkflowConfig: WorkflowSchema = {
|
|
2
4
|
name: "New Workflow",
|
|
3
5
|
properties: [],
|
|
4
6
|
subworkflows: [
|
|
@@ -6,7 +8,9 @@ export default {
|
|
|
6
8
|
_id: "c6e9dbbee8929de01f4e76ee",
|
|
7
9
|
application: {
|
|
8
10
|
name: "espresso",
|
|
11
|
+
shortName: "espresso",
|
|
9
12
|
summary: "Quantum Espresso",
|
|
13
|
+
build: "6.3",
|
|
10
14
|
version: "6.3",
|
|
11
15
|
},
|
|
12
16
|
model: {
|
|
@@ -16,6 +20,7 @@ export default {
|
|
|
16
20
|
},
|
|
17
21
|
subtype: "gga",
|
|
18
22
|
type: "dft",
|
|
23
|
+
functional: "other",
|
|
19
24
|
},
|
|
20
25
|
name: "New Subworkflow",
|
|
21
26
|
properties: [],
|
|
@@ -37,3 +42,5 @@ export default {
|
|
|
37
42
|
},
|
|
38
43
|
],
|
|
39
44
|
};
|
|
45
|
+
|
|
46
|
+
export default defaultWorkflowConfig;
|
package/build_workflows.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
const yaml = require("js-yaml");
|
|
4
|
-
|
|
5
|
-
const allApplications = [
|
|
6
|
-
"espresso",
|
|
7
|
-
"jupyterLab",
|
|
8
|
-
"nwchem",
|
|
9
|
-
"python",
|
|
10
|
-
"python/ml",
|
|
11
|
-
"shell",
|
|
12
|
-
"vasp",
|
|
13
|
-
"deepmd",
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
const allWorkflows = { workflows: {}, subworkflows: {} };
|
|
17
|
-
|
|
18
|
-
const JSONstringifyOrder = (obj, space) => {
|
|
19
|
-
const allKeys = new Set();
|
|
20
|
-
// eslint-disable-next-line no-sequences
|
|
21
|
-
JSON.stringify(obj, (key, value) => (allKeys.add(key), value));
|
|
22
|
-
return JSON.stringify(obj, Array.from(allKeys).sort(), space);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const loadFile = (name, dir, file, type) => {
|
|
26
|
-
const entryPath = path.resolve(dir, file);
|
|
27
|
-
if (!fs.statSync(entryPath).isFile()) {
|
|
28
|
-
console.log(`Skipping ${entryPath} as it is not a file.`);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const obj = fs.readFileSync(path.resolve(dir, file), "utf8");
|
|
32
|
-
const key = file.split(".")[0];
|
|
33
|
-
allWorkflows[type][name][key] = yaml.load(obj);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
allApplications.forEach((name) => {
|
|
37
|
-
allWorkflows.workflows[name] = {};
|
|
38
|
-
allWorkflows.subworkflows[name] = {};
|
|
39
|
-
const wfDir = path.resolve(__dirname, "assets", "workflows", name);
|
|
40
|
-
const swDir = path.resolve(__dirname, "assets", "subworkflows", name);
|
|
41
|
-
try {
|
|
42
|
-
const wfFiles = fs.readdirSync(wfDir);
|
|
43
|
-
const swFiles = fs.readdirSync(swDir);
|
|
44
|
-
console.log(
|
|
45
|
-
`Building ${name}: ${wfFiles.length} workflow(s) and ${swFiles.length} subworkflow(s)`,
|
|
46
|
-
);
|
|
47
|
-
wfFiles.forEach((file) => loadFile(name, wfDir, file, "workflows"));
|
|
48
|
-
swFiles.forEach((file) => loadFile(name, swDir, file, "subworkflows"));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
console.log(e);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const write_path = "workflows.js";
|
|
55
|
-
// write to src for unit test coverage simplicity
|
|
56
|
-
fs.writeFileSync(
|
|
57
|
-
`./src/workflows/${write_path}`,
|
|
58
|
-
"module.exports = {workflowData: " + JSONstringifyOrder(allWorkflows) + "}",
|
|
59
|
-
"utf8",
|
|
60
|
-
);
|
|
61
|
-
fs.writeFileSync(
|
|
62
|
-
`./dist/workflows/${write_path}`,
|
|
63
|
-
"module.exports = {workflowData: " + JSONstringifyOrder(allWorkflows) + "}",
|
|
64
|
-
"utf8",
|
|
65
|
-
);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _BoundaryConditionsFormDataProvider = require("./providers/BoundaryConditionsFormDataProvider");
|
|
8
|
-
var _QENEBContextProvider = _interopRequireDefault(require("./providers/by_application/espresso/QENEBContextProvider"));
|
|
9
|
-
var _QEPWXContextProvider = _interopRequireDefault(require("./providers/by_application/espresso/QEPWXContextProvider"));
|
|
10
|
-
var _NWChemTotalEnergyContextProvider = _interopRequireDefault(require("./providers/by_application/nwchem/NWChemTotalEnergyContextProvider"));
|
|
11
|
-
var _VASPContextProvider = _interopRequireDefault(require("./providers/by_application/vasp/VASPContextProvider"));
|
|
12
|
-
var _VASPNEBContextProvider = _interopRequireDefault(require("./providers/by_application/vasp/VASPNEBContextProvider"));
|
|
13
|
-
var _CollinearMagnetizationContextProvider = require("./providers/CollinearMagnetizationContextProvider");
|
|
14
|
-
var _HubbardContextProviderLegacy = require("./providers/HubbardContextProviderLegacy");
|
|
15
|
-
var _HubbardJContextProvider = require("./providers/HubbardJContextProvider");
|
|
16
|
-
var _HubbardUContextProvider = require("./providers/HubbardUContextProvider");
|
|
17
|
-
var _HubbardVContextProvider = require("./providers/HubbardVContextProvider");
|
|
18
|
-
var _IonDynamicsContextProvider = require("./providers/IonDynamicsContextProvider");
|
|
19
|
-
var _MLSettingsContextProvider = require("./providers/MLSettingsContextProvider");
|
|
20
|
-
var _MLTrainTestSplitContextProvider = require("./providers/MLTrainTestSplitContextProvider");
|
|
21
|
-
var _NEBFormDataProvider = require("./providers/NEBFormDataProvider");
|
|
22
|
-
var _NonCollinearMagnetizationContextProvider = require("./providers/NonCollinearMagnetizationContextProvider");
|
|
23
|
-
var _PlanewaveCutoffsContextProvider = require("./providers/PlanewaveCutoffsContextProvider");
|
|
24
|
-
var _PointsGridFormDataProvider = require("./providers/PointsGridFormDataProvider");
|
|
25
|
-
var _PointsPathFormDataProvider = require("./providers/PointsPathFormDataProvider");
|
|
26
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
|
-
var _default = exports.default = {
|
|
28
|
-
BoundaryConditionsFormDataProvider: _BoundaryConditionsFormDataProvider.BoundaryConditionsFormDataProvider,
|
|
29
|
-
MLSettingsContextProvider: _MLSettingsContextProvider.MLSettingsContextProvider,
|
|
30
|
-
MLTrainTestSplitContextProvider: _MLTrainTestSplitContextProvider.MLTrainTestSplitContextProvider,
|
|
31
|
-
NEBFormDataProvider: _NEBFormDataProvider.NEBFormDataProvider,
|
|
32
|
-
PlanewaveCutoffsContextProvider: _PlanewaveCutoffsContextProvider.PlanewaveCutoffsContextProvider,
|
|
33
|
-
PointsGridFormDataProvider: _PointsGridFormDataProvider.PointsGridFormDataProvider,
|
|
34
|
-
PointsPathFormDataProvider: _PointsPathFormDataProvider.PointsPathFormDataProvider,
|
|
35
|
-
ExplicitPointsPathFormDataProvider: _PointsPathFormDataProvider.ExplicitPointsPathFormDataProvider,
|
|
36
|
-
ExplicitPointsPath2PIBAFormDataProvider: _PointsPathFormDataProvider.ExplicitPointsPath2PIBAFormDataProvider,
|
|
37
|
-
HubbardJContextProvider: _HubbardJContextProvider.HubbardJContextProvider,
|
|
38
|
-
HubbardUContextProvider: _HubbardUContextProvider.HubbardUContextProvider,
|
|
39
|
-
HubbardVContextProvider: _HubbardVContextProvider.HubbardVContextProvider,
|
|
40
|
-
HubbardContextProviderLegacy: _HubbardContextProviderLegacy.HubbardContextProviderLegacy,
|
|
41
|
-
IonDynamicsContextProvider: _IonDynamicsContextProvider.IonDynamicsContextProvider,
|
|
42
|
-
CollinearMagnetizationContextProvider: _CollinearMagnetizationContextProvider.CollinearMagnetizationContextProvider,
|
|
43
|
-
NonCollinearMagnetizationContextProvider: _NonCollinearMagnetizationContextProvider.NonCollinearMagnetizationContextProvider,
|
|
44
|
-
VASPContextProvider: _VASPContextProvider.default,
|
|
45
|
-
VASPNEBContextProvider: _VASPNEBContextProvider.default,
|
|
46
|
-
QEPWXContextProvider: _QEPWXContextProvider.default,
|
|
47
|
-
QENEBContextProvider: _QENEBContextProvider.default,
|
|
48
|
-
NWChemTotalEnergyContextProvider: _NWChemTotalEnergyContextProvider.default
|
|
49
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.jobContextMixin = jobContextMixin;
|
|
7
|
-
const defaultJob = {
|
|
8
|
-
workflow: {
|
|
9
|
-
subworkflows: [],
|
|
10
|
-
units: []
|
|
11
|
-
},
|
|
12
|
-
status: "pre-submission",
|
|
13
|
-
compute: {
|
|
14
|
-
queue: "D",
|
|
15
|
-
nodes: 1,
|
|
16
|
-
ppn: 1,
|
|
17
|
-
timeLimit: "3600"
|
|
18
|
-
},
|
|
19
|
-
_project: {
|
|
20
|
-
_id: ""
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
function jobContextMixin(item) {
|
|
24
|
-
const properties = {
|
|
25
|
-
isEdited: false,
|
|
26
|
-
_job: defaultJob,
|
|
27
|
-
get job() {
|
|
28
|
-
return this._job;
|
|
29
|
-
},
|
|
30
|
-
initJobContextMixin() {
|
|
31
|
-
const {
|
|
32
|
-
config
|
|
33
|
-
} = this;
|
|
34
|
-
this._job = config.context && config.context.job || defaultJob;
|
|
35
|
-
this.isEdited = false; // we always get the `defaultData` (recalculated from scratch, not persistent)
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
|
|
39
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.methodDataContextMixin = methodDataContextMixin;
|
|
7
|
-
var _cryptoJs = _interopRequireDefault(require("crypto-js"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
function methodDataContextMixin(item) {
|
|
10
|
-
const properties = {
|
|
11
|
-
_methodData: undefined,
|
|
12
|
-
isEdited: false,
|
|
13
|
-
methodDataHash: undefined,
|
|
14
|
-
extraData: undefined,
|
|
15
|
-
initMethodDataContextMixin() {
|
|
16
|
-
this._methodData = this.config.context && this.config.context.methodData || {};
|
|
17
|
-
this.isEdited = Boolean(this.config.isEdited);
|
|
18
|
-
},
|
|
19
|
-
/* @summary Replace the logic in constructor with this in order to enable passing `methodDataHash` between
|
|
20
|
-
* subsequent initializations of the derived class. Not used at present and kept for the record.
|
|
21
|
-
*/
|
|
22
|
-
_initMethodDataHash() {
|
|
23
|
-
this.methodDataHash = _cryptoJs.default.MD5(JSON.stringify(this.methodData)).toString();
|
|
24
|
-
this.extraData = {
|
|
25
|
-
methodDataHash: this.methodDataHash
|
|
26
|
-
};
|
|
27
|
-
if (!this._methodData) {
|
|
28
|
-
this._methodData = {};
|
|
29
|
-
this.isEdited = false;
|
|
30
|
-
// Commented out to reduce effect on performance. Uncomment for debugging purposes.
|
|
31
|
-
// TODO: remove on next refactoring or convert to log
|
|
32
|
-
// console.warn("MethodDataContextMixin: methodData is undefined or null");
|
|
33
|
-
} else if (this.isMethodDataUpdated) {
|
|
34
|
-
this.isEdited = false;
|
|
35
|
-
} else {
|
|
36
|
-
// eslint-disable-next-line no-undef
|
|
37
|
-
this.isEdited = config.isEdited;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
get methodData() {
|
|
41
|
-
return this._methodData;
|
|
42
|
-
},
|
|
43
|
-
get isMethodDataUpdated() {
|
|
44
|
-
return Boolean(this.extraData && this.extraData.methodDataHash !== this.methodDataHash);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
|
|
48
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.workflowContextMixin = workflowContextMixin;
|
|
7
|
-
const defaultWorkflow = {
|
|
8
|
-
subworkflows: [],
|
|
9
|
-
units: [],
|
|
10
|
-
hasRelaxation: false
|
|
11
|
-
};
|
|
12
|
-
function workflowContextMixin(item) {
|
|
13
|
-
const properties = {
|
|
14
|
-
isEdited: false,
|
|
15
|
-
_workflow: defaultWorkflow,
|
|
16
|
-
get workflow() {
|
|
17
|
-
return this._workflow;
|
|
18
|
-
},
|
|
19
|
-
initWorkflowContextMixin() {
|
|
20
|
-
const {
|
|
21
|
-
config
|
|
22
|
-
} = this; // as WorkflowConfig;
|
|
23
|
-
this._workflow = config.context && config.context.workflow || defaultWorkflow;
|
|
24
|
-
this.isEdited = false; // we always get the `defaultData` (recalculated from scratch, not persistent)
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperties(item, Object.getOwnPropertyDescriptors(properties));
|
|
28
|
-
}
|