Skip to main content

pysorb

pysorb is a Python library for adsorption modelling across equilibrium and dynamic kinetic workflows. It connects reusable numerical solvers for scripted scientific computing with GUI-facing adsorption workflows.

The current package supports pure-component isotherm fitting, multicomponent mixture prediction, fixed-bed breakthrough simulation, Crank diffusion uptake analysis, and zero length column (ZLC) modelling. The numerical routines use NumPy and SciPy, with Numba-compatible kernels used in the mixture and breakthrough solvers for repeated numerical evaluation.

The package contains five solver areas:

  • pysorb.mix for multicomponent equilibrium calculations.
  • pysorb.bt for fixed-bed breakthrough simulations.
  • pysorb.fit for adsorption isotherm fitting.
  • pysorb.crank for Crank diffusion uptake calculations.
  • pysorb.zlc for zero length column simulations.

The current package release is 0.2.2; version 0.1.0 was used as an initial PyPI test release.

Citation

Citation metadata is provided in CITATION.cff.

Archived release DOI: 10.5281/zenodo.20478633

Installation

pip install pysorb

For local development from this repository:

pip install -e .

Basic Usage

from pysorb.crank import crank_uptake, fit_D_R2
from pysorb.zlc import linmodel
from pysorb.mix import parse, unary, ext, iast
from pysorb.fit import fit_isotherm
from pysorb.bt import run_simulation

Crank diffusion

from pysorb.crank import crank_uptake

q_over_qinf = crank_uptake([0, 1, 2], D_R2=0.001)

ZLC

from pysorb.zlc import linmodel

t, c, c_preload, q, q_preload, sigsum = linmodel(
    Lsat=20,
    DR2=6.4e-3,
    gamma=0.001,
    tsat=50,
    t_end=80,
    NN="auto",
)

Mixture equilibrium

from pysorb.mix import parse, iast

components = [
    {"MoleculeName": "A", "isotherms": [["Langmuir", 1.0, 0.5]]},
    {"MoleculeName": "B", "isotherms": [["Langmuir", 2.0, 0.2]]},
]

parsed = parse(components)
result = iast([1.0, 0.5], parsed=parsed)

Isotherm fitting

import numpy as np
from pysorb.fit import fit_isotherm

P = np.array([0.1, 0.3, 0.7, 1.2, 2.0])
T = np.full_like(P, 298.15)
q = 1.5 * 0.8 * P / (1 + 0.8 * P)

fit = fit_isotherm(P, q, T, "Langmuir", mode="single")
print(fit.parameters)

Breakthrough

from pysorb.bt import run_simulation

# Pass the same input dictionary shape used by the existing BT solver.
result = run_simulation(inputs)

Metadata

Release files for pysorb 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysorb 0.2.2
File Size Uploaded Provenance Actions
pysorb-0.2.2.tar.gz 48.6 kB Without provenance Details for pysorb-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysorb 0.2.2
File Interpreter ABI Platform Actions
pysorb-0.2.2-py3-none-any.whl Python 3 none any Details for pysorb-0.2.2-py3-none-any.whl

Total release size: 98.5 kB

Release files / pysorb-0.2.2.tar.gz

Download URL pysorb-0.2.2.tar.gz
Size 48.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bb2a734b7b76d6340743e183e655d97cc3bc774fa4a2cef1840fbb4918f3acf2
BLAKE2b-256 checksum
How to use checksums
3f2b87b4b5f9e9c77de44bf46daf37c26011685823a70e839093ee429d34ee13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / pysorb-0.2.2-py3-none-any.whl

Download URL pysorb-0.2.2-py3-none-any.whl
Size 49.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49a3595a0f34f93fa3e5032ae5dae2ebf6f78f30599269b40ba6f44a5f2dbb5c
BLAKE2b-256 checksum
How to use checksums
da60bcb28bfb5730943f4ba4296e25c543405173fcc8d81aee51384a6ee5a921
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for pysorb 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

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