aiida-chemshell 0.2.2__tar.gz → 0.3.1__tar.gz
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.
- {aiida_chemshell-0.2.2/src/aiida_chemshell.egg-info → aiida_chemshell-0.3.1}/PKG-INFO +34 -33
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/README.md +32 -32
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/pyproject.toml +13 -1
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/calculations/base.py +114 -18
- aiida_chemshell-0.3.1/src/aiida_chemshell/calculations/utils.py +226 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/parsers/base.py +84 -24
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/units.py +2 -2
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/utils.py +58 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/workflows/batch_calculation.py +102 -75
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/workflows/isolated_atoms.py +20 -2
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/workflows/optimisation.py +28 -2
- aiida_chemshell-0.3.1/src/aiida_chemshell/workflows/utils.py +34 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1/src/aiida_chemshell.egg-info}/PKG-INFO +34 -33
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell.egg-info/SOURCES.txt +1 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell.egg-info/requires.txt +1 -0
- aiida_chemshell-0.3.1/tests/test_batch_workcahin.py +261 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/tests/test_calculations.py +40 -50
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/tests/test_inputs.py +63 -0
- aiida_chemshell-0.3.1/tests/test_isolated_atoms_workchain.py +92 -0
- aiida_chemshell-0.3.1/tests/test_workflows.py +95 -0
- aiida_chemshell-0.2.2/src/aiida_chemshell/calculations/utils.py +0 -14
- aiida_chemshell-0.2.2/tests/test_batch_workcahin.py +0 -175
- aiida_chemshell-0.2.2/tests/test_isolated_atoms_workchain.py +0 -27
- aiida_chemshell-0.2.2/tests/test_workflows.py +0 -95
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/LICENSE +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/setup.cfg +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/__init__.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/calculations/__init__.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/calculations/file_conversion.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/calculations/solvant_removal.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/parsers/__init__.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/parsers/file_conversion.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/periodic_table.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell/workflows/__init__.py +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell.egg-info/dependency_links.txt +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell.egg-info/entry_points.txt +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/src/aiida_chemshell.egg-info/top_level.txt +0 -0
- {aiida_chemshell-0.2.2 → aiida_chemshell-0.3.1}/tests/test_error_codes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aiida-chemshell
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: AiiDA workflow plugin for the ChemShell chemical modelling software package
|
|
5
5
|
Author-email: "Dr. Benjamin T. Speake" <benjamin.speake@stfc.ac.uk>
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -46,6 +46,7 @@ Provides-Extra: dev
|
|
|
46
46
|
Requires-Dist: aiida-core>=2.8; extra == "dev"
|
|
47
47
|
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
48
48
|
Requires-Dist: pytest-cov>=6.0; extra == "dev"
|
|
49
|
+
Requires-Dist: pytest-xdist>=3.0; extra == "dev"
|
|
49
50
|
Requires-Dist: ruff>=0.11.0; extra == "dev"
|
|
50
51
|
Requires-Dist: pre-commit; extra == "dev"
|
|
51
52
|
Provides-Extra: docs
|
|
@@ -64,30 +65,28 @@ Dynamic: license-file
|
|
|
64
65
|
|
|
65
66
|
[](https://doi.org/10.5281/zenodo.18392782)
|
|
66
67
|
|
|
67
|
-
|
|
68
68
|
# AiiDA ChemShell
|
|
69
69
|
|
|
70
|
-
An [AiiDA](https://www.aiida.net) plugin for the [ChemShell](https://chemshell.org/) multiscale
|
|
71
|
-
computational chemistry software package.
|
|
70
|
+
An [AiiDA](https://www.aiida.net) plugin for the [ChemShell](https://chemshell.org/) multiscale
|
|
71
|
+
computational chemistry software package.
|
|
72
72
|
|
|
73
|
-
## Installation
|
|
73
|
+
## Installation
|
|
74
74
|
|
|
75
|
-
This plugin is available through PyPI and should be installed using [`pip`](https://pip.pypa.io/en/stable/) python package manager.
|
|
75
|
+
This plugin is available through PyPI and should be installed using [`pip`](https://pip.pypa.io/en/stable/) python package manager.
|
|
76
76
|
|
|
77
|
-
```
|
|
77
|
+
``` bash
|
|
78
78
|
pip install aiida-chemshell
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
## Requirements
|
|
82
|
-
|
|
83
|
-
To use this plugin a configured AiiDA profile and computer configuration are required, see the
|
|
84
|
-
[AiiDa documentation](https://aiida.readthedocs.io/projects/aiida-core/en/latest/intro/get_started.html)
|
|
85
|
-
for instructions on how to install and configure AiiDA.
|
|
81
|
+
## Requirements
|
|
86
82
|
|
|
83
|
+
To use this plugin a configured AiiDA profile and computer configuration are required, see the
|
|
84
|
+
[AiiDa documentation](https://aiida.readthedocs.io/projects/aiida-core/en/latest/intro/get_started.html)
|
|
85
|
+
for instructions on how to install and configure AiiDA.
|
|
87
86
|
|
|
88
|
-
## Setup
|
|
87
|
+
## Setup
|
|
89
88
|
|
|
90
|
-
To configure the ChemShell plugin an AiiDA code instance needs to be configured for the ChemShell executable.
|
|
89
|
+
To configure the ChemShell plugin an AiiDA code instance needs to be configured for the ChemShell executable.
|
|
91
90
|
The following is an example of a basic YAML configuration file:
|
|
92
91
|
|
|
93
92
|
```yaml
|
|
@@ -109,30 +108,31 @@ step. The code can then be configured by running:
|
|
|
109
108
|
verdi code create core.code.installed --config chemshell.yml -n
|
|
110
109
|
```
|
|
111
110
|
|
|
112
|
-
If successful this will have created a code with the label `chemsh` which can then be used to run ChemShell jobs within the AiiDA workflow.
|
|
111
|
+
If successful this will have created a code with the label `chemsh` which can then be used to run ChemShell jobs within the AiiDA workflow.
|
|
113
112
|
|
|
114
113
|
### ChemShell with MPI
|
|
115
114
|
|
|
116
|
-
It is important to note that the configuration of an MPI enabled ChemShell code differs slightly depending on whether the code instance uses
|
|
115
|
+
It is important to note that the configuration of an MPI enabled ChemShell code differs slightly depending on whether the code instance uses
|
|
117
116
|
the `chemsh` or `chemsh.x` executable. If you have a parallel (MPI enabled) build of ChemShell but are using the `chemsh` wrapper executable
|
|
118
117
|
please set `with_mpi: false` as the underlying plugin will handle how to call the mpi runtime. If you are calling the `chemsh.x` executable
|
|
119
|
-
directly then `with_mpi: true` is required to run parallel jobs.
|
|
118
|
+
directly then `with_mpi: true` is required to run parallel jobs.
|
|
120
119
|
|
|
121
|
-
## Examples
|
|
120
|
+
## Examples
|
|
122
121
|
|
|
123
|
-
### QM Based Single Point Energy
|
|
122
|
+
### QM Based Single Point Energy
|
|
124
123
|
|
|
125
|
-
The following is a python script that will run a Quantum Mechanics based single point energy calculation using the NWChem ChemShell interface.
|
|
126
|
-
The associated structure file can be found in the `tests/data/` folder.
|
|
124
|
+
The following is a python script that will run a Quantum Mechanics based single point energy calculation using the NWChem ChemShell interface.
|
|
125
|
+
The associated structure file can be found in the `tests/data/` folder.
|
|
127
126
|
|
|
128
|
-
```python
|
|
129
|
-
from aiida.engine import run
|
|
127
|
+
```python
|
|
128
|
+
from aiida.engine import run
|
|
130
129
|
from aiida.orm import load_code, SinglefileData, Dict
|
|
131
|
-
from aiida import load_profile
|
|
130
|
+
from aiida import load_profile
|
|
132
131
|
|
|
133
|
-
|
|
132
|
+
# This is not required if running in a verdi shell environment
|
|
133
|
+
load_profile("user_profile")
|
|
134
134
|
|
|
135
|
-
builder = load_code("chemsh").get_builder()
|
|
135
|
+
builder = load_code("chemsh").get_builder()
|
|
136
136
|
builder.structure = SinglefileData(file="/absolute/path/to/water.cjson")
|
|
137
137
|
builder.qm_parameters = Dict({"theory": "NWChem", "method": "HF", "basis": "3-21G"})
|
|
138
138
|
builder.calculation_parameters = Dict({"gradients": False, "hessian": False})
|
|
@@ -142,19 +142,20 @@ results, node = run.get_node(builder)
|
|
|
142
142
|
print("Final Energy = ", results.get("energy"))
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
This can either be run as a script or as directly within a verdi shell python environment.
|
|
145
|
+
This can either be run as a script or as directly within a verdi shell python environment.
|
|
146
146
|
|
|
147
|
-
### QM/MM Based Geometry Optimisation
|
|
147
|
+
### QM/MM Based Geometry Optimisation
|
|
148
148
|
|
|
149
149
|
The following is a python script that will run a combined QM/MM based geometry optimisation using the NWChem and DL_POLY ChemShell interfaces.
|
|
150
|
-
The associated structure and force field files can be found in the `tests/data/` folder.
|
|
150
|
+
The associated structure and force field files can be found in the `tests/data/` folder.
|
|
151
151
|
|
|
152
|
-
```python
|
|
153
|
-
from aiida.engine import run
|
|
152
|
+
```python
|
|
153
|
+
from aiida.engine import run
|
|
154
154
|
from aiida.orm import load_code, SinglefileData, Dict
|
|
155
|
-
from aiida import load_profile
|
|
155
|
+
from aiida import load_profile
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
# This is not required if running in a verdi shell environment
|
|
158
|
+
load_profile("user_profile")
|
|
158
159
|
|
|
159
160
|
builder = load_code("chemsh").get_builder()
|
|
160
161
|
builder.structure = SinglefileData(file="/absolute/path/to/h2o_dimer.cjson")
|
|
@@ -7,30 +7,28 @@
|
|
|
7
7
|
|
|
8
8
|
[](https://doi.org/10.5281/zenodo.18392782)
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
# AiiDA ChemShell
|
|
12
11
|
|
|
13
|
-
An [AiiDA](https://www.aiida.net) plugin for the [ChemShell](https://chemshell.org/) multiscale
|
|
14
|
-
computational chemistry software package.
|
|
12
|
+
An [AiiDA](https://www.aiida.net) plugin for the [ChemShell](https://chemshell.org/) multiscale
|
|
13
|
+
computational chemistry software package.
|
|
15
14
|
|
|
16
|
-
## Installation
|
|
15
|
+
## Installation
|
|
17
16
|
|
|
18
|
-
This plugin is available through PyPI and should be installed using [`pip`](https://pip.pypa.io/en/stable/) python package manager.
|
|
17
|
+
This plugin is available through PyPI and should be installed using [`pip`](https://pip.pypa.io/en/stable/) python package manager.
|
|
19
18
|
|
|
20
|
-
```
|
|
19
|
+
``` bash
|
|
21
20
|
pip install aiida-chemshell
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
## Requirements
|
|
25
|
-
|
|
26
|
-
To use this plugin a configured AiiDA profile and computer configuration are required, see the
|
|
27
|
-
[AiiDa documentation](https://aiida.readthedocs.io/projects/aiida-core/en/latest/intro/get_started.html)
|
|
28
|
-
for instructions on how to install and configure AiiDA.
|
|
23
|
+
## Requirements
|
|
29
24
|
|
|
25
|
+
To use this plugin a configured AiiDA profile and computer configuration are required, see the
|
|
26
|
+
[AiiDa documentation](https://aiida.readthedocs.io/projects/aiida-core/en/latest/intro/get_started.html)
|
|
27
|
+
for instructions on how to install and configure AiiDA.
|
|
30
28
|
|
|
31
|
-
## Setup
|
|
29
|
+
## Setup
|
|
32
30
|
|
|
33
|
-
To configure the ChemShell plugin an AiiDA code instance needs to be configured for the ChemShell executable.
|
|
31
|
+
To configure the ChemShell plugin an AiiDA code instance needs to be configured for the ChemShell executable.
|
|
34
32
|
The following is an example of a basic YAML configuration file:
|
|
35
33
|
|
|
36
34
|
```yaml
|
|
@@ -52,30 +50,31 @@ step. The code can then be configured by running:
|
|
|
52
50
|
verdi code create core.code.installed --config chemshell.yml -n
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
If successful this will have created a code with the label `chemsh` which can then be used to run ChemShell jobs within the AiiDA workflow.
|
|
53
|
+
If successful this will have created a code with the label `chemsh` which can then be used to run ChemShell jobs within the AiiDA workflow.
|
|
56
54
|
|
|
57
55
|
### ChemShell with MPI
|
|
58
56
|
|
|
59
|
-
It is important to note that the configuration of an MPI enabled ChemShell code differs slightly depending on whether the code instance uses
|
|
57
|
+
It is important to note that the configuration of an MPI enabled ChemShell code differs slightly depending on whether the code instance uses
|
|
60
58
|
the `chemsh` or `chemsh.x` executable. If you have a parallel (MPI enabled) build of ChemShell but are using the `chemsh` wrapper executable
|
|
61
59
|
please set `with_mpi: false` as the underlying plugin will handle how to call the mpi runtime. If you are calling the `chemsh.x` executable
|
|
62
|
-
directly then `with_mpi: true` is required to run parallel jobs.
|
|
60
|
+
directly then `with_mpi: true` is required to run parallel jobs.
|
|
63
61
|
|
|
64
|
-
## Examples
|
|
62
|
+
## Examples
|
|
65
63
|
|
|
66
|
-
### QM Based Single Point Energy
|
|
64
|
+
### QM Based Single Point Energy
|
|
67
65
|
|
|
68
|
-
The following is a python script that will run a Quantum Mechanics based single point energy calculation using the NWChem ChemShell interface.
|
|
69
|
-
The associated structure file can be found in the `tests/data/` folder.
|
|
66
|
+
The following is a python script that will run a Quantum Mechanics based single point energy calculation using the NWChem ChemShell interface.
|
|
67
|
+
The associated structure file can be found in the `tests/data/` folder.
|
|
70
68
|
|
|
71
|
-
```python
|
|
72
|
-
from aiida.engine import run
|
|
69
|
+
```python
|
|
70
|
+
from aiida.engine import run
|
|
73
71
|
from aiida.orm import load_code, SinglefileData, Dict
|
|
74
|
-
from aiida import load_profile
|
|
72
|
+
from aiida import load_profile
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
# This is not required if running in a verdi shell environment
|
|
75
|
+
load_profile("user_profile")
|
|
77
76
|
|
|
78
|
-
builder = load_code("chemsh").get_builder()
|
|
77
|
+
builder = load_code("chemsh").get_builder()
|
|
79
78
|
builder.structure = SinglefileData(file="/absolute/path/to/water.cjson")
|
|
80
79
|
builder.qm_parameters = Dict({"theory": "NWChem", "method": "HF", "basis": "3-21G"})
|
|
81
80
|
builder.calculation_parameters = Dict({"gradients": False, "hessian": False})
|
|
@@ -85,19 +84,20 @@ results, node = run.get_node(builder)
|
|
|
85
84
|
print("Final Energy = ", results.get("energy"))
|
|
86
85
|
```
|
|
87
86
|
|
|
88
|
-
This can either be run as a script or as directly within a verdi shell python environment.
|
|
87
|
+
This can either be run as a script or as directly within a verdi shell python environment.
|
|
89
88
|
|
|
90
|
-
### QM/MM Based Geometry Optimisation
|
|
89
|
+
### QM/MM Based Geometry Optimisation
|
|
91
90
|
|
|
92
91
|
The following is a python script that will run a combined QM/MM based geometry optimisation using the NWChem and DL_POLY ChemShell interfaces.
|
|
93
|
-
The associated structure and force field files can be found in the `tests/data/` folder.
|
|
92
|
+
The associated structure and force field files can be found in the `tests/data/` folder.
|
|
94
93
|
|
|
95
|
-
```python
|
|
96
|
-
from aiida.engine import run
|
|
94
|
+
```python
|
|
95
|
+
from aiida.engine import run
|
|
97
96
|
from aiida.orm import load_code, SinglefileData, Dict
|
|
98
|
-
from aiida import load_profile
|
|
97
|
+
from aiida import load_profile
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
# This is not required if running in a verdi shell environment
|
|
100
|
+
load_profile("user_profile")
|
|
101
101
|
|
|
102
102
|
builder = load_code("chemsh").get_builder()
|
|
103
103
|
builder.structure = SinglefileData(file="/absolute/path/to/h2o_dimer.cjson")
|
|
@@ -3,7 +3,7 @@ requires = ["setuptools"]
|
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
|
-
version = "0.
|
|
6
|
+
version = "0.3.1"
|
|
7
7
|
name = "aiida-chemshell"
|
|
8
8
|
description = "AiiDA workflow plugin for the ChemShell chemical modelling software package"
|
|
9
9
|
authors = [
|
|
@@ -46,11 +46,23 @@ dev = [
|
|
|
46
46
|
"aiida-core>=2.8",
|
|
47
47
|
"pytest>=8.0",
|
|
48
48
|
"pytest-cov>=6.0",
|
|
49
|
+
"pytest-xdist>=3.0",
|
|
49
50
|
"ruff>=0.11.0",
|
|
50
51
|
"pre-commit",
|
|
51
52
|
]
|
|
52
53
|
docs = ["sphinx>=8.0.2", "piccolo-theme>=0.14.0", "sphinx-toolbox", "numpydoc"]
|
|
53
54
|
|
|
55
|
+
[tool.pytest.ini_options]
|
|
56
|
+
filterwarnings = [
|
|
57
|
+
# Third-party warnings we cannot act on and that only add noise:
|
|
58
|
+
# plumpy still calls the deprecated asyncio.get_event_loop().
|
|
59
|
+
"ignore:There is no current event loop:DeprecationWarning",
|
|
60
|
+
# AiiDA's SQLAlchemy storage backend emits autoflush session warnings.
|
|
61
|
+
"ignore::sqlalchemy.exc.SAWarning",
|
|
62
|
+
# AiiDA reports creating its config folder inside the temp test profile.
|
|
63
|
+
"ignore:Creating AiiDA configuration folder:UserWarning",
|
|
64
|
+
]
|
|
65
|
+
|
|
54
66
|
[tool.ruff]
|
|
55
67
|
target-version = "py310"
|
|
56
68
|
line-length = 88
|
|
@@ -36,6 +36,47 @@ class ChemShellCalculation(CalcJob):
|
|
|
36
36
|
FILE_TRJPTH = "path.xyz"
|
|
37
37
|
FILE_TRJFRC = "path_force.xyz"
|
|
38
38
|
|
|
39
|
+
# Default labels and descriptions applied to input nodes that do not already
|
|
40
|
+
# have them set, keyed by the input port name.
|
|
41
|
+
DEFAULT_INPUT_TAGS = {
|
|
42
|
+
"structure": (
|
|
43
|
+
"Input Chemical Structure",
|
|
44
|
+
"The input structure for the ChemShell calculation.",
|
|
45
|
+
),
|
|
46
|
+
"structure_index": (
|
|
47
|
+
"Structure Input Index",
|
|
48
|
+
"Index used to select a structure from a multi-structure input.",
|
|
49
|
+
),
|
|
50
|
+
"structure2": (
|
|
51
|
+
"Secondary Input Structure",
|
|
52
|
+
"The additional (final) input structure for the ChemShell calculation.",
|
|
53
|
+
),
|
|
54
|
+
"calculation_parameters": (
|
|
55
|
+
"ChemShell Calculation Parameters",
|
|
56
|
+
"Base parameters for the ChemShell Task object.",
|
|
57
|
+
),
|
|
58
|
+
"optimisation_parameters": (
|
|
59
|
+
"ChemShell Optimisation Parameters",
|
|
60
|
+
"Parameters for the ChemShell geometry optimisation task.",
|
|
61
|
+
),
|
|
62
|
+
"qm_parameters": (
|
|
63
|
+
"ChemShell QM Parameters",
|
|
64
|
+
"Parameters for the ChemShell QM Theory object.",
|
|
65
|
+
),
|
|
66
|
+
"mm_parameters": (
|
|
67
|
+
"ChemShell MM Parameters",
|
|
68
|
+
"Parameters for the ChemShell MM interface.",
|
|
69
|
+
),
|
|
70
|
+
"force_field_file": (
|
|
71
|
+
"ChemShell Force Field File",
|
|
72
|
+
"Force field parameters for the ChemShell MM interface.",
|
|
73
|
+
),
|
|
74
|
+
"qmmm_parameters": (
|
|
75
|
+
"ChemShell QM/MM Parameters",
|
|
76
|
+
"Parameters for the ChemShell QM/MM interface.",
|
|
77
|
+
),
|
|
78
|
+
}
|
|
79
|
+
|
|
39
80
|
@classmethod
|
|
40
81
|
def define(cls, spec: CalcJobProcessSpec) -> None:
|
|
41
82
|
"""
|
|
@@ -136,6 +177,17 @@ class ChemShellCalculation(CalcJob):
|
|
|
136
177
|
required=False,
|
|
137
178
|
help="A dictionary of parameters for the ChemShell QM/MM interface.",
|
|
138
179
|
)
|
|
180
|
+
spec.input(
|
|
181
|
+
"output_structure_as_file",
|
|
182
|
+
valid_type=bool,
|
|
183
|
+
non_db=True,
|
|
184
|
+
default=False,
|
|
185
|
+
help=(
|
|
186
|
+
"If True, the optimised structure is returned as a SinglefileData "
|
|
187
|
+
"node containing a ChemShell '.cjson' file. By default (False) it is "
|
|
188
|
+
"returned as an AiiDA StructureData node."
|
|
189
|
+
),
|
|
190
|
+
)
|
|
139
191
|
|
|
140
192
|
## Calculation outputs
|
|
141
193
|
spec.output(
|
|
@@ -156,12 +208,14 @@ class ChemShellCalculation(CalcJob):
|
|
|
156
208
|
)
|
|
157
209
|
spec.output(
|
|
158
210
|
"optimised_structure",
|
|
159
|
-
valid_type=SinglefileData,
|
|
211
|
+
valid_type=(StructureData, SinglefileData),
|
|
160
212
|
required=False,
|
|
161
213
|
help=(
|
|
162
214
|
"The optimised structure of the given system, if a geometry "
|
|
163
|
-
"optimisation task was configured and successfully completed.
|
|
164
|
-
"
|
|
215
|
+
"optimisation task was configured and successfully completed. By "
|
|
216
|
+
"default this is an AiiDA StructureData node; if the "
|
|
217
|
+
"'output_structure_as_file' input is True it is instead a "
|
|
218
|
+
"SinglefileData node containing a ChemShell '.cjson' file."
|
|
165
219
|
),
|
|
166
220
|
)
|
|
167
221
|
spec.output(
|
|
@@ -209,11 +263,11 @@ class ChemShellCalculation(CalcJob):
|
|
|
209
263
|
)
|
|
210
264
|
spec.output(
|
|
211
265
|
"trajectory_force",
|
|
212
|
-
valid_type=
|
|
266
|
+
valid_type=ArrayData,
|
|
213
267
|
required=False,
|
|
214
268
|
help=(
|
|
215
|
-
"
|
|
216
|
-
"
|
|
269
|
+
"Per-atom forces (natoms, 3) at each step of a geometry optimisation, "
|
|
270
|
+
"stored one array per frame labelled 'Frame {i}'."
|
|
217
271
|
),
|
|
218
272
|
)
|
|
219
273
|
|
|
@@ -324,13 +378,13 @@ class ChemShellCalculation(CalcJob):
|
|
|
324
378
|
return None
|
|
325
379
|
|
|
326
380
|
@classmethod
|
|
327
|
-
def get_valid_calculation_parameter_keys(cls) -> tuple[str]:
|
|
381
|
+
def get_valid_calculation_parameter_keys(cls) -> tuple[str, str]:
|
|
328
382
|
"""
|
|
329
383
|
Return the valid parameter keys for the ChemShell Single Point calculation.
|
|
330
384
|
|
|
331
385
|
Returns
|
|
332
386
|
-------
|
|
333
|
-
|
|
387
|
+
tuple[str, str]
|
|
334
388
|
A tuple of valid parameter keys for the ChemShell calculation.
|
|
335
389
|
"""
|
|
336
390
|
return ("gradients", "hessian")
|
|
@@ -379,7 +433,7 @@ class ChemShellCalculation(CalcJob):
|
|
|
379
433
|
|
|
380
434
|
Returns
|
|
381
435
|
-------
|
|
382
|
-
|
|
436
|
+
tuple[str]
|
|
383
437
|
A tuple of valid optimisation parameter keys for the ChemShell
|
|
384
438
|
calculation.
|
|
385
439
|
"""
|
|
@@ -437,12 +491,13 @@ class ChemShellCalculation(CalcJob):
|
|
|
437
491
|
@classmethod
|
|
438
492
|
def get_valid_qm_parameter_keys(cls) -> dict:
|
|
439
493
|
"""
|
|
440
|
-
Return a
|
|
494
|
+
Return a dictionary of valid parameter keys for the ChemShell calculation.
|
|
441
495
|
|
|
442
496
|
Returns
|
|
443
497
|
-------
|
|
444
|
-
|
|
445
|
-
A
|
|
498
|
+
dict[str, type]
|
|
499
|
+
A mapping of valid Theory parameter keys to their expected value
|
|
500
|
+
types for the ChemShell calculation.
|
|
446
501
|
"""
|
|
447
502
|
return {
|
|
448
503
|
"theory": str,
|
|
@@ -527,14 +582,21 @@ class ChemShellCalculation(CalcJob):
|
|
|
527
582
|
return None
|
|
528
583
|
|
|
529
584
|
@classmethod
|
|
530
|
-
def get_valid_mm_parameter_keys(cls, theory: str = "") -> dict[str
|
|
585
|
+
def get_valid_mm_parameter_keys(cls, theory: str = "") -> dict[str, type]:
|
|
531
586
|
"""
|
|
532
|
-
Return a
|
|
587
|
+
Return a dictionary of valid parameter keys for the ChemShell MM interface.
|
|
588
|
+
|
|
589
|
+
Parameters
|
|
590
|
+
----------
|
|
591
|
+
theory : str
|
|
592
|
+
The MM theory whose valid parameter keys should be returned (e.g.
|
|
593
|
+
'DL_POLY'). Defaults to an empty string.
|
|
533
594
|
|
|
534
595
|
Returns
|
|
535
596
|
-------
|
|
536
|
-
|
|
537
|
-
A
|
|
597
|
+
dict[str, type]
|
|
598
|
+
A mapping of valid MM parameter keys to their expected value types
|
|
599
|
+
for the ChemShell calculation.
|
|
538
600
|
"""
|
|
539
601
|
if theory == "DL_POLY":
|
|
540
602
|
valid_keys = {
|
|
@@ -754,6 +816,12 @@ class ChemShellCalculation(CalcJob):
|
|
|
754
816
|
Defines the process label to be associated with the created ProcessNode
|
|
755
817
|
stored in the AiiDA database.
|
|
756
818
|
|
|
819
|
+
Parameters
|
|
820
|
+
----------
|
|
821
|
+
node : ProcessNode
|
|
822
|
+
The process (or its ProcessNode) whose inputs are inspected to build
|
|
823
|
+
the label.
|
|
824
|
+
|
|
757
825
|
Returns
|
|
758
826
|
-------
|
|
759
827
|
str
|
|
@@ -933,12 +1001,30 @@ class ChemShellCalculation(CalcJob):
|
|
|
933
1001
|
|
|
934
1002
|
return script
|
|
935
1003
|
|
|
1004
|
+
def apply_default_input_tags(self) -> None:
|
|
1005
|
+
"""
|
|
1006
|
+
Apply default labels and descriptions to the calculation input nodes.
|
|
1007
|
+
|
|
1008
|
+
Iterates over the provided input nodes and, for any node defined in
|
|
1009
|
+
:attr:`DEFAULT_INPUT_TAGS` that does not already have a label or
|
|
1010
|
+
description set, assigns the corresponding default value. Existing
|
|
1011
|
+
labels and descriptions are left untouched.
|
|
1012
|
+
"""
|
|
1013
|
+
for port_name, (label, description) in self.DEFAULT_INPUT_TAGS.items():
|
|
1014
|
+
if port_name not in self.inputs:
|
|
1015
|
+
continue
|
|
1016
|
+
node = self.inputs[port_name]
|
|
1017
|
+
if not node.label:
|
|
1018
|
+
node.label = label
|
|
1019
|
+
if not node.description:
|
|
1020
|
+
node.description = description
|
|
1021
|
+
|
|
936
1022
|
def prepare_for_submission(self, folder: Folder) -> CalcInfo:
|
|
937
1023
|
"""
|
|
938
1024
|
Prepare the ChemShell calculation for submission.
|
|
939
1025
|
|
|
940
|
-
|
|
941
|
-
|
|
1026
|
+
Parameters
|
|
1027
|
+
----------
|
|
942
1028
|
folder : Folder
|
|
943
1029
|
An `aiida.common.folders.Folder` specifying the temporary working
|
|
944
1030
|
directory for the calculation.
|
|
@@ -948,6 +1034,16 @@ class ChemShellCalculation(CalcJob):
|
|
|
948
1034
|
calcInfo : CalcInfo
|
|
949
1035
|
An `aiida.common.CalcInfo` instance.
|
|
950
1036
|
"""
|
|
1037
|
+
# Apply default labels/descriptions to input nodes lacking them
|
|
1038
|
+
self.apply_default_input_tags()
|
|
1039
|
+
|
|
1040
|
+
# Record the (non_db) output structure format choice as a node extra so
|
|
1041
|
+
# that the parser can determine whether to return the optimised structure
|
|
1042
|
+
# as a StructureData or SinglefileData node.
|
|
1043
|
+
self.node.base.extras.set(
|
|
1044
|
+
"output_structure_as_file", bool(self.inputs.output_structure_as_file)
|
|
1045
|
+
)
|
|
1046
|
+
|
|
951
1047
|
# Create the ChemShell input script
|
|
952
1048
|
input_script = self.chemsh_script_generator()
|
|
953
1049
|
with folder.open(ChemShellCalculation.FILE_SCRIPT, "w") as f:
|