Skip to main content

Random sequential adsorption (RSA) simulation, 2D lattice-based.

Project description

AdsorPy

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

test results badge codecov

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.

How to use

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.

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) ensures 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).
  • 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.

Project details


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.0.2.tar.gz (363.1 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.0.2-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adsorpy-1.0.2.tar.gz
  • Upload date:
  • Size: 363.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adsorpy-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7912e13686e561ca58342386b25624f81d2b0973351cb38d54a683c1939a790b
MD5 332352f4aa4e5c159a205b12352986c1
BLAKE2b-256 a0730352bb3026f7b6e4e3427a545f17ab68a0e4add9bc4d67f09297622271a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: adsorpy-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adsorpy-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d00ca7b25aff81160c5ddf867946ea4bab17c83d45e491a3ea9d70ee03a10bd
MD5 3d06b4a54f278cdca28d42b793e6eed1
BLAKE2b-256 f8b5f3dc601fc9dc19a04b5fa3947a7d71759cc5eafffd2808dc1d158f7ed903

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page