AdsorPy 1.1.2__tar.gz → 1.1.3__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.
- {adsorpy-1.1.2 → adsorpy-1.1.3}/CHANGELOG.md +8 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/PKG-INFO +15 -2
- {adsorpy-1.1.2 → adsorpy-1.1.3}/pyproject.toml +38 -3
- adsorpy-1.1.3/src/adsorpy/__init__.py +17 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/molecule_lib.py +49 -50
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/rsa_calculator.py +1 -1
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/rsa_config.py +1 -2
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/run_simulation.py +84 -86
- adsorpy-1.1.2/tests/__init__.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/.github/workflows/docs-ci.yml +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/.github/workflows/publish_to_PyPI.yml +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/.github/workflows/tests-ci.yml +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/LICENSE.md +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/README.md +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/Makefile +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/make.bat +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/adsorpy.molecule_lib.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/adsorpy.randomsequentialadsorption.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/adsorpy.rsa_calculator.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/adsorpy.rsa_config.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/adsorpy.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/adsorpy.run_simulation.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/conf.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/index.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/docs/source/modules.rst +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/images/AdsorPy_Covered_Surface.png +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/py.typed +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/requirements.txt +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/requirements_dev.txt +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/__init__.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/__main__.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/VdW_Radii.csv +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/config.json +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/molecule_colour.json +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/src/adsorpy/randomsequentialadsorption.py +0 -0
- {adsorpy-1.1.2/src/adsorpy → adsorpy-1.1.3/tests}/__init__.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/tests/rsa_test.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/tests/run_simulation_test.py +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/tests/test_data/config_test_hard.json +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/tests/test_data/config_test_periodic.json +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/tests/test_data/config_test_soft.json +0 -0
- {adsorpy-1.1.2 → adsorpy-1.1.3}/tox.ini +0 -0
|
@@ -9,6 +9,14 @@ This format is based on [Keep a Changelog](http://keepachangelog.com/) and this
|
|
|
9
9
|
### Fixed
|
|
10
10
|
### Removed
|
|
11
11
|
|
|
12
|
+
## 1.1.3 - 2026-04-28
|
|
13
|
+
### Added
|
|
14
|
+
- Add ``__version__``, ``__name__``, ``__author__``, and ``__author_email__`` to ``__init__.py``.
|
|
15
|
+
### Changed
|
|
16
|
+
### Fixed
|
|
17
|
+
- Update ``pyproject.toml`` to have the appropriate keywords and classifiers. The project does not show up on the PyPI index but can be installed from it.
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
12
20
|
## 1.1.2 - 2026-04-27
|
|
13
21
|
### Added
|
|
14
22
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
|
-
Name:
|
|
3
|
-
Version: 1.1.
|
|
2
|
+
Name: adsorpy
|
|
3
|
+
Version: 1.1.3
|
|
4
4
|
Summary: Random sequential adsorption (RSA) simulation, 2D lattice-based.
|
|
5
5
|
Project-URL: Repository, https://github.com/JoostFWMaas/AdsorPy
|
|
6
6
|
Project-URL: Documentation, https://joostfwmaas.github.io/AdsorPy
|
|
@@ -8,14 +8,27 @@ Project-URL: Changelog, https://github.com/JoostFWMaas/AdsorPy/blob/main/CHANGEL
|
|
|
8
8
|
Author-email: "J.F.W. Maas" <j.f.w.maas@tue.nl>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE.md
|
|
11
|
+
Keywords: Monte Carlo,RSA,adsorption,computational chemistry,computational physics,coverage,gap size distribution,jamming,lattice model,molecular adsorption,packing,random sequential adsorption,statistical mechanics,stochastic simulation,surface science
|
|
11
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Natural Language :: English
|
|
12
17
|
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python
|
|
13
19
|
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
25
|
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering
|
|
27
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
30
|
+
Classifier: Topic :: Software Development
|
|
31
|
+
Classifier: Typing :: Typed
|
|
19
32
|
Requires-Python: >=3.10
|
|
20
33
|
Requires-Dist: matplotlib
|
|
21
34
|
Requires-Dist: numba
|
|
@@ -3,8 +3,9 @@ requires = ["hatchling"]
|
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
|
-
name = "
|
|
7
|
-
|
|
6
|
+
name = "adsorpy"
|
|
7
|
+
#dynamic = ["version"] # The Python guide says that this will use the Git tag to fill it in.
|
|
8
|
+
version = "1.1.3" # The Python guide says that this will use the Git tag to fill it in.
|
|
8
9
|
description = "Random sequential adsorption (RSA) simulation, 2D lattice-based."
|
|
9
10
|
authors = [{ name = "J.F.W. Maas", email = "j.f.w.maas@tue.nl" }]
|
|
10
11
|
readme = "README.md"
|
|
@@ -12,17 +13,51 @@ requires-python = ">=3.10"
|
|
|
12
13
|
license = "MIT"
|
|
13
14
|
license-files = ["LICEN[CS]E.md"]
|
|
14
15
|
classifiers = [
|
|
16
|
+
# Project maturity:
|
|
15
17
|
"Development Status :: 5 - Production/Stable",
|
|
16
|
-
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Typing :: Typed",
|
|
20
|
+
"Natural Language :: English",
|
|
21
|
+
|
|
22
|
+
# Intended users of project:
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Intended Audience :: Science/Research",
|
|
25
|
+
"Topic :: Software Development",
|
|
26
|
+
"Topic :: Scientific/Engineering",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
28
|
+
"Topic :: Scientific/Engineering :: Mathematics",
|
|
29
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
30
|
+
|
|
31
|
+
# Supported Python versions:
|
|
32
|
+
"Programming Language :: Python",
|
|
17
33
|
"Programming Language :: Python :: 3",
|
|
34
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
18
35
|
"Programming Language :: Python :: 3.10",
|
|
19
36
|
"Programming Language :: Python :: 3.11",
|
|
20
37
|
"Programming Language :: Python :: 3.12",
|
|
21
38
|
"Programming Language :: Python :: 3.13",
|
|
22
39
|
"Programming Language :: Python :: 3.14",
|
|
23
40
|
|
|
41
|
+
# This does not run on mobile because of Shapely.
|
|
24
42
|
"Operating System :: OS Independent",
|
|
25
43
|
]
|
|
44
|
+
keywords = [
|
|
45
|
+
"RSA",
|
|
46
|
+
"random sequential adsorption",
|
|
47
|
+
"adsorption",
|
|
48
|
+
"surface science",
|
|
49
|
+
"Monte Carlo",
|
|
50
|
+
"lattice model",
|
|
51
|
+
"statistical mechanics",
|
|
52
|
+
"packing",
|
|
53
|
+
"jamming",
|
|
54
|
+
"molecular adsorption",
|
|
55
|
+
"coverage",
|
|
56
|
+
"computational chemistry",
|
|
57
|
+
"computational physics",
|
|
58
|
+
"stochastic simulation",
|
|
59
|
+
"gap size distribution"
|
|
60
|
+
]
|
|
26
61
|
dependencies = [
|
|
27
62
|
"numpy",
|
|
28
63
|
"numba",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from importlib.metadata import PackageNotFoundError, metadata
|
|
3
|
+
|
|
4
|
+
try: # This only works when running as a package.
|
|
5
|
+
meta = metadata(__package__ or __name__)
|
|
6
|
+
except PackageNotFoundError: # For development, this will trigger instead.
|
|
7
|
+
meta = metadata("adsorpy")
|
|
8
|
+
|
|
9
|
+
__name__ = meta["Name"]
|
|
10
|
+
__version__ = meta["Version"]
|
|
11
|
+
|
|
12
|
+
author_and_email = meta["Author-email"]
|
|
13
|
+
name = re.search(r'"([^"]*)"', author_and_email)
|
|
14
|
+
email = re.search(r'<([^"]*)>', author_and_email)
|
|
15
|
+
|
|
16
|
+
__author__ = name[1] if name is not None else name
|
|
17
|
+
__author_email__ = email[1] if email is not None else email
|
|
@@ -58,7 +58,6 @@ GeoArray = np.ndarray[tuple[int], np.dtype[Polygon]]
|
|
|
58
58
|
FloatArray = NDArray[np.float64]
|
|
59
59
|
RotMatrix = np.ndarray[tuple[Literal[3], Literal[3]], np.dtype[np.float64]]
|
|
60
60
|
|
|
61
|
-
|
|
62
61
|
# Van der Waals radii of atoms. Source: https://doi.org/10.1039/C3DT50599E
|
|
63
62
|
current_dir_file = Path(__file__).parent / "VdW_Radii.csv"
|
|
64
63
|
RADII: dict[str, float] = dict(
|
|
@@ -72,9 +71,9 @@ RADII: dict[str, float] = dict(
|
|
|
72
71
|
|
|
73
72
|
|
|
74
73
|
def discorectangle(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
params: list[float],
|
|
75
|
+
offx: float = 0.0,
|
|
76
|
+
offy: float = 0.0,
|
|
78
77
|
) -> Polygon:
|
|
79
78
|
"""Create a discorectangle using the union of two circles and a rectangle.
|
|
80
79
|
|
|
@@ -107,10 +106,10 @@ def discorectangle(
|
|
|
107
106
|
|
|
108
107
|
|
|
109
108
|
def circulium(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
radius: float,
|
|
110
|
+
x_offset: float = 0.0,
|
|
111
|
+
y_offset: float = 0.0,
|
|
112
|
+
quad_segs: int = 8,
|
|
114
113
|
) -> Polygon:
|
|
115
114
|
"""Create a simple circular polygon.
|
|
116
115
|
|
|
@@ -144,9 +143,9 @@ def dogbonium(scale: float = 1) -> Polygon:
|
|
|
144
143
|
|
|
145
144
|
|
|
146
145
|
def polygonium(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
verts: int = 3,
|
|
147
|
+
scale: float = 1.0,
|
|
148
|
+
roundedness: float = 0.0,
|
|
150
149
|
) -> Polygon:
|
|
151
150
|
"""Create a simple regular polygon with optional rounding.
|
|
152
151
|
|
|
@@ -174,16 +173,16 @@ def polygonium(
|
|
|
174
173
|
|
|
175
174
|
|
|
176
175
|
def xyz_reader(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
176
|
+
file_name: str | Path,
|
|
177
|
+
ignore_atoms: str | list[str] | None = None,
|
|
178
|
+
x_offset: float = 0.0,
|
|
179
|
+
y_offset: float = 0.0,
|
|
180
|
+
roll: float = 0.0,
|
|
181
|
+
pitch: float = 0.0,
|
|
182
|
+
yaw: float = 0.0,
|
|
183
|
+
z_trim: float | None = None,
|
|
184
|
+
# *args: P.args,
|
|
185
|
+
# **kwargs: P.kwargs,
|
|
187
186
|
) -> Polygon:
|
|
188
187
|
"""Read files in the xyz format of VASP.
|
|
189
188
|
|
|
@@ -238,15 +237,15 @@ def xyz_reader(
|
|
|
238
237
|
|
|
239
238
|
|
|
240
239
|
def first_time_loader( # noqa: PLR0915
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
240
|
+
file_name: str | Path,
|
|
241
|
+
ignore_atoms: str | list[str] | None = None,
|
|
242
|
+
x_offset: float | None = None,
|
|
243
|
+
y_offset: float | None = None,
|
|
244
|
+
roll: float | None = None,
|
|
245
|
+
pitch: float | None = None,
|
|
246
|
+
yaw: float | None = None,
|
|
247
|
+
z_trim: float | None = None,
|
|
248
|
+
reference_lattice_spacing: float = 4.74,
|
|
250
249
|
) -> InDict:
|
|
251
250
|
"""Script to run when you first load the molecule. Shows the molecule in xy, zy, and xz perspective, and vdwaals.
|
|
252
251
|
|
|
@@ -463,23 +462,23 @@ def first_time_loader( # noqa: PLR0915
|
|
|
463
462
|
|
|
464
463
|
|
|
465
464
|
def _update( # noqa: PLR0913
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
465
|
+
val: float,
|
|
466
|
+
ang_x: Slider,
|
|
467
|
+
ang_y: Slider,
|
|
468
|
+
ang_z: Slider,
|
|
469
|
+
translate_x: Slider,
|
|
470
|
+
translate_y: Slider,
|
|
471
|
+
box_x: TextBox,
|
|
472
|
+
box_y: TextBox,
|
|
473
|
+
box_z: TextBox,
|
|
474
|
+
box_xoff: TextBox,
|
|
475
|
+
box_yoff: TextBox,
|
|
476
|
+
atompos: FloatArray,
|
|
477
|
+
axs: list[axes.Axes],
|
|
478
|
+
fig: figure.Figure,
|
|
479
|
+
atomcolours: NDArray[np.str_],
|
|
480
|
+
atomkeys: NDArray[np.str_],
|
|
481
|
+
reference_lattice_spacing: float,
|
|
483
482
|
) -> None:
|
|
484
483
|
roll = ang_z.val
|
|
485
484
|
pitch = ang_y.val
|
|
@@ -604,9 +603,9 @@ def _update( # noqa: PLR0913
|
|
|
604
603
|
|
|
605
604
|
|
|
606
605
|
def _initialise_reader(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
606
|
+
file_name: str | Path,
|
|
607
|
+
ignore_atoms: str | list[str] | None = None,
|
|
608
|
+
z_trim: float | None = None,
|
|
610
609
|
) -> tuple[np.ndarray[tuple[int], np.dtype[np.str_]], np.ndarray[tuple[int, Literal[3]], np.dtype[np.float64]]]:
|
|
611
610
|
"""Initialise the xyz_reader and first_time_loader.
|
|
612
611
|
|
|
@@ -325,7 +325,7 @@ def create_periodic_images(
|
|
|
325
325
|
temp_offset: np.ndarray[tuple[Literal[2], Literal[2]], np.dtype[np.float64]] | np.ndarray[
|
|
326
326
|
tuple[Literal[3], Literal[3]], np.dtype[np.float64]] = cast(
|
|
327
327
|
"""np.ndarray[tuple[Literal[2], Literal[2]], np.dtype[np.float64]] |
|
|
328
|
-
|
|
328
|
+
np.ndarray[tuple[Literal[3], Literal[3]], np.dtype[np.float64]]""",
|
|
329
329
|
np.diag([x_max, y_max]).reshape((2, 2)) if z_max is None else np.diag([x_max, y_max, z_max]),
|
|
330
330
|
)
|
|
331
331
|
offset: np.ndarray[tuple[Literal[2, 3], Literal[2, 3], Literal[1]], np.dtype[np.float64]] = temp_offset[
|
|
@@ -13,7 +13,6 @@ from typing import ParamSpec, TypeAlias
|
|
|
13
13
|
|
|
14
14
|
P = ParamSpec("P")
|
|
15
15
|
T: TypeAlias = float | str | int | list[float]
|
|
16
|
-
# T = TypeVar("T", bound=float | str | list[float])
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
class RsaConfig:
|
|
@@ -72,7 +71,7 @@ class RsaConfig:
|
|
|
72
71
|
return result
|
|
73
72
|
|
|
74
73
|
def __return_key_value(
|
|
75
|
-
|
|
74
|
+
self, config_value: dict[str, T] | T, keys: list[str],
|
|
76
75
|
) -> T | dict[str, T] | RsaConfig | None:
|
|
77
76
|
if not len(keys):
|
|
78
77
|
if isinstance(config_value, dict):
|
|
@@ -50,28 +50,28 @@ DistArray = np.ndarray[tuple[int], np.dtype[np.float64]]
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def run_simulation( # noqa: PLR0913
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
rsa_config: RsaConfig | None = None,
|
|
54
|
+
molecules_list: Polygon | list[Polygon] | GeoArray | None = None,
|
|
55
|
+
rotation_symmetries: int | list[int] | IdxArray | None = None,
|
|
56
|
+
reflection_symmetries: bool | list[bool] | BoolArray | None = None,
|
|
57
|
+
rotation_counts: int | list[int] | IdxArray | None = None,
|
|
58
|
+
lattice_type: str = "triangular",
|
|
59
|
+
site_count: int | None = None,
|
|
60
|
+
lattice_a: float | None = None,
|
|
61
|
+
boundary_condition: str | None = None,
|
|
62
|
+
simulation_type: str = "sequential",
|
|
63
|
+
dosing_distribution: list[float] | DistArray | None = None,
|
|
64
|
+
include_rejected_flux: bool = False,
|
|
65
|
+
calculate_gap_size: bool = False,
|
|
66
|
+
print_output_flag: bool = False,
|
|
67
|
+
plot_output_flag: bool = False,
|
|
68
|
+
seed: int | None = None,
|
|
69
|
+
timestep_limit: int = 1000000,
|
|
70
|
+
site_x_coords: DistArray | None = None,
|
|
71
|
+
site_y_coords: DistArray | None = None,
|
|
72
|
+
bounding_x_coord: float | None = None,
|
|
73
|
+
bounding_y_coord: float | None = None,
|
|
74
|
+
sticking_probability: float | list[float] | DistArray = 1.,
|
|
75
75
|
) -> tuple[list[int], DistArray, int, IdxArray, IdxArray, Simulator]:
|
|
76
76
|
"""Run the RSA simulation.
|
|
77
77
|
|
|
@@ -147,8 +147,6 @@ def run_simulation( # noqa: PLR0913
|
|
|
147
147
|
bounding_y_coord,
|
|
148
148
|
)
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
152
150
|
# The seed is defined as the datetime in microseconds. The seed is stored so simulations can be verified.
|
|
153
151
|
how_late = datetime.now(UTC) if version_info >= (3, 11) else datetime.utcnow()
|
|
154
152
|
seed = int(how_late.strftime("%Y%m%d%H%M%S%f")) if seed is None else seed
|
|
@@ -191,7 +189,6 @@ def run_simulation( # noqa: PLR0913
|
|
|
191
189
|
errmsg = "sticking_probability must be a float, list, or np.ndarray"
|
|
192
190
|
raise TypeError(errmsg)
|
|
193
191
|
|
|
194
|
-
|
|
195
192
|
pp: Polygon
|
|
196
193
|
for idx, (pp, stick) in enumerate(zip(mol_lst, stick_prob, strict=True)):
|
|
197
194
|
molecules.append(
|
|
@@ -249,11 +246,11 @@ def run_simulation( # noqa: PLR0913
|
|
|
249
246
|
|
|
250
247
|
|
|
251
248
|
def _run_sequential(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
249
|
+
sim: Simulator,
|
|
250
|
+
surf: Surface,
|
|
251
|
+
molecules: list[MoleculeGroup],
|
|
252
|
+
time_count: count[int],
|
|
253
|
+
timestep_limit: int,
|
|
257
254
|
) -> None:
|
|
258
255
|
for moldx, molgr in enumerate(sim.molgroups):
|
|
259
256
|
while molgr.vacancy_count and next(time_count) < timestep_limit:
|
|
@@ -261,12 +258,12 @@ def _run_sequential(
|
|
|
261
258
|
|
|
262
259
|
|
|
263
260
|
def _run_codosing(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
261
|
+
sim: Simulator,
|
|
262
|
+
surf: Surface,
|
|
263
|
+
molecules: list[MoleculeGroup],
|
|
264
|
+
time_count: count[int],
|
|
265
|
+
timestep_limit: int,
|
|
266
|
+
dosing_distribution: list[float] | DistArray | None = None,
|
|
270
267
|
) -> None:
|
|
271
268
|
for moldx, molgr in enumerate(sim.molgroups):
|
|
272
269
|
while molgr.vacancy_count and next(time_count) < timestep_limit:
|
|
@@ -274,11 +271,11 @@ def _run_codosing(
|
|
|
274
271
|
|
|
275
272
|
|
|
276
273
|
def _run_cascade(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
274
|
+
sim: Simulator,
|
|
275
|
+
surf: Surface,
|
|
276
|
+
molecules: list[MoleculeGroup],
|
|
277
|
+
time_count: count[int],
|
|
278
|
+
timestep_limit: int,
|
|
282
279
|
) -> None:
|
|
283
280
|
for moldx, molgr in enumerate(sim.molgroups):
|
|
284
281
|
while molgr.vacancy_count and next(time_count) < timestep_limit:
|
|
@@ -286,10 +283,10 @@ def _run_cascade(
|
|
|
286
283
|
|
|
287
284
|
|
|
288
285
|
def _run_flux(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
286
|
+
sim: Simulator,
|
|
287
|
+
surf: Surface,
|
|
288
|
+
molecules: list[MoleculeGroup],
|
|
289
|
+
timestep_limit: int,
|
|
293
290
|
) -> tuple[IdxArray, IdxArray]:
|
|
294
291
|
"""Adsorb while taking steps into account.
|
|
295
292
|
|
|
@@ -317,11 +314,11 @@ def _run_flux(
|
|
|
317
314
|
|
|
318
315
|
|
|
319
316
|
def _run_flux_fixedrotation(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
317
|
+
sim: Simulator,
|
|
318
|
+
surf: Surface,
|
|
319
|
+
molecules: list[MoleculeGroup],
|
|
320
|
+
timestep_limit: int,
|
|
321
|
+
distribution: list[float] | None = None,
|
|
325
322
|
) -> tuple[IdxArray, IdxArray]:
|
|
326
323
|
"""Adsorb while taking steps into account. Rotation is fixed and sites are varied instead.
|
|
327
324
|
|
|
@@ -351,11 +348,11 @@ def _run_flux_fixedrotation(
|
|
|
351
348
|
|
|
352
349
|
|
|
353
350
|
def _initialise_run_parameters(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
351
|
+
molecules_list: Polygon | list[Polygon] | np.ndarray[tuple[int], np.dtype[Polygon]] | None = None,
|
|
352
|
+
rotation_symmetries: int | list[int] | np.ndarray[tuple[int], np.dtype[np.int_]] | None = None,
|
|
353
|
+
reflection_symmetries: bool | list[bool] | np.ndarray[tuple[int], np.dtype[np.bool_]] | None = None,
|
|
354
|
+
rotation_counts: int | list[int] | np.ndarray[tuple[int], np.dtype[np.int_]] | None = None,
|
|
355
|
+
simulation_type: str = "sequential",
|
|
359
356
|
) -> tuple[GeoArray, IdxArray, BoolArray, IdxArray]:
|
|
360
357
|
"""Initialise run parameters.
|
|
361
358
|
|
|
@@ -388,7 +385,8 @@ def _initialise_run_parameters(
|
|
|
388
385
|
return molecules_list, rot_syms, refl_syms, rot_cnts
|
|
389
386
|
|
|
390
387
|
|
|
391
|
-
def _turn_into_list(val_or_list: T1 | list[T1], compare_to: type[T1]) -> np.ndarray[
|
|
388
|
+
def _turn_into_list(val_or_list: T1 | list[T1], compare_to: type[T1]) -> np.ndarray[ # type: ignore[explicit-any]
|
|
389
|
+
tuple[int], np.dtype[T2]]:
|
|
392
390
|
"""Turn a variable or a list into an array.
|
|
393
391
|
|
|
394
392
|
:param val_or_list: value or list.
|
|
@@ -409,17 +407,17 @@ def _repeater(orig_array: Tn, comparison_len: int) -> Tn: # type: ignore[explic
|
|
|
409
407
|
|
|
410
408
|
|
|
411
409
|
def _error_checker(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
410
|
+
molecules_list: GeoArray,
|
|
411
|
+
rotation_symmetries: IdxArray,
|
|
412
|
+
reflection_symmetries: BoolArray,
|
|
413
|
+
rotation_counts: IdxArray,
|
|
414
|
+
simulation_type: str,
|
|
415
|
+
dosing_distribution: list[float] | DistArray | None = None,
|
|
416
|
+
boundary_condition: str | None = None,
|
|
417
|
+
site_x_coords: DistArray | None = None,
|
|
418
|
+
site_y_coords: DistArray | None = None,
|
|
419
|
+
bounding_x_coord: float | None = None,
|
|
420
|
+
bounding_y_coord: float | None = None,
|
|
423
421
|
) -> bool:
|
|
424
422
|
"""Check the errors. Returns bool denoting custom grid (False if grid is not custom).
|
|
425
423
|
|
|
@@ -446,9 +444,9 @@ def _error_checker(
|
|
|
446
444
|
raise ValueError(errmsg)
|
|
447
445
|
|
|
448
446
|
if (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
447
|
+
simulation_type == "codosing"
|
|
448
|
+
and dosing_distribution is not None
|
|
449
|
+
and len(molecules_list) != len(dosing_distribution)
|
|
452
450
|
):
|
|
453
451
|
errmsg = "Dosing distribution must be the same length as the molecule list."
|
|
454
452
|
raise ValueError(errmsg)
|
|
@@ -471,14 +469,14 @@ def _error_checker(
|
|
|
471
469
|
|
|
472
470
|
|
|
473
471
|
def _postprocessing(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
472
|
+
sim: Simulator,
|
|
473
|
+
surf: Surface,
|
|
474
|
+
molecules: list[MoleculeGroup],
|
|
475
|
+
print_output_flag: bool,
|
|
476
|
+
plot_output_flag: bool,
|
|
477
|
+
calculate_gap_size: bool,
|
|
478
|
+
results_folder: str | Path,
|
|
479
|
+
timestr: str,
|
|
482
480
|
) -> DistArray:
|
|
483
481
|
"""Perform post-processing of the data.
|
|
484
482
|
|
|
@@ -513,14 +511,14 @@ def _postprocessing(
|
|
|
513
511
|
|
|
514
512
|
|
|
515
513
|
def _select_and_run(
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
514
|
+
sim: Simulator,
|
|
515
|
+
surf: Surface,
|
|
516
|
+
molecules: list[MoleculeGroup],
|
|
517
|
+
simulation_type: str,
|
|
518
|
+
include_rejected_flux: bool,
|
|
519
|
+
time_count: count[int],
|
|
520
|
+
timestep_limit: int,
|
|
521
|
+
dosing_distribution: list[float] | DistArray | None = None,
|
|
524
522
|
) -> tuple[IdxArray, IdxArray]:
|
|
525
523
|
"""Select and run. A collection of the simulations. Putting them in one function helps streamline adjusting them.
|
|
526
524
|
|
adsorpy-1.1.2/tests/__init__.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|