GraphAtoms 1.2.0__tar.gz → 1.2.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.
Files changed (62) hide show
  1. {graphatoms-1.2.0 → graphatoms-1.2.1}/PKG-INFO +1 -1
  2. graphatoms-1.2.1/pyproject.toml +156 -0
  3. graphatoms-1.2.0/pyproject.toml → graphatoms-1.2.1/pyproject.toml.orig +3 -3
  4. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/bonds.py +5 -3
  5. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/graph.py +6 -1
  6. {graphatoms-1.2.0 → graphatoms-1.2.1}/README.md +0 -0
  7. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/LICENSE +0 -0
  8. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/__init__.py +0 -0
  9. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/arrayapi/__init__.py +0 -0
  10. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/arrayapi/compat.py +0 -0
  11. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/arrayapi/typing.py +0 -0
  12. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/dataclasses/__init__.py +0 -0
  13. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/dataclasses/_numpydantic.py +0 -0
  14. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/dataclasses/_pydantic2pyarrow.py +0 -0
  15. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/dataclasses/_pydanticMixin.py +0 -0
  16. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/dataclasses/_pydanticModel.py +0 -0
  17. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/dataclasses/graph.py +0 -0
  18. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/__init__.py +0 -0
  19. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/_bond_list.py +0 -0
  20. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/_distance_pairs.py +0 -0
  21. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/_inner_outer.py +0 -0
  22. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/_neighbor_list.py +0 -0
  23. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/mic.py +0 -0
  24. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/rotation.py +0 -0
  25. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/geometry/sample.py +0 -0
  26. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/__init__.py +0 -0
  27. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/base/__init__.py +0 -0
  28. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/base/move.py +0 -0
  29. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/base/rtgp.py +0 -0
  30. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/database/__init__.py +0 -0
  31. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/database/base.py +0 -0
  32. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/database/hdf5.py +0 -0
  33. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/database/sqliteASE.py +0 -0
  34. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/event/__init__.py +0 -0
  35. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/event/_event.py +0 -0
  36. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/event/adsorption.py +0 -0
  37. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/event/desorption.py +0 -0
  38. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/event/reaction.py +0 -0
  39. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/__init__.py +0 -0
  40. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/_abc.py +0 -0
  41. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/_base.py +0 -0
  42. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/_moveFB.py +0 -0
  43. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/_moveSP.py +0 -0
  44. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/_moveSwap.py +0 -0
  45. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/_simNVT.py +0 -0
  46. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/test_mmc.py +0 -0
  47. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/test_move.py +0 -0
  48. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mcmove/zzz.py +0 -0
  49. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/mdwarpper/__init__.py +0 -0
  50. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/network/__init__.py +0 -0
  51. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/reaction/network/_base.py +0 -0
  52. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/__init__.py +0 -0
  53. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/atoms.py +0 -0
  54. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/sysCluster.py +0 -0
  55. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/sysGas.py +0 -0
  56. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/system/system.py +0 -0
  57. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/utils/__init__.py +0 -0
  58. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/utils/bytestool.py +0 -0
  59. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/utils/logger.py +0 -0
  60. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/utils/parser.py +0 -0
  61. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/utils/rdutils.py +0 -0
  62. {graphatoms-1.2.0 → graphatoms-1.2.1}/src/graphatoms/utils/subgraph.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphatoms
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: The Chemical Core Class for Graph Theory Analysis.
5
5
  Keywords: chemistry,graph theory,reaction,event,KMC
6
6
  Author: LiuGaoyong
@@ -0,0 +1,156 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.11.15,<0.12"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "graphatoms"
7
+ version = "1.2.1"
8
+ readme = "README.md"
9
+ description = "The Chemical Core Class for Graph Theory Analysis."
10
+ license-files = ["src/LICENSE"]
11
+ license = "GPL-3.0-or-later"
12
+ requires-python = ">=3.12"
13
+ keywords = [
14
+ "chemistry",
15
+ "graph theory",
16
+ "reaction",
17
+ "event",
18
+ "KMC",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 5 - Production/Stable",
22
+ "Topic :: Scientific/Engineering :: Chemistry",
23
+ "Intended Audience :: Science/Research",
24
+ ]
25
+ dependencies = [
26
+ "ase",
27
+ "pymatgen>2023.6",
28
+ "rdkit>=2025",
29
+ "scikit-learn>=1.5",
30
+ "array-api-compat>=1.10",
31
+ "array_api-extra>=0.10",
32
+ "pyarrow",
33
+ "igraph>=0.11",
34
+ "h5py>=3.16",
35
+ "hydra-core",
36
+ "numpy>=2.0.0,<3",
37
+ "numpydantic",
38
+ "ovld",
39
+ "pydantic>=2.10",
40
+ "python-snappy>=0.7.3",
41
+ "tomli; python_version < '3.11'",
42
+ "tomli-w",
43
+ "typing-extensions",
44
+ "loguru",
45
+ ]
46
+
47
+ [project.urls]
48
+ Homepage = "https://github.com/LiuGaoyong/GraphAtoms"
49
+ Repository = "https://github.com/LiuGaoyong/GraphAtoms"
50
+ Issues = "https://github.com/LiuGaoyong/GraphAtoms/issues/"
51
+
52
+ [[project.authors]]
53
+ name = "LiuGaoyong"
54
+ email = "liugaoyong_88@163.com"
55
+
56
+ [dependency-groups]
57
+ dev = [
58
+ "ruff>=0.11",
59
+ "array-api-strict",
60
+ "pytest>=8.3",
61
+ "pytest-xdist",
62
+ "jupyter",
63
+ "sqlmodel",
64
+ "openbabel-wheel",
65
+ ]
66
+
67
+ [tool.uv]
68
+ package = true
69
+
70
+ [[tool.uv.index]]
71
+ url = "https://mirrors.cernet.edu.cn/pypi/web/simple"
72
+ default = true
73
+
74
+ [tool.pytest.ini_options]
75
+ filterwarnings = [
76
+ "error",
77
+ "ignore::RuntimeWarning",
78
+ "ignore::DeprecationWarning",
79
+ ]
80
+ addopts = "--maxfail=1 -rf"
81
+ testpaths = ["src/tests"]
82
+
83
+ [tool.ruff]
84
+ line-length = 80
85
+ indent-width = 4
86
+ unsafe-fixes = true
87
+
88
+ [tool.ruff.lint]
89
+ select = [
90
+ "F",
91
+ "E",
92
+ "W",
93
+ "UP",
94
+ "TID",
95
+ ]
96
+ ignore = [
97
+ "F722",
98
+ "D100",
99
+ ]
100
+
101
+ [tool.ruff.lint.pydocstyle]
102
+ convention = "google"
103
+
104
+ [tool.pixi.package.build.backend]
105
+ name = "pixi-build-python"
106
+ version = "*"
107
+
108
+ [tool.pixi.workspace]
109
+ preview = ["pixi-build"]
110
+ channels = ["conda-forge"]
111
+ platforms = [
112
+ "linux-64",
113
+ "osx-arm64",
114
+ ]
115
+
116
+ [tool.pixi.pypi-dependencies.graphatoms]
117
+ path = "."
118
+ editable = true
119
+
120
+ [tool.pixi.environments.default]
121
+ solve-group = "default"
122
+
123
+ [tool.pixi.environments.dev]
124
+ features = ["dev"]
125
+ solve-group = "default"
126
+
127
+ [tool.pixi.tasks]
128
+ test = "pytest -s -vv"
129
+ benchmark = "pytest -s src/tests-benchmark/*.py"
130
+
131
+ [tool.pixi.dependencies]
132
+ python = ">=3.12"
133
+ pytest = ">=9.0.3,<10"
134
+ array-api-compat = ">=1.15.0,<2"
135
+ array-api-extra = ">=0.11.0,<0.12"
136
+ array-api-strict = ">=2.5,<3"
137
+ ase = ">=3.28.0,<4"
138
+ pymatgen = ">=2026.5.4,<2027"
139
+ rdkit = ">=2025.9.5,<2027"
140
+ openbabel = ">=3.1.1,<4"
141
+ pyarrow = ">=21.0.0,<25"
142
+ scikit-learn = ">=1.8.0,<2"
143
+ python-igraph = ">=0.11.9,<0.12"
144
+ numpy = ">=2.0.0,<3"
145
+ pydantic = ">=2.10.0,<3"
146
+ numpydantic = ">=1.8.1,<2"
147
+ python-snappy = ">=0.7.3,<0.8"
148
+ h5py = ">=3.16.0,<4"
149
+ hydra-core = ">=1.3.2,<2"
150
+ tomli-w = ">=1.2.0,<2"
151
+ loguru = ">=0.7.3,<0.8"
152
+ pytorch = ">=2.10.0,<3"
153
+ jax = ">=0.9.0,<0.10"
154
+ jupyterlab = ">=4.5.8,<5"
155
+ ovld = ">=0.5.15,<0.6"
156
+ pytest-xdist = ">=3.8.0,<4"
@@ -9,7 +9,7 @@ Issues = "https://github.com/LiuGaoyong/GraphAtoms/issues/"
9
9
 
10
10
  [project]
11
11
  name = "graphatoms"
12
- version = "1.2.0"
12
+ version = "1.2.1"
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" }]
@@ -49,7 +49,7 @@ dependencies = [
49
49
  "hydra-core",
50
50
  "numpy>=2.0.0,<3",
51
51
  "numpydantic",
52
- "ovld", # singledispatch which works for multiple arguments.
52
+ "ovld", # singledispatch which works for multiple arguments.
53
53
  "pydantic>=2.10",
54
54
  "python-snappy>=0.7.3", # More Fase Data Compression
55
55
  "tomli; python_version < '3.11'", # use tomllib in python>=3.11
@@ -64,7 +64,7 @@ dev = [
64
64
  "pytest>=8.3",
65
65
  "pytest-xdist",
66
66
  "jupyter",
67
- "sqlmodel", # SQL + pydantic
67
+ "sqlmodel", # SQL + pydantic
68
68
  'openbabel-wheel',
69
69
  ]
70
70
 
@@ -64,7 +64,7 @@ class BondGraph(Matter, OurFrozenModel):
64
64
  f"Invalid shape for `{k}`: Len({k})="
65
65
  f"{len(v)} but nbonds={self.nbonds}."
66
66
  )
67
- # assert self.__IGRAPH.is_simple(), "The graph should be simple."
67
+ assert self.__IGRAPH.is_simple(), "The graph should be simple."
68
68
  return self
69
69
 
70
70
  @override
@@ -112,7 +112,9 @@ class BondGraph(Matter, OurFrozenModel):
112
112
  @cached_property
113
113
  def __IGRAPH(self) -> IGraph:
114
114
  edges = np.column_stack([self.source, self.target])
115
- g = IGraph(n=self.natoms, edges=edges, directed=False)
115
+ g = IGraph(n=self.natoms, edges=edges, directed=True)
116
+ # use directed graph for compatibility of full neighbor list
117
+ assert not g.has_multiple(), "This graph has multiple edges."
116
118
  return g.as_undirected() # make sure it is undirected
117
119
 
118
120
  @cached_property
@@ -165,7 +167,7 @@ class BondGraph(Matter, OurFrozenModel):
165
167
 
166
168
  def get_match_mode(
167
169
  self,
168
- pattern: Self, # big graph
170
+ pattern: "BondGraph",
169
171
  algorithm: Literal["lad", "vf2"] = "lad",
170
172
  return_match_target: bool = True,
171
173
  only_number_color: bool = False,
@@ -425,7 +425,12 @@ class SysGraph(BondGraph, Structure, AtomTag, GasMixin):
425
425
  df_bonds["order"] = self.order
426
426
  if self.distance is not None:
427
427
  df_bonds["distance"] = self.distance
428
- G = IGraph.DataFrame(df_bonds, False, df_atoms, True)
428
+ G = IGraph.DataFrame(
429
+ edges=df_bonds,
430
+ directed=True, # use directed graph to avoid duplicate edges
431
+ vertices=df_atoms,
432
+ use_vids=True,
433
+ )
429
434
  for k in (
430
435
  Box.__pydantic_fields__.keys()
431
436
  | Energetics.__pydantic_fields__.keys()
File without changes
File without changes