Skip to main content

AdsorPy

pypi version test results badge docs build results codecov OpenSSF Scorecard OpenSSF Best Practices OpenSSF Baseline

Lattice-based random sequential adsorption (RSA) Python 3.10+ script.

In RSA, molecules arrive one by one at a surface. Adsorption takes place if the molecule does not overlap with molecules already on the surface. The list of available orientations for the molecule is traversed in random order until the first orientation that fits is found, or until the list is exhausted. All available sites are checked, and various metrics can be extracted afterwards such as the coverage, covered area, and gap size distribution.

Output of an AdsorPy run, an image of a covered surface.

How to use

This package can be found on PyPI as adsorpy, so we recommend the following:

pip install adsorpy

Run the adsorpy.main in order to run a simple single run using the standard disk-shaped molecule on hexagonal aluminium oxide. New molecules can be created by running the adsorpy.molecule_lib or by calling the adsorpy.molecule_lib.first_time_loader() function. Molecules can be generated from .xyz files. It is recommended to run adsorpy.molecule_lib directly from command line to define the molecule orientation, then store the new molecule string for repeated use.

Run the adsorpy.run_simulation.run_simulation() function with the molecule footprints generated in the previous step. Output can be printed to stdout, plotted, and saved. An example for dog-bone molecules with rotations of 360 // 12 = 30 degrees:

from adsorpy.run_simulation import run_simulation
from adsorpy.molecule_lib import dogbonium
molecule = dogbonium()
output = run_simulation(molecules_list=molecule, rotation_counts=12, plot_output_flag=True)

User-friendliness will be updated at a later stage, allowing the user to define simulation modes, surfaces, and molecules more easily.

Documentation (generated with sphinx): https://joostfwmaas.github.io/AdsorPy/

Future additions

In a future update, the code will be expanded with diffusion, desorption, and species conversion (changing from one molecule on the surface to another).

Design philosophy

Because AdsorPy has been made with scientific rigour in mind, the package is tested in multiple ways:

  • Unit tests (pytest) of the code ensure correct behaviour for expected input.
  • Property tests (hypothesis) of the most critical code components ensure correct behaviour for unexpected input as well.
  • mypy (in --strict mode) and pyright (strict) ensure that the package is correctly-typed, as if it were static. The py.typed file, a promise that the code is type-hinted properly, is added because the code passes this test.
  • ruff is used as a linter with almost all rules enabled (see the pyproject.toml for the list of exclusions and reasons).
  • slotscheck ensures that all dataclass slots are set up correctly.
  • tach ensures that internal dependencies are handled correctly (from low level to high), preventing circular dependencies.
  • tox is used to run all of the aforementioned tests in parallel for multiple Python versions to ensure correct behaviour.
  • CI is used for automated testing.

The package also makes use of an optional config file that falls back on standard behaviour, because configs are often used in scientific software (set-and-forget).

Openness and academic collaboration

The script was made public for the sake of openness and academic collaboration. Please let me know if you have questions about the script, or if you have discovered any issues/bugs. At the end of this file, I will place a list of papers that make use of this work. Feel free to contact me if you want your work to be added to the list as well.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adsorpy-1.3.0.tar.gz (255.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adsorpy-1.3.0-py3-none-any.whl (261.3 kB view details)

Uploaded Python 3

File details

Details for the file adsorpy-1.3.0.tar.gz.

File metadata

  • Download URL: adsorpy-1.3.0.tar.gz
  • Upload date:
  • Size: 255.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for adsorpy-1.3.0.tar.gz
Algorithm Hash digest
SHA256 3acce3d386d297ea8cb75d3a218db147118f320c74e79b10fffaa2908fdee4e7
MD5 ee53e8325c3bd03d023ed805534460e3
BLAKE2b-256 4477f326f1205f70adacad70647581ad55e7517d95db96e58471946fd1303114

See more details on using hashes here.

Provenance

The following attestation bundles were made for adsorpy-1.3.0.tar.gz:

Publisher: publish_to_PyPI.yml on JoostFWMaas/AdsorPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adsorpy-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: adsorpy-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 261.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for adsorpy-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e58594ab72c5e3c2801e788478c70973af3a2bc14f20af2e8a664ccc60e155d
MD5 1b9aad0995587d38afd5cd4b44b1652a
BLAKE2b-256 64e5f667de372a110e84aeadf5392e020053e0fd0c6b8cc995c05c981d52542f

See more details on using hashes here.

Provenance

The following attestation bundles were made for adsorpy-1.3.0-py3-none-any.whl:

Publisher: publish_to_PyPI.yml on JoostFWMaas/AdsorPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.3.1

26 files

This release

1.3.0 This release

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.0.3

2 files

1.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page