Skip to main content

Build, run and optimise kinetic multi-layer models of aerosols and films

Project description

MutilayerPy

DOI

A package used to build a kinetic multi-layer model for aerosol particles and films. Released under the GNU GPL v3.0 license.

Contents

Overview

MultilayerPy is a Python-based framework for constructing, running and optimising kinetic multi-layer models of aerosol particles and films. In this repository you will find the core MultilayerPy package along with reference documentation (html files) and a directory of tutorial Jupyter notebooks to get you started.

The framework is summarised in the figure below:

image

MultilayerPy takes advantage of the object-oriented programming (OOP) paradigm and represents the common building blocks (reaction scheme, diffusion regime, model components) as separate classes.

These classes can be used to build the model, the code for which is automatically generated by MultilayerPy.

The model can be paired with experimental data in order to carry out inverse modelling: where model parameters are adjusted such that the best fit to the data is obtained. This can be done using a local or global optimisation algorithm.

Additionally, Markov Chain Monte Carlo (MCMC) sampling of the model-data system can be carried out using MultilayerPy, incorporating the well-established emcee Python package.

A more detailed description of how MultilayerPy works is outlined in the reference manual and in the upcoming manuscript (close to submission).

Installation

There are currently three ways of installing MultilayerPy:

1) A pip install

Running pip install multilayerpy in your terminal window will download and build MultilayerPy in your python environment, enabling you to import the package without being in the source code directory. This is the most straightforward method. It does not include any of the tutorial notebooks and data, which need to be downloaded separately from the GitHub repository or Zeondo archive.

2) Download the .zip file

You can download this repository as a .zip file from the releases tab in this repository or by clicking on the upper-left "code" button and selecting "download ZIP" for the latest version (the latest version may still be under development).

3) Clone the Git Hub repository

To keep an up-to-date version on your system, clone the repository using git and the command line:

$ git clone https://github.com/tintin554/kinetic-multilayer-model-builder.git

Then a simple $ git pull would update your local copy with the latest "nightly" version of the package. Be warned that these may not be the final stable versions of the next release of MultilayerPy. Check this by typing print(multilayerpy.__version__) into your python terminal. Download the package from the releases tab for the latest stable version.

If you want to make changes to the source code and/or submit pull requests, fork this repository and include your own features. This is highly encouraged! (see Contributing)

Unit tests should be run after installing or updating the package using methods 2 & 3. Run the testing.py script from the terminal:

$ python -m unittest testing.py -v

There should be no test failures. Alternatively, the testing.py code could be run from an interactive Spyder session.

Anaconda Python distribution (Spyder and Jupyter Notebook)

The tutorials for this package are written in Jupyter notebooks and the code was developed using Spyder. Both of these programs are available in the Anaconda Python distribution. It is recommended that the user uses this Python distribution to run MultilayerPy.

Dependencies

This package requires the standard Anaconda python distribution (developed on Python version 3.8.8) and the following packages (and versions) are used for development:

  • SciPy (1.7.3)
  • NumPy (1.21.5)
  • Matplotlib (3.3.4)
  • emcee (3.1.1)

Scipy, Numpy and Matplotlib come with the standard Anaconda python distribution. The most straightforward way to install emcee on your system is to type pip install emcee into your python terminal. Note that SciPy version >1.7.1 is required for the full functionality of the optimize module. MultilayerPy works on emcee version 3.1.1 onwards (this is monitored).

Reference documentation

Open the reference documentation html file in your internet browser. There is a search function which enables the user to search the package for documenation on a specific aspect of the source code.

Tutorials

You will find the tutorial Jupyter notebooks in the GitHub repository and the linked Zenodo archive.

If you have downloaded the package from the Zenodo archive or as a .zip from the GihHub repository, the notebooks should be run in the parent directory containing multilayerpy.

If you have installed the package using pip the notebook can be run from anywhere. Note that some notebooks require data available in the GihHub repository and Zenodo archive.

Contributing

In order for this project to progress, input from the community is vital. Please use the issues section of this repository to flag any issues. Forking this repository and submitting pull requests for discussion is highly encouraged as this is the best way to develop and improve this package.

Please send general feedback and suggestions to the package creator using these details:

Adam Milsom (University of Birmingham): a.milsom.2@bham.ac.uk

Suggestions are very welcome!

Acknowledgement and citation

We would greatly appreciate citation of the description paper (in submission) and source code (see beginning of this README) if MultilayerPy was used in your study.

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

multilayerpy-1.0.1.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

multilayerpy-1.0.1-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file multilayerpy-1.0.1.tar.gz.

File metadata

  • Download URL: multilayerpy-1.0.1.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.8

File hashes

Hashes for multilayerpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bc01d7569a06e50fd9182cc0f4737bfea52be1a15c3b197ed9090b70ad3570df
MD5 5e479857b4855ede17b67b67173c04dc
BLAKE2b-256 70c1c5490e91e8d3bef6d0b5575793d07b267a2f232fef860724561e57035830

See more details on using hashes here.

File details

Details for the file multilayerpy-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multilayerpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c4ac9a52e9f13dda4b1ee4217a0b89a8284cbd79974f110f5bfa62922c37634
MD5 43180d6ad5742c86252fd0b6e8c4b2d2
BLAKE2b-256 b389ec4806f9f1d8d570f44ce48429843616d25cd45da7337032b6bd82d5d29d

See more details on using hashes here.

Supported by

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