GraphAtoms 1.1.5__tar.gz → 1.2.0__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.
- {graphatoms-1.1.5 → graphatoms-1.2.0}/PKG-INFO +19 -7
- {graphatoms-1.1.5 → graphatoms-1.2.0}/README.md +18 -6
- {graphatoms-1.1.5 → graphatoms-1.2.0}/pyproject.toml +5 -2
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/arrayapi/__init__.py +2 -2
- graphatoms-1.1.5/src/graphatoms/arrayapi/_array_api_compat.py → graphatoms-1.2.0/src/graphatoms/arrayapi/compat.py +1 -1
- graphatoms-1.2.0/src/graphatoms/dataclasses/__init__.py +13 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/dataclasses/_pydanticMixin.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/dataclasses/_pydanticModel.py +4 -2
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/dataclasses/graph.py +7 -3
- graphatoms-1.2.0/src/graphatoms/geometry/__init__.py +11 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/_bond_list.py +4 -4
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/_inner_outer.py +4 -2
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/_neighbor_list.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/mic.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/__init__.py +2 -2
- graphatoms-1.2.0/src/graphatoms/reaction/base/__init__.py +9 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/base/rtgp.py +5 -6
- graphatoms-1.2.0/src/graphatoms/reaction/event/__init__.py +12 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/event/_event.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/event/adsorption.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/event/desorption.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/event/reaction.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/__init__.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/_base.py +9 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/_moveFB.py +5 -4
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/_moveSP.py +5 -4
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/_moveSwap.py +4 -4
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/_simNVT.py +6 -6
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/zzz.py +1 -1
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mdwarpper/__init__.py +2 -2
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/network/_base.py +2 -3
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/system/__init__.py +5 -7
- graphatoms-1.1.5/src/graphatoms/system/atoms/_eng.py → graphatoms-1.2.0/src/graphatoms/system/atoms.py +237 -6
- graphatoms-1.1.5/src/graphatoms/system/graph/_bonds.py → graphatoms-1.2.0/src/graphatoms/system/bonds.py +9 -7
- graphatoms-1.1.5/src/graphatoms/system/graph/_sysGraph.py → graphatoms-1.2.0/src/graphatoms/system/graph.py +86 -17
- graphatoms-1.2.0/src/graphatoms/system/sysCluster.py +180 -0
- graphatoms-1.1.5/src/graphatoms/system/_sysGas.py → graphatoms-1.2.0/src/graphatoms/system/sysGas.py +71 -15
- graphatoms-1.2.0/src/graphatoms/system/system.py +83 -0
- graphatoms-1.2.0/src/graphatoms/utils/subgraph.py +193 -0
- graphatoms-1.1.5/src/graphatoms/dataclasses/__init__.py +0 -13
- graphatoms-1.1.5/src/graphatoms/geometry/__init__.py +0 -11
- graphatoms-1.1.5/src/graphatoms/reaction/base/__init__.py +0 -9
- graphatoms-1.1.5/src/graphatoms/reaction/event/__init__.py +0 -12
- graphatoms-1.1.5/src/graphatoms/system/_sysCluster.py +0 -121
- graphatoms-1.1.5/src/graphatoms/system/atoms/__init__.py +0 -7
- graphatoms-1.1.5/src/graphatoms/system/atoms/_box.py +0 -84
- graphatoms-1.1.5/src/graphatoms/system/atoms/_struct.py +0 -166
- graphatoms-1.1.5/src/graphatoms/system/graph/__init__.py +0 -11
- graphatoms-1.1.5/src/graphatoms/system/graph/_gasMixin.py +0 -44
- graphatoms-1.1.5/src/graphatoms/system/helper.py +0 -112
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/LICENSE +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/__init__.py +0 -0
- /graphatoms-1.1.5/src/graphatoms/arrayapi/_array_api_typing.py → /graphatoms-1.2.0/src/graphatoms/arrayapi/typing.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/dataclasses/_numpydantic.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/dataclasses/_pydantic2pyarrow.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/_distance_pairs.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/rotation.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/geometry/sample.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/base/move.py +0 -0
- {graphatoms-1.1.5/src/graphatoms/system → graphatoms-1.2.0/src/graphatoms/reaction}/database/__init__.py +0 -0
- {graphatoms-1.1.5/src/graphatoms/system → graphatoms-1.2.0/src/graphatoms/reaction}/database/base.py +0 -0
- {graphatoms-1.1.5/src/graphatoms/system → graphatoms-1.2.0/src/graphatoms/reaction}/database/hdf5.py +0 -0
- {graphatoms-1.1.5/src/graphatoms/system → graphatoms-1.2.0/src/graphatoms/reaction}/database/sqliteASE.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/_abc.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/test_mmc.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/mcmove/test_move.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/reaction/network/__init__.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/utils/__init__.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/utils/bytestool.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/utils/logger.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/utils/parser.py +0 -0
- {graphatoms-1.1.5 → graphatoms-1.2.0}/src/graphatoms/utils/rdutils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphatoms
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: The Chemical Core Class for Graph Theory Analysis.
|
|
5
5
|
Keywords: chemistry,graph theory,reaction,event,KMC
|
|
6
6
|
Author: LiuGaoyong
|
|
@@ -39,7 +39,6 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
|
|
40
40
|
[](https://anaconda.org/conda-forge/graphatoms) [](https://anaconda.org/conda-forge/graphatoms) [](https://pypi.org/project/graphatoms/) [](https://pepy.tech/projects/graphatoms)
|
|
41
41
|
|
|
42
|
-
|
|
43
42
|
The Chemical Core Class for Graph Theory Analysis.
|
|
44
43
|
|
|
45
44
|
## Overview
|
|
@@ -53,7 +52,8 @@ The `graphatoms` is a Python library designed for chemical graph theory analysis
|
|
|
53
52
|
- **Geometry Operations**: Bond lists, distance calculations, neighbor lists, rotations, MIC (Minimum Image Convention), and sampling
|
|
54
53
|
- **Data Storage**: Support for HDF5 and SQLite databases for efficient data persistence
|
|
55
54
|
- **Dataclasses**: Pydantic-based data models for type-safe data handling
|
|
56
|
-
- **Array API Compatibility**:
|
|
55
|
+
- **Array API Compatibility**: Full support for array API standard for cross-framework compatibility (NumPy, PyTorch, JAX, CuPy, etc.)
|
|
56
|
+
- **Subgraph Operations**: Backend-agnostic subgraph extraction with relabeling support using array-api-compat and array-api-extra
|
|
57
57
|
|
|
58
58
|
## Module Structure
|
|
59
59
|
|
|
@@ -73,6 +73,7 @@ src/graphatoms/
|
|
|
73
73
|
│ ├── database/ # Database storage backends
|
|
74
74
|
│ └── graph/ # Graph-based system representation
|
|
75
75
|
└── utils/ # Utility functions
|
|
76
|
+
└── subgraph.py # Array API compatible subgraph operations
|
|
76
77
|
```
|
|
77
78
|
|
|
78
79
|
## Requirements
|
|
@@ -82,8 +83,8 @@ src/graphatoms/
|
|
|
82
83
|
- pymatgen > 2023.6
|
|
83
84
|
- rdkit >= 2025
|
|
84
85
|
- scikit-learn >= 1.5
|
|
85
|
-
- array-api-compat >= 1.
|
|
86
|
-
- array-api-extra >= 0.
|
|
86
|
+
- array-api-compat >= 1.15.0
|
|
87
|
+
- array-api-extra >= 0.11.0
|
|
87
88
|
- pyarrow
|
|
88
89
|
- igraph >= 0.11
|
|
89
90
|
- h5py >= 3.16
|
|
@@ -118,13 +119,24 @@ pixi run test
|
|
|
118
119
|
|
|
119
120
|
## Running Tests
|
|
120
121
|
|
|
121
|
-
```bash
|
|
122
122
|
# Run all tests
|
|
123
|
+
|
|
123
124
|
pytest src/tests/ -v
|
|
124
125
|
|
|
125
126
|
# Run benchmark tests
|
|
127
|
+
|
|
126
128
|
pytest src/tests-benchmark/ -v
|
|
127
|
-
|
|
129
|
+
|
|
130
|
+
## Array API Compatibility
|
|
131
|
+
|
|
132
|
+
The library leverages `array-api-compat` and `array-api-extra` for backend-agnostic array operations. Key utilities include:
|
|
133
|
+
|
|
134
|
+
- `subgraph()`: Extracts induced subgraphs from edge indices
|
|
135
|
+
- `map_index()`: Maps indices across arrays
|
|
136
|
+
- `index_to_mask()`: Converts index arrays to boolean masks
|
|
137
|
+
- `maybe_num_nodes()`: Determines the number of nodes from edge indices
|
|
138
|
+
|
|
139
|
+
These functions work seamlessly with NumPy, PyTorch, JAX, and other array API compliant libraries.
|
|
128
140
|
|
|
129
141
|
## License
|
|
130
142
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://anaconda.org/conda-forge/graphatoms) [](https://anaconda.org/conda-forge/graphatoms) [](https://pypi.org/project/graphatoms/) [](https://pepy.tech/projects/graphatoms)
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
The Chemical Core Class for Graph Theory Analysis.
|
|
7
6
|
|
|
8
7
|
## Overview
|
|
@@ -16,7 +15,8 @@ The `graphatoms` is a Python library designed for chemical graph theory analysis
|
|
|
16
15
|
- **Geometry Operations**: Bond lists, distance calculations, neighbor lists, rotations, MIC (Minimum Image Convention), and sampling
|
|
17
16
|
- **Data Storage**: Support for HDF5 and SQLite databases for efficient data persistence
|
|
18
17
|
- **Dataclasses**: Pydantic-based data models for type-safe data handling
|
|
19
|
-
- **Array API Compatibility**:
|
|
18
|
+
- **Array API Compatibility**: Full support for array API standard for cross-framework compatibility (NumPy, PyTorch, JAX, CuPy, etc.)
|
|
19
|
+
- **Subgraph Operations**: Backend-agnostic subgraph extraction with relabeling support using array-api-compat and array-api-extra
|
|
20
20
|
|
|
21
21
|
## Module Structure
|
|
22
22
|
|
|
@@ -36,6 +36,7 @@ src/graphatoms/
|
|
|
36
36
|
│ ├── database/ # Database storage backends
|
|
37
37
|
│ └── graph/ # Graph-based system representation
|
|
38
38
|
└── utils/ # Utility functions
|
|
39
|
+
└── subgraph.py # Array API compatible subgraph operations
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
## Requirements
|
|
@@ -45,8 +46,8 @@ src/graphatoms/
|
|
|
45
46
|
- pymatgen > 2023.6
|
|
46
47
|
- rdkit >= 2025
|
|
47
48
|
- scikit-learn >= 1.5
|
|
48
|
-
- array-api-compat >= 1.
|
|
49
|
-
- array-api-extra >= 0.
|
|
49
|
+
- array-api-compat >= 1.15.0
|
|
50
|
+
- array-api-extra >= 0.11.0
|
|
50
51
|
- pyarrow
|
|
51
52
|
- igraph >= 0.11
|
|
52
53
|
- h5py >= 3.16
|
|
@@ -81,13 +82,24 @@ pixi run test
|
|
|
81
82
|
|
|
82
83
|
## Running Tests
|
|
83
84
|
|
|
84
|
-
```bash
|
|
85
85
|
# Run all tests
|
|
86
|
+
|
|
86
87
|
pytest src/tests/ -v
|
|
87
88
|
|
|
88
89
|
# Run benchmark tests
|
|
90
|
+
|
|
89
91
|
pytest src/tests-benchmark/ -v
|
|
90
|
-
|
|
92
|
+
|
|
93
|
+
## Array API Compatibility
|
|
94
|
+
|
|
95
|
+
The library leverages `array-api-compat` and `array-api-extra` for backend-agnostic array operations. Key utilities include:
|
|
96
|
+
|
|
97
|
+
- `subgraph()`: Extracts induced subgraphs from edge indices
|
|
98
|
+
- `map_index()`: Maps indices across arrays
|
|
99
|
+
- `index_to_mask()`: Converts index arrays to boolean masks
|
|
100
|
+
- `maybe_num_nodes()`: Determines the number of nodes from edge indices
|
|
101
|
+
|
|
102
|
+
These functions work seamlessly with NumPy, PyTorch, JAX, and other array API compliant libraries.
|
|
91
103
|
|
|
92
104
|
## License
|
|
93
105
|
|
|
@@ -9,7 +9,7 @@ Issues = "https://github.com/LiuGaoyong/GraphAtoms/issues/"
|
|
|
9
9
|
|
|
10
10
|
[project]
|
|
11
11
|
name = "graphatoms"
|
|
12
|
-
version = "1.
|
|
12
|
+
version = "1.2.0"
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
description = "The Chemical Core Class for Graph Theory Analysis."
|
|
15
15
|
authors = [{ name = "LiuGaoyong", email = "liugaoyong_88@163.com" }]
|
|
@@ -89,6 +89,7 @@ filterwarnings = [
|
|
|
89
89
|
# ignore the following warnings that matching a regex
|
|
90
90
|
# example: 'ignore:function ham\(\) is deprecated:DeprecationWarning',
|
|
91
91
|
"ignore::RuntimeWarning",
|
|
92
|
+
"ignore::DeprecationWarning",
|
|
92
93
|
|
|
93
94
|
]
|
|
94
95
|
addopts = '--maxfail=1 -rf' # exit after 1 failures, report fail info
|
|
@@ -98,7 +99,9 @@ testpaths = ['src/tests']
|
|
|
98
99
|
[tool.ruff]
|
|
99
100
|
line-length = 80
|
|
100
101
|
indent-width = 4
|
|
101
|
-
|
|
102
|
+
unsafe-fixes = true
|
|
103
|
+
[tool.ruff.lint]
|
|
104
|
+
select = ["F", "E", "W", "UP", "TID"]
|
|
102
105
|
ignore = ["F722", "D100"]
|
|
103
106
|
[tool.ruff.lint.pydocstyle]
|
|
104
107
|
convention = "google"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""The array api wrapper of this packages."""
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
from .
|
|
3
|
+
from graphatoms.arrayapi.compat import get_namespace
|
|
4
|
+
from graphatoms.arrayapi.typing import Array, ArrayNamespace, LinalgNamespace
|
|
5
5
|
|
|
6
6
|
__all__ = [
|
|
7
7
|
"get_namespace",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""The extended dataclasses by pydantic & numpydantic."""
|
|
2
|
+
|
|
3
|
+
from graphatoms.dataclasses._numpydantic import NDArray, numpy_validator
|
|
4
|
+
from graphatoms.dataclasses._pydantic2pyarrow import get_pyarrow_schema
|
|
5
|
+
from graphatoms.dataclasses._pydanticModel import OurBaseModel, OurFrozenModel
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"NDArray",
|
|
9
|
+
"numpy_validator",
|
|
10
|
+
"get_pyarrow_schema",
|
|
11
|
+
"OurFrozenModel",
|
|
12
|
+
"OurBaseModel",
|
|
13
|
+
]
|
|
@@ -10,7 +10,7 @@ import yaml
|
|
|
10
10
|
from joblib import dump, load
|
|
11
11
|
from omegaconf import OmegaConf
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from graphatoms.utils import bytestool as bytesutils
|
|
14
14
|
|
|
15
15
|
if version_info < (3, 11): # type: ignore # noqa: UP036
|
|
16
16
|
import tomli as tomllib # type: ignore
|
|
@@ -10,8 +10,10 @@ import pydantic
|
|
|
10
10
|
from numpy.typing import ArrayLike
|
|
11
11
|
from pyarrow import Schema
|
|
12
12
|
|
|
13
|
-
from ._pydantic2pyarrow import get_pyarrow_schema
|
|
14
|
-
from ._pydanticMixin import
|
|
13
|
+
from graphatoms.dataclasses._pydantic2pyarrow import get_pyarrow_schema
|
|
14
|
+
from graphatoms.dataclasses._pydanticMixin import (
|
|
15
|
+
PydanticIoFactoryMixin as PydanticFactoryMixin,
|
|
16
|
+
)
|
|
15
17
|
|
|
16
18
|
__all__ = ["OurBaseModel", "OurFrozenModel"]
|
|
17
19
|
|
|
@@ -3,9 +3,13 @@ from typing import Annotated, Self
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
import pydantic
|
|
5
5
|
|
|
6
|
-
from ._numpydantic import NDArray, numpy_validator
|
|
7
|
-
from ._pydanticMixin import
|
|
8
|
-
|
|
6
|
+
from graphatoms.dataclasses._numpydantic import NDArray, numpy_validator
|
|
7
|
+
from graphatoms.dataclasses._pydanticMixin import (
|
|
8
|
+
PydanticIoFactoryMixin as PydanticMixin,
|
|
9
|
+
)
|
|
10
|
+
from graphatoms.dataclasses._pydanticModel import (
|
|
11
|
+
_IndexMaskMixin as IndexMaskMixin,
|
|
12
|
+
)
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
class Graph(PydanticMixin, IndexMaskMixin):
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Geometry."""
|
|
2
|
+
|
|
3
|
+
from graphatoms.geometry._bond_list import bond_list
|
|
4
|
+
from graphatoms.geometry._distance_pairs import distance_pairs
|
|
5
|
+
from graphatoms.geometry._neighbor_list import neighbor_list
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"bond_list",
|
|
9
|
+
"neighbor_list",
|
|
10
|
+
"distance_pairs",
|
|
11
|
+
]
|
|
@@ -9,9 +9,9 @@ from pymatgen.core.structure import Molecule, Structure
|
|
|
9
9
|
from pymatgen.io.ase import AseAtomsAdaptor
|
|
10
10
|
from scipy import sparse as sp
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from .
|
|
12
|
+
from graphatoms.geometry._neighbor_list import neighbor_list
|
|
13
|
+
from graphatoms.utils.parser import DictConfig, hydra_parse
|
|
14
|
+
from graphatoms.utils.rdutils import get_adjacency_by_rdkit
|
|
15
15
|
|
|
16
16
|
try:
|
|
17
17
|
with warnings.catch_warnings():
|
|
@@ -107,7 +107,7 @@ def bond_list(
|
|
|
107
107
|
f"The method of `{method}` is not supported." #
|
|
108
108
|
"Please use `raw` or `pymatgen`."
|
|
109
109
|
)
|
|
110
|
-
assert edges.ndim == 2 and edges.shape[1] == 2, (
|
|
110
|
+
assert edges.ndim == 2 and edges.shape[1] == 2, ( # type: ignore
|
|
111
111
|
f"The edges must be Nx2 array. But {edges.shape} got."
|
|
112
112
|
)
|
|
113
113
|
matrix = sp.csr_matrix(
|
|
@@ -5,8 +5,10 @@ from ase.cell import Cell
|
|
|
5
5
|
from ase.data import covalent_radii as COV_R
|
|
6
6
|
from scipy import sparse as sp
|
|
7
7
|
|
|
8
|
-
from ._distance_pairs import distance_pairs
|
|
9
|
-
from .sample import
|
|
8
|
+
from graphatoms.geometry._distance_pairs import distance_pairs
|
|
9
|
+
from graphatoms.geometry.sample import (
|
|
10
|
+
fibonacci_lattice as inverse_3d_sphere_surface_sampling,
|
|
11
|
+
)
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
def check_atom_is_inner( # noqa: D417
|
|
@@ -6,7 +6,7 @@ from ase.neighborlist import build_neighbor_list as __build_neighbor_list_ase
|
|
|
6
6
|
from ase.neighborlist import neighbor_list as _ase_neighbor_list_3loop
|
|
7
7
|
from numpy.typing import ArrayLike
|
|
8
8
|
|
|
9
|
-
from ._distance_pairs import distance_pairs
|
|
9
|
+
from graphatoms.geometry._distance_pairs import distance_pairs
|
|
10
10
|
|
|
11
11
|
__all__ = ["neighbor_list"]
|
|
12
12
|
|
|
@@ -3,7 +3,7 @@ import itertools
|
|
|
3
3
|
import array_api_extra as xpx
|
|
4
4
|
|
|
5
5
|
from graphatoms.arrayapi import Array, ArrayNamespace, get_namespace
|
|
6
|
-
from graphatoms.arrayapi.
|
|
6
|
+
from graphatoms.arrayapi.typing import LinalgNamespace
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def pbc2pbc(pbc: bool, np: ArrayNamespace) -> Array:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""The definition of reaction classes."""
|
|
2
2
|
|
|
3
3
|
# ruff: noqa: F401
|
|
4
|
-
from .base import RTGP, MoveABC
|
|
5
|
-
from .base.rtgp import (
|
|
4
|
+
from graphatoms.reaction.base import RTGP, MoveABC
|
|
5
|
+
from graphatoms.reaction.base.rtgp import (
|
|
6
6
|
DEFAULT_CHECK_MINIMA_FMAX,
|
|
7
7
|
DEFAULT_CHECK_MINIMA_FQMIN,
|
|
8
8
|
DEFAULT_CHECK_TS_FMAX,
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
from abc import abstractmethod
|
|
2
2
|
from functools import cached_property
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import override
|
|
4
|
+
from typing import Self, override
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
from ase import Atoms
|
|
8
8
|
from pydantic import model_validator
|
|
9
|
-
from typing_extensions import Self
|
|
10
9
|
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from .
|
|
10
|
+
from graphatoms.dataclasses import OurFrozenModel
|
|
11
|
+
from graphatoms.reaction.base.move import MoveABC
|
|
12
|
+
from graphatoms.system import DEFAULT_WH_HASH_DEPTH, Gas, SysGraph
|
|
13
|
+
from graphatoms.utils.bytestool import hash_string
|
|
15
14
|
|
|
16
15
|
DEFAULT_CHECK_MINIMA_FMAX = 0.05 # eV/Å
|
|
17
16
|
DEFAULT_CHECK_MINIMA_FQMIN = 30.0 # cm^-1
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# ruff: noqa: F401
|
|
2
|
+
|
|
3
|
+
from graphatoms.reaction.event.adsorption import Adsorption
|
|
4
|
+
from graphatoms.reaction.event.desorption import Desorption
|
|
5
|
+
from graphatoms.reaction.event.reaction import ReactionER, ReactionLH
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"Adsorption",
|
|
9
|
+
"ReactionLH",
|
|
10
|
+
"ReactionER",
|
|
11
|
+
"Desorption",
|
|
12
|
+
]
|
|
@@ -8,7 +8,15 @@ from ase import Atoms
|
|
|
8
8
|
from ase.calculators.calculator import Calculator
|
|
9
9
|
from pydantic import BaseModel
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
@dataclass(slots=True)
|
|
13
|
+
class MonteCarloState:
|
|
14
|
+
"""The base class for all Monte Carlo states."""
|
|
15
|
+
|
|
16
|
+
atoms: Atoms
|
|
17
|
+
|
|
18
|
+
def __post_init__(self) -> None:
|
|
19
|
+
pass
|
|
12
20
|
|
|
13
21
|
|
|
14
22
|
@dataclass(slots=True)
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
See Details in the paper: https://doi.org/10.1063/1.2745293
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
+
from typing import override
|
|
7
|
+
|
|
6
8
|
import numpy as np
|
|
7
9
|
from ase import Atoms
|
|
8
10
|
from ase.calculators.calculator import Calculator
|
|
9
11
|
from ase.geometry.geometry import find_mic
|
|
10
12
|
from ase.units import kB
|
|
11
|
-
from typing_extensions import override
|
|
12
13
|
|
|
13
|
-
from ._base import CanonicalState
|
|
14
|
-
from ._base import MonteCarloMove as Move
|
|
15
|
-
from ._base import MonteCarloRecord as Record
|
|
14
|
+
from graphatoms.reaction.mcmove._base import CanonicalState
|
|
15
|
+
from graphatoms.reaction.mcmove._base import MonteCarloMove as Move
|
|
16
|
+
from graphatoms.reaction.mcmove._base import MonteCarloRecord as Record
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class ForceBiasMixin:
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"""The Monte Carlo move for single particle displacement."""
|
|
2
2
|
|
|
3
|
+
from typing import override
|
|
4
|
+
|
|
3
5
|
import numpy as np
|
|
4
6
|
from ase import Atoms
|
|
5
7
|
from ase.calculators.calculator import Calculator
|
|
6
8
|
from ase.geometry.geometry import find_mic
|
|
7
9
|
from ase.units import kB
|
|
8
|
-
from typing_extensions import override
|
|
9
10
|
|
|
10
|
-
from ._base import CanonicalState
|
|
11
|
-
from ._base import MonteCarloMove as Move
|
|
12
|
-
from ._base import MonteCarloRecord as Record
|
|
11
|
+
from graphatoms.reaction.mcmove._base import CanonicalState
|
|
12
|
+
from graphatoms.reaction.mcmove._base import MonteCarloMove as Move
|
|
13
|
+
from graphatoms.reaction.mcmove._base import MonteCarloRecord as Record
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class SPDispC(Move):
|
|
@@ -7,11 +7,11 @@ from ase import Atoms
|
|
|
7
7
|
from ase.calculators.calculator import Calculator
|
|
8
8
|
from ase.data import chemical_symbols, covalent_radii
|
|
9
9
|
from ase.geometry import find_mic
|
|
10
|
-
from vesin._ase import ase_neighbor_list
|
|
11
10
|
|
|
12
|
-
from .
|
|
13
|
-
from ._base import
|
|
14
|
-
from .
|
|
11
|
+
from graphatoms.geometry import neighbor_list as ase_neighbor_list
|
|
12
|
+
from graphatoms.reaction.mcmove._base import CanonicalState
|
|
13
|
+
from graphatoms.reaction.mcmove._base import MonteCarloRecord as Record
|
|
14
|
+
from graphatoms.reaction.mcmove._moveSP import SPDispC
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class NoSwap(RuntimeError):
|
|
@@ -4,12 +4,12 @@ from typing import override
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
from ase.calculators.calculator import Calculator
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from ._base import CanonicalState
|
|
9
|
-
from ._base import MonteCarloRecord as Record
|
|
10
|
-
from ._moveFB import FBDispC
|
|
11
|
-
from ._moveSP import SPDispC
|
|
12
|
-
from ._moveSwap import Swap, SwapCutoff
|
|
7
|
+
from graphatoms.commands.runner3.abc import SimABC
|
|
8
|
+
from graphatoms.reaction.mcmove._base import CanonicalState
|
|
9
|
+
from graphatoms.reaction.mcmove._base import MonteCarloRecord as Record
|
|
10
|
+
from graphatoms.reaction.mcmove._moveFB import FBDispC
|
|
11
|
+
from graphatoms.reaction.mcmove._moveSP import SPDispC
|
|
12
|
+
from graphatoms.reaction.mcmove._moveSwap import Swap, SwapCutoff
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class MonteCarloNVT(SimABC):
|
|
@@ -6,8 +6,8 @@ from ase import Atoms
|
|
|
6
6
|
from ase.calculators.calculator import Calculator
|
|
7
7
|
from ase.md.md import MolecularDynamics
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
9
|
+
from graphatoms.reaction.base.move import MoveABC
|
|
10
|
+
from graphatoms.utils.parser import DictConfig, hydra_parse
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class MDWrapper(MoveABC):
|
|
@@ -6,10 +6,9 @@ from typing import Literal
|
|
|
6
6
|
from igraph import Graph
|
|
7
7
|
from omegaconf import DictConfig, OmegaConf
|
|
8
8
|
|
|
9
|
+
from graphatoms.reaction.database.sqliteASE import AseSqliteDB
|
|
9
10
|
from graphatoms.system import SysGraph
|
|
10
|
-
|
|
11
|
-
from ...system.database.sqliteASE import AseSqliteDB
|
|
12
|
-
from ...utils.logger import LoggerBase
|
|
11
|
+
from graphatoms.utils.logger import LoggerBase
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class RxNetABC(ABC):
|
|
@@ -9,17 +9,15 @@ the base class based on Graph Theory.
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
# ruff: noqa: F401
|
|
12
|
-
from .
|
|
13
|
-
from .
|
|
14
|
-
from .atoms._box import Box
|
|
15
|
-
from .atoms._eng import Energetics
|
|
16
|
-
from .atoms._struct import Matter, Structure
|
|
17
|
-
from .graph._bonds import (
|
|
12
|
+
from graphatoms.system.atoms import Box, Energetics, Matter, Structure
|
|
13
|
+
from graphatoms.system.bonds import (
|
|
18
14
|
DEFAULT_WH_HASH_DEPTH,
|
|
19
15
|
DEFAULT_WH_HASH_SIZE,
|
|
20
16
|
BondGraph,
|
|
21
17
|
)
|
|
22
|
-
from .graph
|
|
18
|
+
from graphatoms.system.graph import SysGraph
|
|
19
|
+
from graphatoms.system.sysCluster import Cluster
|
|
20
|
+
from graphatoms.system.sysGas import Gas, System
|
|
23
21
|
|
|
24
22
|
__all__ = [
|
|
25
23
|
"SysGraph",
|