Skip to main content

A framework for processing adsorption data for porous materials

Project description

pyGAPS (Python General Adsorption Processing Suite) is a framework for adsorption data analysis written in Python 3.

Features

  • Advanced adsorption data import and manipulation

  • Routine analysis such as BET/Langmuir surface area, t-plot, alpha-s, Dubinin plots etc.

  • Pore size distribution calculations for mesopores (BJH, Dollimore-Heal)

  • Pore size distribution calculations for micropores (Horvath-Kawazoe)

  • Pore size distribution calculations using DFT kernels

  • Isotherm model fitting (Henry, Langmuir, DS/TS Langmuir, etc..)

  • IAST calculations for binary and multicomponent adsorption

  • Isosteric heat of adsorption calculations

  • Parsing to and from multiple formats such as Excel, CSV and JSON

  • An sqlite database backend for storing and retrieving data

  • Simple methods for isotherm graphing and comparison

Documentation

For more info, as well as a complete manual and reference visit:

https://pygaps.readthedocs.io/

Most of the examples in the documentation are actually in the form of Jupyter Notebooks which are turned into webpages with nbsphinx. You can find them for download in:

https://github.com/pauliacomi/pyGAPS/tree/master/docs/examples

Installation

The easiest way to install pyGAPS is from the command line. Make sure that you have numpy, scipy, pandas and matplotlib, as well as CoolProp already installed.

pip install pygaps

On Windows, Anaconda/Conda is your best bet since it manages environments for you. First create a new environment and use conda to install the dependencies (or start with one that already has a full instalation). Then use pip inside your environment.

conda create -n py3 python=3 numpy scipy pandas matplotlib CoolProp
activate py3
pip install pygaps

Alternatively, to install the development branch, clone the repository from Github. Then install the package with pip or setuptools, either in regular or developer mode.

git clone https://github.com/pauliacomi/pyGAPS

// then install

pip install ./              # pip
python setup.py install     # setuptools

// or developer mode

pip install -e ./           # pip
python setup.py develop     # setuptools

Development

If you have all the python environments needed to run the entire test suite, use tox. To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

For testing only with the environment you are currently on, run instead

python setup.py test

# or run pytest

pytest

Alternatively, you can depend on travisCI for the testing, which will be slower overall but should have all the environments required.

Questions?

I’m more than happy to answer any questions. Shoot me an email at paul.iacomi@univ-amu or find me on some social media.

For any bugs found, please open an issue or, If you feel like you can do the fix yourself, submit a pull request. It’ll make my life easier

This also applies to any features which you think might benefit the project.

Changelog

1.5.0 (2019-03-12)

Features:

  • Increased number of adsorbates available in pyGAPS to 40.

  • New material characterisation functions: Dubinin-Radushkevich (dr_plot) and Dubinin-Astakov (da_plot) plots.

  • Added a new way to create an isotherm, from an two arrays of pressure and loading (the old DataFrame method is still valid but changed: check breaking changes).

  • Made adsorbates searchable by a list of aliases rather than a single name.

  • Exposed the CoolProp backend on adsorbate objects for convenience, it is accessible through the adsorbate.backend property.

  • Streamlined the internal database functions.

  • Updated NIST json import to new format. Cannot import multicomponent isotherms.

  • Functions which generate matplotlib graphs now can take an Ax as parameter (similar to behaviour of pandas) to plot on existing figures.

  • Changed behaviour of ModelIsotherm.guess function to accept a list of models to attempt to guess for.

  • Added b-spline smoothing to output of dft fitting.

Breaking changes:

  • The Sample class is now renamed as Material.

  • Isotherm creation parameters have changed from ‘sample_name’, ‘sample_batch’ and ‘t_exp’ to ‘material_name’, ‘material_batch’ and ‘t_iso’.

  • Backend database has been simplified. Many required fields are no longer present and left to the discretion of the user.

  • Several database functions have been renamed. All functions switched: ‘sample’ -> ‘material’ and ‘experiment’ -> ‘isotherm’.

  • When passing a DataFrame for isotherm creation, it now has to be specified as the parameter ‘isotherm_data’.

  • Isotherm unique ID is now generated on the fly (previously generated at each isotherm modification). It also now takes into account only the required parameters for each isotherm ( ‘sample_name’, ‘sample_batch’, ‘t_exp’ and ‘adsorbate’) as well as the model name, if the isotherm is a ModelIsotherm.

  • Renamed Adsorbate.from_list() method to Adsorbate.find()

Bugfixes:

  • Fixed issue in CSV import which read all values as strings (instead of floats/bools)

  • Fixed an issue with Excel import of bools, as they were previously read as 1/0

  • Fixed a bug where the automatic branch detection was not working when the DataFrame passed had a non-standard index.

  • Fixed not being able to call _repr_ on an isotherm.

1.4.0 (2018-11-10)

Features:

  • Added the GAB isotherm model

Bugfixes:

  • Improved pore size distribution calculations to display cumulative pore volume when called.

  • Fixed the “all-nol” selection parameter for legend display in isotherm graphs.

1.3.0 (2018-08-13)

Features:

  • Added an excel import which can take Micromeritics or Belsorp report (.xls) files. Micromeritics code was taken from the official python repo.

  • Added an import option which can read and import Belsorp data (.DAT) files.

  • Improved plotting functions to allow for more customisation over how the graph looks.

  • The extra arguments to print_info() are now passed to the plotting function allowing for styles such as 8.

Breaking changes:

  • The unique isotherm ID is now generated only on a small subset of properties instead of all isotherm properties.

  • The isotherm ‘other_properties’ subdictionary has been removed. Instead, all isotherm properties are now direct members of the class.

  • When plotting, isotherm branches are now defined as ‘ads’, ‘des’ ‘all’ (both branches) and ‘all-nol’ (both branches without legend entry) instead of a list of branches.

  • Plot types are now universal. Any property can be plotted against any other property by specifying the x_data, y1_data and y2_data.

Bugfixes:

  • Fixed ‘source’ not being recognised as an isotherm field

  • Re-worked plot_iso color selection to avoid errors (10)

  • Re-worked plot_isp legend placement to ensure no overlap

  • Added correct common name for ethylene, propylene, methanol and ethanol in the database

  • Renamed some model parameters for consistency

  • A lot of typo fixes

1.2.0 (2018-02-19)

Features:

  • The plotting legend now works with any isotherm attribute specified

  • Changed model parent class to print out model name when displayed

  • Added Toth and Jensen-Seaton models to the IAST calculation (spreading pressure is computed numerically using scipy.integrate.quad, 7)

Bugfixes:

  • Fixed an issue where the returned IAST selectivity v pressure data would not include all pressures

  • Changed sqlite retrieval order to improve performance (2)

  • Fixed an error where IAST vle data was plotted opposite to the graph axes

  • Fixed a mistake in the Jensen-Seaton equation

  • Fixed a mistake in the FH-VST equation

1.1.1 (2018-02-11)

Features:

  • Allowed for branch selection for isosteric heat and fixed an error where this was an issue (3)

Bugfixes:

  • Fixed an issue when plotting isotherms with and without secondary data simultaneously

  • Fixed error with magnitude of polarizability of adsorbate from database in microporous PSD

1.1.0 (2018-01-24)

  • Automatic travis deployment to PyPI

  • Improved enthalpy modelling for initial enthalpy determination

  • Improved documentation

1.0.1 (2018-01-08)

  • Fixed wrong value of polarizability for nitrogen in database

  • Added a check for initial enthalpy when the isotherm is measured in supercritical mode

1.0.0 (2018-01-01)

  • Improved unit management by adding a unit/basis for both the adsorbent (ex: amount adsorbed per g, kg or cm3 of material are all valid) and loading (ex: mmol, g, kg of gas adsorbed per amount of material are all valid)

  • Separated isotherm models so that they can now be easily created by the used.

  • Added new isotherm models: Toth, Jensen-Seaton, W-VST, FH-VST.

  • Made creation of classes (Adsorbate/Sample/Isotherms) more intuitive.

  • Many small fixes and improvements

0.9.3 (2017-10-24)

  • Added unit_adsorbate and basis_loading as parameters for an isotherm, although they currently do not have any influence on data processing

0.9.2 (2017-10-24)

  • Slightly changed json format for efficiency

0.9.1 (2017-10-23)

  • Better examples

  • Small fixes and improvements

0.9.0 (2017-10-20)

  • Code is now in mostly working state.

  • Manual and reference are built.

0.1.0 (2017-07-27)

  • First release on PyPI.

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

pygaps-1.5.0.tar.gz (3.7 MB view hashes)

Uploaded Source

Built Distribution

pygaps-1.5.0-py2.py3-none-any.whl (233.2 kB view hashes)

Uploaded Python 2 Python 3

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