AdsorPy 1.0.2__tar.gz → 1.1.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.
- {adsorpy-1.0.2 → adsorpy-1.1.1}/.github/workflows/docs-ci.yml +1 -1
- {adsorpy-1.0.2 → adsorpy-1.1.1}/.github/workflows/publish_to_PyPI.yml +2 -2
- {adsorpy-1.0.2 → adsorpy-1.1.1}/.github/workflows/tests-ci.yml +1 -1
- adsorpy-1.1.1/CHANGELOG.md +60 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/PKG-INFO +2 -2
- {adsorpy-1.0.2 → adsorpy-1.1.1}/pyproject.toml +3 -4
- {adsorpy-1.0.2 → adsorpy-1.1.1}/requirements.txt +2 -2
- {adsorpy-1.0.2 → adsorpy-1.1.1}/requirements_dev.txt +2 -2
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/run_simulation.py +3 -3
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tests/rsa_test.py +2 -11
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tests/run_simulation_test.py +72 -21
- adsorpy-1.0.2/CHANGELOG.md +0 -34
- {adsorpy-1.0.2 → adsorpy-1.1.1}/LICENSE.md +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/README.md +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/Makefile +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/make.bat +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/adsorpy.molecule_lib.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/adsorpy.randomsequentialadsorption.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/adsorpy.rsa_calculator.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/adsorpy.rsa_config.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/adsorpy.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/adsorpy.run_simulation.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/conf.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/index.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/docs/source/modules.rst +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/images/AdsorPy_Covered_Surface.png +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/py.typed +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/__init__.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/__main__.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/VdW_Radii.csv +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/__init__.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/config.json +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/molecule_colour.json +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/molecule_lib.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/randomsequentialadsorption.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/rsa_calculator.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/src/adsorpy/rsa_config.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tests/__init__.py +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tests/test_data/config_test_hard.json +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tests/test_data/config_test_periodic.json +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tests/test_data/config_test_soft.json +0 -0
- {adsorpy-1.0.2 → adsorpy-1.1.1}/tox.ini +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
All important changes to ``AdsorPy`` will be documented in this file.
|
|
3
|
+
|
|
4
|
+
This format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
|
+
|
|
6
|
+
## [unreleased]
|
|
7
|
+
### Added
|
|
8
|
+
### Changed
|
|
9
|
+
### Fixed
|
|
10
|
+
### Removed
|
|
11
|
+
|
|
12
|
+
## 1.1.1 - 2026-04-27
|
|
13
|
+
### Added
|
|
14
|
+
### Changed
|
|
15
|
+
- Update dependency versions.
|
|
16
|
+
### Fixed
|
|
17
|
+
- Fix ``pyproject.toml``: ``"AdsorPy" = ["py.typed"]`` (from ``rsa-mc``, the old internal project name.)
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
## 1.1.0 - 2026-04-24
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- Add the ``Simulator`` class as 6th return value of ``run_simulation()``.
|
|
24
|
+
- Add overlap and gap size subtests to the dosing scheme tests of ``run_simulation_test``.
|
|
25
|
+
### Changed
|
|
26
|
+
- Update CI action/deploy-pages to v5. Update CI action/upload-artifact to v7.
|
|
27
|
+
- Move overlap and gap size test for alt simulation to subtests.
|
|
28
|
+
### Fixed
|
|
29
|
+
### Removed
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## 1.0.2 - 2026-04-23
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- Update CI actions to move from ``node.js`` 20 to 24.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
- Remove unnecessary type casts.
|
|
43
|
+
|
|
44
|
+
## 1.0.1 - 2026-04-23
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
- Implement subtests for the test_run_alt (a test for the RSA simulator on an alternative seed).
|
|
48
|
+
- Add a determinism test to show identical outcome for identical seeds.
|
|
49
|
+
- In ``tool.ruff.lint``: use ``future-annotations = true``, this correctly checks ``__future__`` annotation.
|
|
50
|
+
### Changed
|
|
51
|
+
- Update version dependencies.
|
|
52
|
+
- Strengthen seed comparison test.
|
|
53
|
+
- Vectorise (remove a for-loop) from overlap test.
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
### Removed
|
|
58
|
+
|
|
59
|
+
## 1.0.0 - 2025-11-29
|
|
60
|
+
- Full release
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AdsorPy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
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
|
|
@@ -29,7 +29,7 @@ Requires-Dist: pytest; extra == 'testing'
|
|
|
29
29
|
Requires-Dist: pytest-cov; extra == 'testing'
|
|
30
30
|
Requires-Dist: ruff; extra == 'testing'
|
|
31
31
|
Requires-Dist: scipy==1.15.3; (python_version <= '3.10') and extra == 'testing'
|
|
32
|
-
Requires-Dist: scipy
|
|
32
|
+
Requires-Dist: scipy>=1.16.3; (python_version > '3.10') and extra == 'testing'
|
|
33
33
|
Description-Content-Type: text/markdown
|
|
34
34
|
|
|
35
35
|
# AdsorPy
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "AdsorPy"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.1.1"
|
|
8
8
|
description = "Random sequential adsorption (RSA) simulation, 2D lattice-based."
|
|
9
9
|
authors = [{ name = "J.F.W. Maas", email = "j.f.w.maas@tue.nl" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -45,12 +45,12 @@ testing = [
|
|
|
45
45
|
"mypy",
|
|
46
46
|
"ruff",
|
|
47
47
|
"scipy==1.15.3; python_version <= '3.10'",
|
|
48
|
-
"scipy
|
|
48
|
+
"scipy>=1.16.3; python_version > '3.10'",
|
|
49
49
|
]
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
[tool.hatch.package_data]
|
|
53
|
-
"
|
|
53
|
+
"AdsorPy" = ["py.typed"]
|
|
54
54
|
|
|
55
55
|
[tool.pytest.ini_options]
|
|
56
56
|
testpaths = ["tests"]
|
|
@@ -93,7 +93,6 @@ exclude_also = [
|
|
|
93
93
|
mypy_path = ["src", "optional"]
|
|
94
94
|
ignore_missing_imports = true
|
|
95
95
|
strict = true
|
|
96
|
-
#no_implicit_reexport = true
|
|
97
96
|
disallow_any_explicit = true
|
|
98
97
|
#disallow_any_decorated = true # Throws an error because geo.Polygon in a tuple is turned into Any for the @staticmethod.
|
|
99
98
|
#warn_unreachable = true # Set this to true when pushing to main?
|
|
@@ -71,7 +71,7 @@ def run_simulation( # noqa: PLR0913
|
|
|
71
71
|
bounding_x_coord: float | None = None,
|
|
72
72
|
bounding_y_coord: float | None = None,
|
|
73
73
|
sticking_probability: float | list[float] = 1.,
|
|
74
|
-
) -> tuple[list[int], DistArray, int, IdxArray, IdxArray]:
|
|
74
|
+
) -> tuple[list[int], DistArray, int, IdxArray, IdxArray, Simulator]:
|
|
75
75
|
"""Run the RSA simulation.
|
|
76
76
|
|
|
77
77
|
If no molecule is provided, defaults to a circular molecule of radius 0.55 Angstrom.
|
|
@@ -106,6 +106,7 @@ def run_simulation( # noqa: PLR0913
|
|
|
106
106
|
2. The RNG seed.
|
|
107
107
|
3. The fluxes/doses as a list of counts per stepcount of adsorption event.
|
|
108
108
|
4. The available surface function (ASF).
|
|
109
|
+
5. The Simulator class.
|
|
109
110
|
:raises TypeError: If the sticking probability is an invalid type.
|
|
110
111
|
"""
|
|
111
112
|
rsa_config = RsaConfig(str(Path(__file__).parent / "config.json")) if rsa_config is None else rsa_config
|
|
@@ -145,7 +146,6 @@ def run_simulation( # noqa: PLR0913
|
|
|
145
146
|
|
|
146
147
|
temp_results_folder = results_folder
|
|
147
148
|
attempt_count: int = 0
|
|
148
|
-
# while os.path.isdir(temp_results_folder):
|
|
149
149
|
while temp_results_folder.is_dir():
|
|
150
150
|
temp_results_folder = results_folder.parent / (results_folder.name + f"_{attempt_count}")
|
|
151
151
|
# Add a counter to the end of the folder name.
|
|
@@ -223,7 +223,7 @@ def run_simulation( # noqa: PLR0913
|
|
|
223
223
|
timestr,
|
|
224
224
|
)
|
|
225
225
|
|
|
226
|
-
return [mgr.molecule_counter for mgr in sim.molgroups], gaps, seed, all_flux, phi
|
|
226
|
+
return [mgr.molecule_counter for mgr in sim.molgroups], gaps, seed, all_flux, phi, sim
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
def _run_sequential(
|
|
@@ -196,7 +196,6 @@ class TestWithParameters:
|
|
|
196
196
|
polygons = simulator.sim.mol_data.stored_data["polygon"][existing]
|
|
197
197
|
|
|
198
198
|
ii: Polygon
|
|
199
|
-
jj: Polygon
|
|
200
199
|
overlap = False
|
|
201
200
|
for idx, ii in enumerate(polygons): # TODO: Add STRtree to speed up?
|
|
202
201
|
prepared_multipolygon = prep(unary_union(polygons[idx + 1:]))
|
|
@@ -208,7 +207,7 @@ class TestWithParameters:
|
|
|
208
207
|
|
|
209
208
|
def test_no_large_gaps(self, simulator, configname, molgr_count, surf_type):
|
|
210
209
|
"""Tests whether there are sites with gaps larger than the molecule's circumradius.
|
|
211
|
-
|
|
210
|
+
If gaps are larger, a molecule should be able to fit, and the simulation terminated before saturation.
|
|
212
211
|
"""
|
|
213
212
|
gaps = simulator.sim.analyse_gap_size(simulator.sim.surf)
|
|
214
213
|
circumradius = simulator.sim.molgroups[0].max_radius
|
|
@@ -228,7 +227,7 @@ class TestWithParameters:
|
|
|
228
227
|
for alt_test in [self.test_load_config, self.test_create_surface, self.test_create_molecules,
|
|
229
228
|
self.test_boundaryparameters_creation, self.test_generate_simulation,
|
|
230
229
|
self.test_place_fist_molecule, self.test_buffer_trimming, self.test_random_placement,
|
|
231
|
-
self.test_try_placement, self.test_run_simulation]:
|
|
230
|
+
self.test_try_placement, self.test_run_simulation, self.test_no_overlap, self.test_no_large_gaps]:
|
|
232
231
|
with subtests.test(f"{alt_test.__name__}"):
|
|
233
232
|
alt_test(alt_simulator, *arguments)
|
|
234
233
|
|
|
@@ -246,14 +245,6 @@ class TestWithParameters:
|
|
|
246
245
|
|
|
247
246
|
assert not np.array_equal(existing_sim_mols, existing_altsim_mols)
|
|
248
247
|
|
|
249
|
-
def test_alt_nooverlap(self, alt_simulator, configname, molgr_count, surf_type):
|
|
250
|
-
"""Is there no overlap for the alternative simulation as well?"""
|
|
251
|
-
self.test_no_overlap(alt_simulator, configname, molgr_count, surf_type)
|
|
252
|
-
|
|
253
|
-
def test_alt_gaps(self, alt_simulator, configname, molgr_count, surf_type):
|
|
254
|
-
"""Test whether the gap size analysis succeeds for the alternative simulation as well."""
|
|
255
|
-
self.test_no_large_gaps(alt_simulator, configname, molgr_count, surf_type)
|
|
256
|
-
|
|
257
248
|
|
|
258
249
|
def test_surfacetype_invalid_input():
|
|
259
250
|
"""Is an error raised when the lattice type is incorrect?"""
|
|
@@ -3,9 +3,13 @@ from datetime import datetime, timedelta
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
from hypothesis import given, strategies as st, settings
|
|
6
|
-
from shapely import Polygon
|
|
6
|
+
from shapely import Polygon, unary_union
|
|
7
7
|
from shapely.ops import orient
|
|
8
|
-
from
|
|
8
|
+
from shapely.prepared import prep
|
|
9
|
+
from src.adsorpy.run_simulation import run_simulation, RsaConfig, _select_and_run, Simulator
|
|
10
|
+
from typing import Literal
|
|
11
|
+
|
|
12
|
+
SEED = 123654789
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
@pytest.fixture
|
|
@@ -21,22 +25,64 @@ def default_polygon():
|
|
|
21
25
|
return Polygon([(-5, -5), (5, -5), (5, 5), (-5, 5)])
|
|
22
26
|
|
|
23
27
|
|
|
24
|
-
def
|
|
25
|
-
"""
|
|
28
|
+
def overlap_tester(simulator: Simulator) -> Literal[0]:
|
|
29
|
+
"""Tests whether none of the molecules overlap. Solely for periodic boundary conditions."""
|
|
30
|
+
polygons: np.ndarray[Polygon]
|
|
31
|
+
existing = simulator.mol_data.stored_mirr_data["exists"]
|
|
32
|
+
polygons = simulator.mol_data.stored_mirr_data["polygon"][existing]
|
|
33
|
+
|
|
34
|
+
ii: Polygon
|
|
35
|
+
overlap = False
|
|
36
|
+
for idx, ii in enumerate(polygons):
|
|
37
|
+
prepared_multipolygon = prep(unary_union(polygons[idx + 1:]))
|
|
38
|
+
overlap = prepared_multipolygon.intersects(ii) # If there is any overlap, this test fails.
|
|
39
|
+
if overlap:
|
|
40
|
+
break
|
|
41
|
+
|
|
42
|
+
assert not overlap
|
|
43
|
+
|
|
44
|
+
return 0
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def gapsize_tester(simulator: Simulator) -> Literal[0]:
|
|
48
|
+
"""Tests whether there are sites with gaps larger than the largest molecule's circumradius.
|
|
49
|
+
If gaps are larger, a molecule should be able to fit, and the simulation terminated before saturation.
|
|
50
|
+
"""
|
|
51
|
+
gaps = simulator.analyse_gap_size(simulator.surf)
|
|
52
|
+
circumradius = max(molgr.max_radius for molgr in simulator.molgroups)
|
|
53
|
+
assert np.all(gaps <= circumradius)
|
|
54
|
+
|
|
55
|
+
return 0
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def simulation_end_tester(simulator: Simulator, subtests) -> Literal[0]:
|
|
59
|
+
test_functions = (overlap_tester, gapsize_tester)
|
|
60
|
+
for t_func in test_functions:
|
|
61
|
+
with subtests.test(f"{t_func.__name__}"):
|
|
62
|
+
t_func(simulator)
|
|
63
|
+
|
|
64
|
+
return 0
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def test_run_simulation_default_params(rsa_config, default_polygon, subtests):
|
|
68
|
+
"""Test the simulation with default parameter return types."""
|
|
26
69
|
results = run_simulation(rsa_config)
|
|
27
70
|
assert isinstance(results, tuple)
|
|
28
|
-
assert len(results) ==
|
|
71
|
+
assert len(results) == 6
|
|
29
72
|
assert isinstance(results[0], list)
|
|
30
73
|
assert isinstance(results[1], np.ndarray)
|
|
31
74
|
assert isinstance(results[2], int)
|
|
32
75
|
assert isinstance(results[3], np.ndarray)
|
|
33
76
|
assert isinstance(results[4], np.ndarray)
|
|
77
|
+
assert isinstance(results[5], Simulator)
|
|
78
|
+
simulation_end_tester(results[5], subtests)
|
|
34
79
|
|
|
35
80
|
|
|
36
|
-
def test_run_simulation_with_molecule(rsa_config, default_polygon):
|
|
81
|
+
def test_run_simulation_with_molecule(rsa_config, default_polygon, subtests):
|
|
37
82
|
"""Test the simulation with a provided molecule."""
|
|
38
|
-
results = run_simulation(rsa_config, molecules_list=default_polygon)
|
|
83
|
+
results = run_simulation(rsa_config, seed=SEED, molecules_list=default_polygon)
|
|
39
84
|
assert len(results[0]) == 1
|
|
85
|
+
simulation_end_tester(results[5], subtests)
|
|
40
86
|
|
|
41
87
|
|
|
42
88
|
def test_run_simulation_invalid_simulation_type(rsa_config, default_polygon):
|
|
@@ -74,37 +120,41 @@ def test_run_simulation_codosing_mismatch_distribution(rsa_config, default_polyg
|
|
|
74
120
|
)
|
|
75
121
|
|
|
76
122
|
|
|
77
|
-
def test_run_simulation_sequential(rsa_config, default_polygon):
|
|
123
|
+
def test_run_simulation_sequential(rsa_config, default_polygon, subtests):
|
|
78
124
|
"""Test the sequential simulation."""
|
|
79
|
-
results = run_simulation(rsa_config, molecules_list=[default_polygon], simulation_type="sequential")
|
|
125
|
+
results = run_simulation(rsa_config, seed=SEED, molecules_list=[default_polygon], simulation_type="sequential")
|
|
80
126
|
assert len(results[0]) == 1
|
|
127
|
+
simulation_end_tester(results[5], subtests)
|
|
81
128
|
|
|
82
129
|
|
|
83
|
-
def test_run_simulation_codosing(rsa_config, default_polygon):
|
|
130
|
+
def test_run_simulation_codosing(rsa_config, default_polygon, subtests):
|
|
84
131
|
"""Test the codosing simulation."""
|
|
85
132
|
results = run_simulation(
|
|
86
133
|
rsa_config,
|
|
134
|
+
seed=SEED,
|
|
87
135
|
molecules_list=[default_polygon, default_polygon],
|
|
88
136
|
simulation_type="codosing",
|
|
89
137
|
dosing_distribution=[0.5, 0.5]
|
|
90
138
|
)
|
|
91
139
|
assert len(results[0]) == 2
|
|
140
|
+
simulation_end_tester(results[5], subtests)
|
|
92
141
|
|
|
93
142
|
|
|
94
|
-
def test_run_simulation_cascade(rsa_config, default_polygon):
|
|
143
|
+
def test_run_simulation_cascade(rsa_config, default_polygon, subtests):
|
|
95
144
|
"""Test the cascade simulation."""
|
|
96
|
-
results = run_simulation(rsa_config, molecules_list=[default_polygon], simulation_type="cascade")
|
|
145
|
+
results = run_simulation(rsa_config, seed=SEED, molecules_list=[default_polygon], simulation_type="cascade")
|
|
97
146
|
assert len(results[0]) == 1
|
|
147
|
+
simulation_end_tester(results[5], subtests)
|
|
98
148
|
|
|
99
149
|
|
|
100
150
|
def test_run_simulation_boundary_conditions(rsa_config, default_polygon):
|
|
101
151
|
"""Test different boundary conditions."""
|
|
102
152
|
for boundary in ["soft", "hard", "periodic"]:
|
|
103
|
-
results = run_simulation(rsa_config, molecules_list=[default_polygon], boundary_condition=boundary)
|
|
153
|
+
results = run_simulation(rsa_config, seed=SEED, molecules_list=[default_polygon], boundary_condition=boundary)
|
|
104
154
|
assert len(results[0]) == 1
|
|
105
155
|
|
|
106
156
|
|
|
107
|
-
def test_run_simulation_randomness(rsa_config, default_polygon, monkeypatch):
|
|
157
|
+
def test_run_simulation_randomness(rsa_config, default_polygon, monkeypatch, subtests):
|
|
108
158
|
"""Test the randomness based on datetime seed."""
|
|
109
159
|
fixed_datetime = datetime(2023, 1, 1, 0, 0, 0, 1)
|
|
110
160
|
monkeypatch.setattr("run_simulation.datetime", fixed_datetime)
|
|
@@ -128,11 +178,11 @@ def test_run_simulation_determinism(rsa_config, default_polygon, monkeypatch, su
|
|
|
128
178
|
"molecules_list": [default_polygon],
|
|
129
179
|
"seed": 42,
|
|
130
180
|
}
|
|
131
|
-
results_1 = run_simulation(rsa_config, **kwargs)
|
|
132
|
-
results_2 = run_simulation(rsa_config, **kwargs)
|
|
181
|
+
results_1 = run_simulation(rsa_config, **kwargs)[:-1]
|
|
182
|
+
results_2 = run_simulation(rsa_config, **kwargs)[:-1]
|
|
133
183
|
comparison_test_names = ("Mol count", "Gap size", "Seed", "Flux/dose", "ASF")
|
|
134
184
|
for comparison_test_name, output_1, output_2 in zip(comparison_test_names, results_1, results_2, strict=True):
|
|
135
|
-
with subtests.test(comparison_test_name):
|
|
185
|
+
with subtests.test(f"{comparison_test_name} equivalence"):
|
|
136
186
|
assert np.array_equal(output_1, output_2) # Everything should be identical.
|
|
137
187
|
|
|
138
188
|
|
|
@@ -192,7 +242,7 @@ def test_run_simulation_property_test(site_count, lattice_a, boundary_condition,
|
|
|
192
242
|
boundary_condition=boundary_condition,
|
|
193
243
|
seed=seed
|
|
194
244
|
)
|
|
195
|
-
molecule_counters, gap_sizes, seed_out,
|
|
245
|
+
molecule_counters, gap_sizes, seed_out, *_ = results
|
|
196
246
|
|
|
197
247
|
assert len(molecule_counters) == len(molecules_list)
|
|
198
248
|
assert all(count >= 0 for count in molecule_counters)
|
|
@@ -238,15 +288,16 @@ class TestCustomGrid:
|
|
|
238
288
|
"""Does the custom grid generate correctly without errors?
|
|
239
289
|
"""
|
|
240
290
|
rsa_config = RsaConfig(str(Path(__file__).parent / "test_data" / "config_test_periodic.json"))
|
|
241
|
-
run_simulation(rsa_config=rsa_config, site_x_coords=0.9 * np.repeat(np.arange(10), 10),
|
|
242
|
-
|
|
291
|
+
*_, sim = run_simulation(rsa_config=rsa_config, seed=SEED, site_x_coords=0.9 * np.repeat(np.arange(10), 10),
|
|
292
|
+
site_y_coords=0.9 * np.tile(np.arange(10), 10), bounding_x_coord=10,
|
|
293
|
+
bounding_y_coord=10)
|
|
243
294
|
|
|
244
295
|
|
|
245
296
|
def test_sequential_fluxreject():
|
|
246
297
|
"""Does the code handle flux-based simulation correctly?
|
|
247
298
|
"""
|
|
248
299
|
rsa_config = RsaConfig(str(Path(__file__).parent / "test_data" / "config_test_periodic.json"))
|
|
249
|
-
|
|
300
|
+
flux = run_simulation(rsa_config=rsa_config, seed=SEED, simulation_type="sequential", include_rejected_flux=True)[3]
|
|
250
301
|
assert flux is not None # The flux return value has to exist.
|
|
251
302
|
assert isinstance(flux, np.ndarray) # It should be a numpy array.
|
|
252
303
|
assert flux.size # The numpy array should not be empty.
|
adsorpy-1.0.2/CHANGELOG.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
All important changes to this project will be documented in this file.
|
|
3
|
-
|
|
4
|
-
This format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
|
-
|
|
6
|
-
## 1.0.2 - 2026-04-23
|
|
7
|
-
|
|
8
|
-
### Added
|
|
9
|
-
|
|
10
|
-
### Changed
|
|
11
|
-
- Update CI actions to move from node.js 20 to 24.
|
|
12
|
-
|
|
13
|
-
### Fixed
|
|
14
|
-
|
|
15
|
-
### Removed
|
|
16
|
-
- Remove unnecessary type casts.
|
|
17
|
-
|
|
18
|
-
## 1.0.1 - 2026-04-23
|
|
19
|
-
|
|
20
|
-
### Added
|
|
21
|
-
- Implement subtests for the test_run_alt (a test for the RSA simulator on an alternative seed).
|
|
22
|
-
- Add a determinism test to show identical outcome for identical seeds.
|
|
23
|
-
- In tool.ruff.lint: use future-annotations = true, this correctly checks \_\_future\_\_ annotation.
|
|
24
|
-
### Changed
|
|
25
|
-
- Update version dependencies.
|
|
26
|
-
- Strengthen seed comparison test.
|
|
27
|
-
- Vectorise (remove a for-loop) from overlap test.
|
|
28
|
-
|
|
29
|
-
### Fixed
|
|
30
|
-
|
|
31
|
-
### Removed
|
|
32
|
-
|
|
33
|
-
## 1.0.0 - 2025-11-29
|
|
34
|
-
- Full release
|
|
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
|