Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,36 @@ When developing in python the following should be taken into account:
python -m unittest discover --verbose --catch --start-directory tests/py/esse/
```

3. **Resolving Merge Conflicts in Auto-generated Python Models**: The Python model files in `src/py/mat3ra/esse/models/` are auto-generated from JSON schemas using `datamodel-codegen`. If merge conflicts occur in these files, they should be resolved by regenerating the models rather than manually editing them. To resolve conflicts:

```bash
# Ensure you have the latest schemas built
npm run transpile-and-build-assets

# Regenerate Python models (requires datamodel-code-generator)
datamodel-codegen \
--input ./dist/js/schema/ \
--input-file-type jsonschema \
--output ./dist/py \
--output-model-type pydantic_v2.BaseModel \
--use-field-description \
--use-double-quotes \
--enable-version-header \
--use-title-as-name \
--class-name ESSE \
--disable-timestamp \
--use-default

# Sync regenerated files to src directory
rsync -av --delete dist/py/ src/py/mat3ra/esse/models/
```

Alternatively, you can use the pre-commit hook which will regenerate models automatically when schema files change:

```bash
pre-commit run generate-python-modules --all-files
```

### 5.2. Development in Javascript/Typescript

See [package.json](package.json) for the list of available npm commands. The JS modules are generated using the [build_schema.js](./build_schema.js) script. There is a setup for it to be run automatically when the package is installed (see "transpile" directive). To rebuild schemas manually, run:
Expand Down
14 changes: 12 additions & 2 deletions dist/js/example/job.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"model": {
Expand All @@ -105,6 +106,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"compute": null,
Expand Down Expand Up @@ -135,7 +137,11 @@
"templateId": "dJ7HYz5pQ4AuN5qc9"
}
],
"name": "pw_scf"
"name": "pw_scf",
"postProcessors": [],
"preProcessors": [],
"monitors": [],
"results": []
},
"flowchartId": "execution",
"head": true,
Expand Down Expand Up @@ -176,7 +182,11 @@
"_id": "LCthJ6E2QabYCZqf4",
"flowchartId": "05c362dc27ff1bb98d16fd60",
"type": "subworkflow",
"name": "subworkflow unit"
"name": "subworkflow unit",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
]
}
Expand Down
1 change: 1 addition & 0 deletions dist/js/example/software/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
}
6 changes: 5 additions & 1 deletion dist/js/example/software/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"templateId": "dJ7HYz5pQ4AuN5qc9"
}
],
"name": "pw_scf"
"name": "pw_scf",
"postProcessors": [],
"preProcessors": [],
"monitors": [],
"results": []
}
3 changes: 2 additions & 1 deletion dist/js/example/software_directory/modeling/espresso.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "espresso",
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "7.2"
"version": "7.2",
"build": "GNU"
}
4 changes: 3 additions & 1 deletion dist/js/example/software_directory/modeling/nwchem.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "NWChem",
"summary": "NWChem: a comprehensive and scalable open-source solution for large scale molecular simulations",
"shortName": "nwchem",
"version": "6.6",
"exec": "nwchem"
"exec": "nwchem",
"build": "GNU"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"name": "espresso",
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "7.2"
"version": "7.2",
"build": "GNU"
},
"flowchartId": "modeling",
"head": true,
Expand All @@ -26,5 +27,9 @@
],
"name": "modeling",
"status": "idle",
"type": "execution"
"type": "execution",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
3 changes: 2 additions & 1 deletion dist/js/example/software_directory/modeling/vasp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"name": "vasp",
"shortName": "vasp",
"summary": "vienna ab-initio simulation package",
"version": "5.3.5"
"version": "5.3.5",
"build": "GNU"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"name": "jupyterLab",
"shortName": "jl",
"summary": "Jupyter Lab",
"version": "0.33.12"
"version": "0.33.12",
"build": "GNU"
}
3 changes: 2 additions & 1 deletion dist/js/example/software_directory/scripting/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"name": "python",
"shortName": "py",
"summary": "Python Script",
"version": "2.7.5"
"version": "2.7.5",
"build": "GNU"
}
3 changes: 2 additions & 1 deletion dist/js/example/software_directory/scripting/shell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"name": "shell",
"shortName": "sh",
"summary": "Shell Script",
"version": "4.2.46"
"version": "4.2.46",
"build": "GNU"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"name": "python",
"shortName": "py",
"summary": "Python Script",
"version": "2.7.5"
"version": "2.7.5",
"build": "GNU"
},
"compute": null,
"flowchartId": "scripting",
Expand All @@ -29,5 +30,9 @@
],
"name": "scripting",
"status": "idle",
"type": "execution"
"type": "execution",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"preProcessors": [],
"postProcessors": [],
"monitors": [
{
"name": "standard_output"
}
],
"postProcessors": [],
"preProcessors": [],
"results": [
{
"name": "atomic_forces"
Expand Down
14 changes: 12 additions & 2 deletions dist/js/example/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"model": {
Expand All @@ -52,6 +53,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"compute": null,
Expand Down Expand Up @@ -82,7 +84,11 @@
"templateId": "dJ7HYz5pQ4AuN5qc9"
}
],
"name": "pw_scf"
"name": "pw_scf",
"postProcessors": [],
"preProcessors": [],
"monitors": [],
"results": []
},
"flowchartId": "execution",
"head": true,
Expand Down Expand Up @@ -123,7 +129,11 @@
"_id": "LCthJ6E2QabYCZqf4",
"flowchartId": "05c362dc27ff1bb98d16fd60",
"type": "subworkflow",
"name": "subworkflow unit"
"name": "subworkflow unit",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
]
}
8 changes: 7 additions & 1 deletion dist/js/example/workflow/subworkflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"model": {
Expand All @@ -29,6 +30,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"compute": null,
Expand Down Expand Up @@ -59,7 +61,11 @@
"templateId": "dJ7HYz5pQ4AuN5qc9"
}
],
"name": "pw_scf"
"name": "pw_scf",
"postProcessors": [],
"preProcessors": [],
"monitors": [],
"results": []
},
"flowchartId": "execution",
"head": true,
Expand Down
6 changes: 5 additions & 1 deletion dist/js/example/workflow/unit/assignment.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@
"operand": "N_K_x",
"status": "idle",
"type": "assignment",
"value": "N_K_x+N_K_y+1"
"value": "N_K_x+N_K_y+1",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
6 changes: 5 additions & 1 deletion dist/js/example/workflow/unit/condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@
"status": "idle",
"then": "sample_id_4",
"throwException": true,
"type": "condition"
"type": "condition",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
7 changes: 6 additions & 1 deletion dist/js/example/workflow/unit/execution.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"shortName": "qe",
"summary": "Quantum Espresso",
"version": "5.1.1",
"build": "GNU",
"hasAdvancedComputeOptions": true
},
"compute": null,
Expand Down Expand Up @@ -34,7 +35,11 @@
"templateId": "dJ7HYz5pQ4AuN5qc9"
}
],
"name": "pw_scf"
"name": "pw_scf",
"postProcessors": [],
"preProcessors": [],
"monitors": [],
"results": []
},
"flowchartId": "execution",
"head": true,
Expand Down
6 changes: 5 additions & 1 deletion dist/js/example/workflow/unit/io.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@
"source": "api",
"status": "idle",
"subtype": "input",
"type": "io"
"type": "io",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
6 changes: 5 additions & 1 deletion dist/js/example/workflow/unit/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"name": "map",
"status": "idle",
"type": "map",
"workflowId": "zxjhEiaQvwWwvB3oM"
"workflowId": "zxjhEiaQvwWwvB3oM",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
6 changes: 5 additions & 1 deletion dist/js/example/workflow/unit/processing.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
"operation": "data_transformation",
"operationType": "manipulation",
"status": "idle",
"type": "processing"
"type": "processing",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
6 changes: 5 additions & 1 deletion dist/js/example/workflow/unit/reduce.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"mapFlowchartId": "1",
"name": "reduce",
"status": "idle",
"type": "reduce"
"type": "reduce",
"preProcessors": [],
"postProcessors": [],
"monitors": [],
"results": []
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "context-providers-directory/boundary-conditions-data-provider",
"$id": "context-providers-directory/boundary-conditions-provider",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Boundary Conditions Provider Schema",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "context-providers-directory/collinear-magnetization-context-provider",
"$id": "context-providers-directory/collinear-magnetization-provider",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Collinear Magnetization Provider Schema",
"description": "Set starting magnetization, can have values in the range [-1, +1].",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "context-providers-directory/hubbard-j-context-provider",
"$id": "context-providers-directory/hubbard-j-provider",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Hubbard J Provider Schema",
"description": "Hubbard parameters for DFT+U+J calculation.",
Expand Down
Loading
Loading