pyDMS-sorption 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydms_sorption-0.9.0/LICENSE +28 -0
- pydms_sorption-0.9.0/PKG-INFO +123 -0
- pydms_sorption-0.9.0/README.rst +85 -0
- pydms_sorption-0.9.0/pyDMS/__init__.py +56 -0
- pydms_sorption-0.9.0/pyDMS/dms.py +1684 -0
- pydms_sorption-0.9.0/pyDMS/evaluate.py +358 -0
- pydms_sorption-0.9.0/pyDMS/fugacity.py +493 -0
- pydms_sorption-0.9.0/pyDMS/images/__init__.py +0 -0
- pydms_sorption-0.9.0/pyDMS/images/lab-logo-transparent-background.png +0 -0
- pydms_sorption-0.9.0/pyDMS/multigas.py +146 -0
- pydms_sorption-0.9.0/pyDMS/report.py +668 -0
- pydms_sorption-0.9.0/pyDMS/visualize.py +311 -0
- pydms_sorption-0.9.0/pyDMS_sorption.egg-info/PKG-INFO +123 -0
- pydms_sorption-0.9.0/pyDMS_sorption.egg-info/SOURCES.txt +21 -0
- pydms_sorption-0.9.0/pyDMS_sorption.egg-info/dependency_links.txt +1 -0
- pydms_sorption-0.9.0/pyDMS_sorption.egg-info/requires.txt +23 -0
- pydms_sorption-0.9.0/pyDMS_sorption.egg-info/top_level.txt +1 -0
- pydms_sorption-0.9.0/pyproject.toml +64 -0
- pydms_sorption-0.9.0/setup.cfg +4 -0
- pydms_sorption-0.9.0/tests/test_analysis.py +0 -0
- pydms_sorption-0.9.0/tests/test_dms.py +330 -0
- pydms_sorption-0.9.0/tests/test_fugacity.py +97 -0
- pydms_sorption-0.9.0/tests/test_report.py +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Massachusetts Institute of Technology
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyDMS-sorption
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: Python package for physics-informed dual-mode sorption (DMS) optimization
|
|
5
|
+
Author: Brandon C. Tapia, Pablo A. Dean, Jing Ying Yeo, Albert X. Wu
|
|
6
|
+
Author-email: "Zachary P. Smith" <smithlab_software@mit.edu>
|
|
7
|
+
License-Expression: BSD-3-Clause
|
|
8
|
+
Keywords: sorption,membranes,gas separation,polymer modeling
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/x-rst
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: numpy
|
|
18
|
+
Requires-Dist: matplotlib
|
|
19
|
+
Requires-Dist: Pillow
|
|
20
|
+
Requires-Dist: reportlab
|
|
21
|
+
Requires-Dist: scipy
|
|
22
|
+
Requires-Dist: statsmodels
|
|
23
|
+
Requires-Dist: scikit-learn
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest; extra == "dev"
|
|
26
|
+
Requires-Dist: black; extra == "dev"
|
|
27
|
+
Requires-Dist: build; extra == "dev"
|
|
28
|
+
Requires-Dist: twine; extra == "dev"
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
31
|
+
Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
|
|
32
|
+
Requires-Dist: sphinx_copybutton; extra == "docs"
|
|
33
|
+
Requires-Dist: furo; extra == "docs"
|
|
34
|
+
Provides-Extra: publish
|
|
35
|
+
Requires-Dist: build; extra == "publish"
|
|
36
|
+
Requires-Dist: twine; extra == "publish"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
.. image:: https://img.shields.io/github/license/SmithLabMIT/pyDMS
|
|
40
|
+
:alt: GitHub License
|
|
41
|
+
:target: https://github.com/SmithLabMIT/pyDMS/blob/main/LICENSE
|
|
42
|
+
|
|
43
|
+
.. image:: https://app.readthedocs.org/projects/pydms/badge/?version=latest
|
|
44
|
+
:alt: Documentation Status
|
|
45
|
+
:target: https://pydms.readthedocs.io/en/latest/
|
|
46
|
+
|
|
47
|
+
pyDMS
|
|
48
|
+
=====
|
|
49
|
+
|
|
50
|
+
Python package for dual-mode sorption (DMS) analysis
|
|
51
|
+
-----------------------------------------------------
|
|
52
|
+
|
|
53
|
+
.. image:: https://raw.githubusercontent.com/SmithLabMIT/pyDMS/main/images/pyDMS_logo.png
|
|
54
|
+
:width: 300
|
|
55
|
+
:align: center
|
|
56
|
+
|
|
57
|
+
pyDMS is a Python program for the computation of dual-mode sorption (DMS) parameters using linear free energy relationship (LFER) and Van't Hoff constraints.
|
|
58
|
+
|
|
59
|
+
pyDMS is developed in the `Smith Lab <https://smithlab.mit.edu/>`_ in the `Department of Chemical Engineering <https://cheme.mit.edu/>`_ at the `Massachusetts Institute of Technology <https://mit.edu/>`_.
|
|
60
|
+
|
|
61
|
+
pyDMS documentation is hosted on `Read the Docs <https://pydms.readthedocs.io>`_.
|
|
62
|
+
|
|
63
|
+
The journal article describing pyDMS is published in *AIChE J.* which can be found `here <LINK>`_.
|
|
64
|
+
|
|
65
|
+
Features
|
|
66
|
+
--------
|
|
67
|
+
|
|
68
|
+
- Compute reproducible DMS parameters: :math:`C_\mathrm{H}^\prime`, :math:`k_\mathrm{D}`, and :math:`b` with uncertainty via LFERs and van't Hoff constraints.
|
|
69
|
+
- Access computed results in Python objects or via the automatically output PDF.
|
|
70
|
+
- Compute pure and mixed-gas sorption isotherms from the DMS parameters with uncertainty values.
|
|
71
|
+
- Calculate ideal and mixed-gas sorption selectivities with uncertainty values.
|
|
72
|
+
- Calculate fugacity from pressure via Virial and Peng--Robinson implementation.
|
|
73
|
+
|
|
74
|
+
Installation
|
|
75
|
+
------------
|
|
76
|
+
|
|
77
|
+
pyDMS can be installed using:
|
|
78
|
+
|
|
79
|
+
- conda: ``conda install package-not-yet-available``
|
|
80
|
+
- pip: ``pip install package-not-yet-available``
|
|
81
|
+
|
|
82
|
+
Alternatively, users can install the latest version from GitHub, either directly:
|
|
83
|
+
|
|
84
|
+
.. code-block:: bash
|
|
85
|
+
|
|
86
|
+
python -m pip install git+https://github.com/SmithLabMIT/pyDMS.git
|
|
87
|
+
|
|
88
|
+
or by downloading the source code:
|
|
89
|
+
|
|
90
|
+
.. code-block:: bash
|
|
91
|
+
|
|
92
|
+
git clone https://github.com/SmithLabMIT/pyDMS.git
|
|
93
|
+
cd pyDMS
|
|
94
|
+
python -m pip install .
|
|
95
|
+
|
|
96
|
+
For developers, it is recommended to download the source code and install in editable mode by replacing ``python -m pip install .`` with ``python -m pip install -e .``.
|
|
97
|
+
|
|
98
|
+
Citation(s)
|
|
99
|
+
-----------
|
|
100
|
+
|
|
101
|
+
**If you used pyDMS, please cite:**
|
|
102
|
+
|
|
103
|
+
Tapia, B. C.; Dean, P. A.; Yeo, J. Y.; Wu, A. X., Smith, Z. P. pyDMS: A Python package for the determination of physics-informed, reproducible dual-mode sorption (DMS) parameters. *AIChE J.* Accepted **2026**.
|
|
104
|
+
|
|
105
|
+
**We also recommend citing the following works which provide relevant background and theory on van't Hoff sorption energetics, LFERs, and their application to constrained DMS optimization, respectively:**
|
|
106
|
+
|
|
107
|
+
Koros, W. J.; Paul, D. R.; Huvard, G. S. Energetics of Gas Sorption in Glassy Polymers. *Polymer* **1979**, *20* (8), 956--960. https://doi.org/10.1016/0032-3861(79)90192-7.
|
|
108
|
+
|
|
109
|
+
Freeman, B. D. Basis of Permeability/Selectivity Tradeoff Relations in Polymeric Gas Separation Membranes. *Macromolecules* **1999**, *32* (2), 375--380. https://doi.org/10.1021/ma9814548.
|
|
110
|
+
|
|
111
|
+
Wu, A. X.; Drayton, J. A.; Mizrahi Rodriguez, K.; Benedetti, F. M.; Qian, Q.; Lin, S.; Smith, Z. P. Elucidating the Role of Fluorine Content on Gas Sorption Properties of Fluorinated Polyimides. *Macromolecules* **2021**, *54* (1), 22--34. https://doi.org/10.1021/acs.macromol.0c01746.
|
|
112
|
+
|
|
113
|
+
License
|
|
114
|
+
-------
|
|
115
|
+
|
|
116
|
+
Copyright © 2026 The Massachusetts Institute of Technology
|
|
117
|
+
|
|
118
|
+
This work is licensed under the 3-clause BSD license (see ``LICENSE``).
|
|
119
|
+
|
|
120
|
+
Acknowledgements
|
|
121
|
+
----------------
|
|
122
|
+
|
|
123
|
+
This work was supported by a MathWorks Fellowship, NSF CAREER Award (no. 2146422), and the U.S. Department of Energy, Office of Science, Basic Energy Sciences, Separation Science Program under Award DE-SC0023252.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
.. image:: https://img.shields.io/github/license/SmithLabMIT/pyDMS
|
|
2
|
+
:alt: GitHub License
|
|
3
|
+
:target: https://github.com/SmithLabMIT/pyDMS/blob/main/LICENSE
|
|
4
|
+
|
|
5
|
+
.. image:: https://app.readthedocs.org/projects/pydms/badge/?version=latest
|
|
6
|
+
:alt: Documentation Status
|
|
7
|
+
:target: https://pydms.readthedocs.io/en/latest/
|
|
8
|
+
|
|
9
|
+
pyDMS
|
|
10
|
+
=====
|
|
11
|
+
|
|
12
|
+
Python package for dual-mode sorption (DMS) analysis
|
|
13
|
+
-----------------------------------------------------
|
|
14
|
+
|
|
15
|
+
.. image:: https://raw.githubusercontent.com/SmithLabMIT/pyDMS/main/images/pyDMS_logo.png
|
|
16
|
+
:width: 300
|
|
17
|
+
:align: center
|
|
18
|
+
|
|
19
|
+
pyDMS is a Python program for the computation of dual-mode sorption (DMS) parameters using linear free energy relationship (LFER) and Van't Hoff constraints.
|
|
20
|
+
|
|
21
|
+
pyDMS is developed in the `Smith Lab <https://smithlab.mit.edu/>`_ in the `Department of Chemical Engineering <https://cheme.mit.edu/>`_ at the `Massachusetts Institute of Technology <https://mit.edu/>`_.
|
|
22
|
+
|
|
23
|
+
pyDMS documentation is hosted on `Read the Docs <https://pydms.readthedocs.io>`_.
|
|
24
|
+
|
|
25
|
+
The journal article describing pyDMS is published in *AIChE J.* which can be found `here <LINK>`_.
|
|
26
|
+
|
|
27
|
+
Features
|
|
28
|
+
--------
|
|
29
|
+
|
|
30
|
+
- Compute reproducible DMS parameters: :math:`C_\mathrm{H}^\prime`, :math:`k_\mathrm{D}`, and :math:`b` with uncertainty via LFERs and van't Hoff constraints.
|
|
31
|
+
- Access computed results in Python objects or via the automatically output PDF.
|
|
32
|
+
- Compute pure and mixed-gas sorption isotherms from the DMS parameters with uncertainty values.
|
|
33
|
+
- Calculate ideal and mixed-gas sorption selectivities with uncertainty values.
|
|
34
|
+
- Calculate fugacity from pressure via Virial and Peng--Robinson implementation.
|
|
35
|
+
|
|
36
|
+
Installation
|
|
37
|
+
------------
|
|
38
|
+
|
|
39
|
+
pyDMS can be installed using:
|
|
40
|
+
|
|
41
|
+
- conda: ``conda install package-not-yet-available``
|
|
42
|
+
- pip: ``pip install package-not-yet-available``
|
|
43
|
+
|
|
44
|
+
Alternatively, users can install the latest version from GitHub, either directly:
|
|
45
|
+
|
|
46
|
+
.. code-block:: bash
|
|
47
|
+
|
|
48
|
+
python -m pip install git+https://github.com/SmithLabMIT/pyDMS.git
|
|
49
|
+
|
|
50
|
+
or by downloading the source code:
|
|
51
|
+
|
|
52
|
+
.. code-block:: bash
|
|
53
|
+
|
|
54
|
+
git clone https://github.com/SmithLabMIT/pyDMS.git
|
|
55
|
+
cd pyDMS
|
|
56
|
+
python -m pip install .
|
|
57
|
+
|
|
58
|
+
For developers, it is recommended to download the source code and install in editable mode by replacing ``python -m pip install .`` with ``python -m pip install -e .``.
|
|
59
|
+
|
|
60
|
+
Citation(s)
|
|
61
|
+
-----------
|
|
62
|
+
|
|
63
|
+
**If you used pyDMS, please cite:**
|
|
64
|
+
|
|
65
|
+
Tapia, B. C.; Dean, P. A.; Yeo, J. Y.; Wu, A. X., Smith, Z. P. pyDMS: A Python package for the determination of physics-informed, reproducible dual-mode sorption (DMS) parameters. *AIChE J.* Accepted **2026**.
|
|
66
|
+
|
|
67
|
+
**We also recommend citing the following works which provide relevant background and theory on van't Hoff sorption energetics, LFERs, and their application to constrained DMS optimization, respectively:**
|
|
68
|
+
|
|
69
|
+
Koros, W. J.; Paul, D. R.; Huvard, G. S. Energetics of Gas Sorption in Glassy Polymers. *Polymer* **1979**, *20* (8), 956--960. https://doi.org/10.1016/0032-3861(79)90192-7.
|
|
70
|
+
|
|
71
|
+
Freeman, B. D. Basis of Permeability/Selectivity Tradeoff Relations in Polymeric Gas Separation Membranes. *Macromolecules* **1999**, *32* (2), 375--380. https://doi.org/10.1021/ma9814548.
|
|
72
|
+
|
|
73
|
+
Wu, A. X.; Drayton, J. A.; Mizrahi Rodriguez, K.; Benedetti, F. M.; Qian, Q.; Lin, S.; Smith, Z. P. Elucidating the Role of Fluorine Content on Gas Sorption Properties of Fluorinated Polyimides. *Macromolecules* **2021**, *54* (1), 22--34. https://doi.org/10.1021/acs.macromol.0c01746.
|
|
74
|
+
|
|
75
|
+
License
|
|
76
|
+
-------
|
|
77
|
+
|
|
78
|
+
Copyright © 2026 The Massachusetts Institute of Technology
|
|
79
|
+
|
|
80
|
+
This work is licensed under the 3-clause BSD license (see ``LICENSE``).
|
|
81
|
+
|
|
82
|
+
Acknowledgements
|
|
83
|
+
----------------
|
|
84
|
+
|
|
85
|
+
This work was supported by a MathWorks Fellowship, NSF CAREER Award (no. 2146422), and the U.S. Department of Energy, Office of Science, Basic Energy Sciences, Separation Science Program under Award DE-SC0023252.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
r"""
|
|
2
|
+
pyDMS.dms
|
|
3
|
+
____ __ ________
|
|
4
|
+
____ __ __/ __ \/ |/ / ___/
|
|
5
|
+
/ __ \/ / / / / / / /|_/ /\__ \
|
|
6
|
+
/ /_/ / /_/ / /_/ / / / /___/ /
|
|
7
|
+
/ .___/\__, /_____/_/ /_//____/
|
|
8
|
+
/_/ /____/
|
|
9
|
+
|
|
10
|
+
Copyright 2026 Massachusetts Institute of Technology
|
|
11
|
+
|
|
12
|
+
Licensed under the BSD 3-Clause License
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
15
|
+
provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
18
|
+
and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
21
|
+
conditions and the following disclaimer in the documentation and/or other materials provided with
|
|
22
|
+
the distribution.
|
|
23
|
+
|
|
24
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to
|
|
25
|
+
endorse or promote products derived from this software without specific prior written permission.
|
|
26
|
+
|
|
27
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR
|
|
28
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
30
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
31
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
32
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
33
|
+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
34
|
+
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
import warnings
|
|
38
|
+
|
|
39
|
+
# TODO: streamline versioning
|
|
40
|
+
__version__ = "0.9.0"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def error_in_red(message):
|
|
44
|
+
"""
|
|
45
|
+
Red error message
|
|
46
|
+
"""
|
|
47
|
+
print("\033[91m" + message + "\033[0m")
|
|
48
|
+
warnings.warn(message, UserWarning)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def warning_in_orange(message):
|
|
52
|
+
"""
|
|
53
|
+
Orange warning message
|
|
54
|
+
"""
|
|
55
|
+
print("\033[38;2;255;165;0m" + message + "\033[0m")
|
|
56
|
+
warnings.warn(message, UserWarning)
|