Skip to main content

Electrolyte database manager

Project description

electrolytes

CI Codecov Checked with mypy Pydantic v2 PyPI PyPI - Python Version Docker image

electrolytes provides command-line and programatic access to a database of electrolytes and their properties. It includes 518 components by default (see credits). The package covers basic management of the database, including support for storing user-defined electrolytes.

electroMicroTransport

electrolytes is primarily developed as a utility to assist in preparing simulation cases for the electroMicroTransport toolbox for electromigrative separations. However, it is an independent package and can be installed and used separately.

Installation

Install with pip:

$ python3 -m pip install electrolytes

electrolytes currently requires Python 3.7 or later, and a relatively recent version of pip (pip may be upgraded with python3 -m pip install --upgrade pip).

Command-line usage

Invoke the electrolytes command-line application to search the database, find the details of a particular component, or to add/remove user-defined components. In your terminal, run:

$ electrolytes

or, alternatively:

$ python3 -m electrolytes

Add the --help flag to learn what options are available.

Python API

The Python API is provided for electroMicroTransport case initialization scripts.

from electrolytes import database, Properties

You can look up components in the database as you would with dict (with component names as keys), and also add user-defined components with the add method (as if database were a set). Components are instances of the Constituent class. Extra methods are also defined for database:

    def user_defined(self) -> Iterable[str]: ...

    def is_user_defined(self, name: str) -> bool: ...

Constituent names are case insensitive and will be automatically converted to all uppercase. Any instances added to (or removed from) the database will be saved for the current operating system user. Default components cannot be changed or removed (expect a ValueError if you try).

The public stubs of the Constituent class are:

class Constituent:
    def __init__(self,
                 *,
                 name: str,
                 u_neg: Sequence[float],  # [-neg_count, -neg_count+1, -neg_count+2, ..., -1]
                 u_pos: Sequence[float],  # [+1, +2, +3, ..., +pos_count]
                 pkas_neg: Sequence[float],  # [-neg_count, -neg_count+1, -neg_count+2, ..., -1]
                 pkas_pos: Sequence[float],  # [+1, +2, +3, ..., +pos_count]
                 neg_count: int = -1,
                 pos_count: int = -1): ...

    # Interface for electroMicroTransport
    def mobilities(self) -> Sequence[float]: ...  # [+n, ..., +3, +2, +1, -1, -2, -3, ..., -n] (with n >= 3), SI units
    def pkas(self) -> Sequence[float]: ...  # [+n, ..., +3, +2, +1, -1, -2, -3, ..., -n] (with n >= 3)
    def diffusivity(self) -> float: ...  # SI units

Data credits

Electrolyte data taken from the Simul 6 application[^simul6] (homepage, GitHub). The dataset of different electrolytes was originally compiled by Prof. Hirokawa[^Hirokawa].

[^simul6]: GAŠ, Bohuslav; BRAVENEC, Petr. Simul 6: A fast dynamic simulator of electromigration. Electrophoresis, 2021, vol. 42, no. 12-13, pp. 1291-1299. DOI: 10.1002/elps.202100048

[^Hirokawa]: HIROKAWA, Takeshi, et al. Table of isotachophoretic indices: I. Simulated qualitative and quantitative indices of 287 anionic substances in the range ph 3–10. Journal of Chromatography A, 1983, vol. 271, no. 2, pp. D1-D106. DOI: 10.1016/S0021-9673(00)80225-3

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

electrolytes-0.2.4.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

electrolytes-0.2.4-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file electrolytes-0.2.4.tar.gz.

File metadata

  • Download URL: electrolytes-0.2.4.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for electrolytes-0.2.4.tar.gz
Algorithm Hash digest
SHA256 1e9a6f568a7feca659cb95fd8b91969dfdded76941096daa136941efabb86528
MD5 d61f06c1a48a49d74527a4ca312d5019
BLAKE2b-256 34b484ea1b4fd2e0ab74f79e619e878c0eb398df4553e5661eda49f486f02317

See more details on using hashes here.

File details

Details for the file electrolytes-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: electrolytes-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for electrolytes-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b14be214b169b7b36f3ada11b83495b33c3ed7b9728a6df54b08f0d9e0584eab
MD5 2f88e76d9b90a6d8713ffa02b0d02e0d
BLAKE2b-256 78a3a306bec5bc9d40f1daf28faef0e1a02836bfe1091c340b08b269c09a3765

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