pyEQL 0.15.1__py2.py3-none-any.whl → 1.0.1__py2.py3-none-any.whl
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.
- pyEQL/__init__.py +9 -1
- pyEQL/activity_correction.py +24 -21
- pyEQL/engines.py +56 -42
- pyEQL/equilibrium.py +18 -12
- pyEQL/functions.py +8 -161
- pyEQL/salt_ion_match.py +1 -0
- pyEQL/solute.py +3 -0
- pyEQL/solution.py +189 -763
- pyEQL/utils.py +3 -0
- {pyEQL-0.15.1.dist-info → pyEQL-1.0.1.dist-info}/METADATA +9 -10
- pyEQL-1.0.1.dist-info/RECORD +27 -0
- pyEQL/logging_system.py +0 -78
- pyEQL-0.15.1.dist-info/RECORD +0 -28
- {pyEQL-0.15.1.dist-info → pyEQL-1.0.1.dist-info}/AUTHORS.md +0 -0
- {pyEQL-0.15.1.dist-info → pyEQL-1.0.1.dist-info}/COPYING +0 -0
- {pyEQL-0.15.1.dist-info → pyEQL-1.0.1.dist-info}/LICENSE.txt +0 -0
- {pyEQL-0.15.1.dist-info → pyEQL-1.0.1.dist-info}/WHEEL +0 -0
- {pyEQL-0.15.1.dist-info → pyEQL-1.0.1.dist-info}/top_level.txt +0 -0
pyEQL/utils.py
CHANGED
|
@@ -6,6 +6,7 @@ pyEQL utilities
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
import logging
|
|
9
10
|
from collections import UserDict
|
|
10
11
|
from functools import lru_cache
|
|
11
12
|
|
|
@@ -14,6 +15,8 @@ from pymatgen.core.ion import Ion
|
|
|
14
15
|
|
|
15
16
|
from pyEQL import ureg
|
|
16
17
|
|
|
18
|
+
logger = logging.getLogger(__name__)
|
|
19
|
+
|
|
17
20
|
|
|
18
21
|
def interpret_units(unit: str) -> str:
|
|
19
22
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyEQL
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Python tools for solution chemistry
|
|
5
5
|
Home-page: https://github.com/KingsburyLab/pyEQL
|
|
6
6
|
Author: Ryan Kingsbury
|
|
@@ -19,12 +19,12 @@ License-File: LICENSE.txt
|
|
|
19
19
|
License-File: COPYING
|
|
20
20
|
License-File: AUTHORS.md
|
|
21
21
|
Requires-Dist: pint >=0.19
|
|
22
|
-
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: numpy <2
|
|
23
23
|
Requires-Dist: scipy
|
|
24
|
-
Requires-Dist: pymatgen
|
|
24
|
+
Requires-Dist: pymatgen ==2024.5.1
|
|
25
25
|
Requires-Dist: iapws
|
|
26
26
|
Requires-Dist: monty
|
|
27
|
-
Requires-Dist: maggma >=0.
|
|
27
|
+
Requires-Dist: maggma >=0.67.0
|
|
28
28
|
Requires-Dist: phreeqpython
|
|
29
29
|
Provides-Extra: docs
|
|
30
30
|
Requires-Dist: sphinx >=3.2.1 ; extra == 'docs'
|
|
@@ -37,6 +37,7 @@ Requires-Dist: setuptools ; extra == 'testing'
|
|
|
37
37
|
Requires-Dist: pre-commit ; extra == 'testing'
|
|
38
38
|
Requires-Dist: pytest ; extra == 'testing'
|
|
39
39
|
Requires-Dist: pytest-cov ; extra == 'testing'
|
|
40
|
+
Requires-Dist: pytest-xdist ; extra == 'testing'
|
|
40
41
|
Requires-Dist: black ; extra == 'testing'
|
|
41
42
|
Requires-Dist: mypy ; extra == 'testing'
|
|
42
43
|
Requires-Dist: ruff ; extra == 'testing'
|
|
@@ -50,11 +51,9 @@ Requires-Dist: tox <4 ; extra == 'testing'
|
|
|
50
51
|
[](https://badge.fury.io/py/pyEQL)
|
|
51
52
|
[](https://joss.theoj.org/papers/bdd9e247ea9736a0fdbbd5fe12bef7a6)
|
|
52
53
|
|
|
54
|
+
<img src="pyeql-logo.png" alt="pyEQL logo" style="width:600px;"/>
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
A python interface for water chemistry
|
|
57
|
-
|
|
56
|
+
# A python interface for water chemistry
|
|
58
57
|
|
|
59
58
|
## Description
|
|
60
59
|
|
|
@@ -122,8 +121,8 @@ Detailed documentation is available at [https://pyeql.readthedocs.io/](https://p
|
|
|
122
121
|
- [maggma](https://materialsproject.github.io/maggma/) - interface for accessing the property database
|
|
123
122
|
- [scipy](https://www.scipy.org/) - for certain nonlinear equation solvers
|
|
124
123
|
|
|
125
|
-
<!-- pyscaffold-notes -->
|
|
126
|
-
|
|
124
|
+
## <!-- pyscaffold-notes -->
|
|
125
|
+
|
|
127
126
|
pyEQL is licensed under LGPL.
|
|
128
127
|
|
|
129
128
|
This project has been set up using PyScaffold 4.5. For details and usage
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
pyEQL/__init__.py,sha256=JErflmaJVP373dm3-YGHUomFu05dgX0iXWS-Z5AgSTU,2118
|
|
2
|
+
pyEQL/activity_correction.py,sha256=eOixjgTd5hTrTRD5s6aPCCG12lAIH7-lRN0Z1qHu678,37151
|
|
3
|
+
pyEQL/engines.py,sha256=ma4KhCmW2XR4FNebQBa2vTkKygRH8l40rnsSTmqTECQ,34915
|
|
4
|
+
pyEQL/equilibrium.py,sha256=YCtoAJSgn1WC9NJnc3H4FTJdKQvogsvCuj7HqlKMtww,8307
|
|
5
|
+
pyEQL/functions.py,sha256=nc-Hc61MmW-ELBR1PByJvQnELxM7PZexMHbU_O5-Bnw,10584
|
|
6
|
+
pyEQL/pint_custom_units.txt,sha256=XHmcMlwVvqF9nEW7_e9Xgyq-xWEr-cDYqieas11T3eY,2882
|
|
7
|
+
pyEQL/salt_ion_match.py,sha256=D4HJdV7iVsBEW5bW9tWpvc6pK-jrexTlvJV80YabHo4,4062
|
|
8
|
+
pyEQL/solute.py,sha256=R4XjPiAZP2787ImIo072CWD1vjIYjGPt6zvxCrVO1pA,5133
|
|
9
|
+
pyEQL/solution.py,sha256=PogXcBn3vPaK5EZy742-tW6om_kmrkitF7U7NeMj37g,115889
|
|
10
|
+
pyEQL/utils.py,sha256=2VLl_sqcKcqBrVdP0ogtIYsOlc-wl4repi43Jqr-8yg,4156
|
|
11
|
+
pyEQL/database/geothermal.dat,sha256=kksnfcBtWdOTpNn4CLXU1Mz16cwas2WuVKpuMU8CaVI,234230
|
|
12
|
+
pyEQL/database/llnl.dat,sha256=jN-a0kfUFbQlYMn2shTVRg1JX_ZhLa-tJ0lLw2YSpLU,751462
|
|
13
|
+
pyEQL/database/phreeqc_license.txt,sha256=8W1r8VxC2kVptIMSU9sDFNASYqN7MdwKEtIWWfjTQuM,2906
|
|
14
|
+
pyEQL/database/pyeql_db.json,sha256=TQKKofds7QBNd-Hw5QQuPwP6rQ8YWh_hHlRAtoQX0m8,1080793
|
|
15
|
+
pyEQL/presets/Ringers lactate.yaml,sha256=vtSnuvgALHR27XEjpDzC0xyw5-E6b2FSsF1EUEBiWpw,413
|
|
16
|
+
pyEQL/presets/normal saline.yaml,sha256=i2znhnIeXfNx1iMFFSif7crMRCFRP6xN1m7Wp7USduM,318
|
|
17
|
+
pyEQL/presets/rainwater.yaml,sha256=S0WHZNDfCJyjSSFxNFdkypjn2s3P0jJGCiYIxvi1ibA,337
|
|
18
|
+
pyEQL/presets/seawater.yaml,sha256=oryc1CkhRz20RpWE6uiGiT93HoZnqlB0s-0PmBWr3-U,843
|
|
19
|
+
pyEQL/presets/urine.yaml,sha256=0Njtc-H1fFRo7UhquHdiSTT4z-8VZJ1utDCk02qk28M,679
|
|
20
|
+
pyEQL/presets/wastewater.yaml,sha256=jTTFBpmKxczaEtkCZb0xUULIPZt7wfC8eAJ6rthGnmw,502
|
|
21
|
+
pyEQL-1.0.1.dist-info/AUTHORS.md,sha256=K9ZLhKFwZ2zLlFXwN62VuUYCpr5T6n4mOUCUHlytTUs,415
|
|
22
|
+
pyEQL-1.0.1.dist-info/COPYING,sha256=Ww2oUywfFTn242v9ksCgQdIVSpcMXJiKKePn0GFm25E,7649
|
|
23
|
+
pyEQL-1.0.1.dist-info/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
|
|
24
|
+
pyEQL-1.0.1.dist-info/METADATA,sha256=Nt-13evnZEXe5D0L8a-QrtIjwvYKo8cb2ew3UG2JwlQ,5889
|
|
25
|
+
pyEQL-1.0.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
26
|
+
pyEQL-1.0.1.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
|
|
27
|
+
pyEQL-1.0.1.dist-info/RECORD,,
|
pyEQL/logging_system.py
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# logging system
|
|
2
|
-
"""Create a logging system using Python's built-in module.
|
|
3
|
-
|
|
4
|
-
Each module within pyEQL has its own logger, with a StreamHandler attached to it that
|
|
5
|
-
directs formatted messages to standard output. This is intended to facilitate the use
|
|
6
|
-
of pyEQL as an interactive console program, at the expense of some flexibility when
|
|
7
|
-
using it as a true library in another application.
|
|
8
|
-
|
|
9
|
-
The default logging levels are mapped to pyEQL events as follows:
|
|
10
|
-
|
|
11
|
-
DEBUG - detailed messages about function execution including methods used, data sources,
|
|
12
|
-
temperature adjustments, etc.
|
|
13
|
-
INFO - Messages indicating calculation steps, function calls, etc.
|
|
14
|
-
WARNING - assumptions or limitations of module output
|
|
15
|
-
ERROR - Module could not complete a task due to invalid input or other problem
|
|
16
|
-
CRITICAL - not used
|
|
17
|
-
|
|
18
|
-
:copyright: 2013-2024 by Ryan S. Kingsbury
|
|
19
|
-
:license: LGPL, see LICENSE for more details.
|
|
20
|
-
|
|
21
|
-
"""
|
|
22
|
-
import logging
|
|
23
|
-
|
|
24
|
-
# courtesy https://calmcode.io/logging/format.html
|
|
25
|
-
|
|
26
|
-
logger = logging.getLogger(__name__)
|
|
27
|
-
|
|
28
|
-
# the handler determines where the logs go: stdout/file
|
|
29
|
-
handler = logging.StreamHandler()
|
|
30
|
-
|
|
31
|
-
# the formatter determines what our logs will look like
|
|
32
|
-
fmt = "%(levelname)s %(asctime)s %(filename)s %(funcName)s %(lineno)d %(message)s"
|
|
33
|
-
formatter = logging.Formatter(fmt)
|
|
34
|
-
handler.setFormatter(formatter)
|
|
35
|
-
|
|
36
|
-
logger.addHandler(handler)
|
|
37
|
-
# use rich for pretty log formatting, if installed
|
|
38
|
-
try:
|
|
39
|
-
from rich.logging import RichHandler
|
|
40
|
-
|
|
41
|
-
logger.addHandler(RichHandler(rich_tracebacks=True))
|
|
42
|
-
except ImportError:
|
|
43
|
-
pass
|
|
44
|
-
|
|
45
|
-
logger.setLevel(logging.WARNING)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
# define a log filter to emit only unique log messages
|
|
49
|
-
class Unique(logging.Filter):
|
|
50
|
-
"""Messages are allowed through just once.
|
|
51
|
-
The 'message' includes substitutions, but is not formatted by the
|
|
52
|
-
handler. If it were, then practically all messages would be unique!
|
|
53
|
-
"""
|
|
54
|
-
|
|
55
|
-
def __init__(self, name=""):
|
|
56
|
-
logging.Filter.__init__(self, name)
|
|
57
|
-
self.reset()
|
|
58
|
-
|
|
59
|
-
def reset(self):
|
|
60
|
-
"""Act as if nothing has happened."""
|
|
61
|
-
self.__logged = {}
|
|
62
|
-
|
|
63
|
-
def filter(self, rec):
|
|
64
|
-
"""logging.Filter.filter performs an extra filter on the name."""
|
|
65
|
-
return logging.Filter.filter(self, rec) and self.__is_first_time(rec)
|
|
66
|
-
|
|
67
|
-
def __is_first_time(self, rec):
|
|
68
|
-
"""Emit a message only once."""
|
|
69
|
-
msg = rec.msg % (rec.args)
|
|
70
|
-
if msg in self.__logged:
|
|
71
|
-
self.__logged[msg] += 1
|
|
72
|
-
return False
|
|
73
|
-
self.__logged[msg] = 1
|
|
74
|
-
return True
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
# add the filter to suppress duplicate messages
|
|
78
|
-
logger.addFilter(Unique())
|
pyEQL-0.15.1.dist-info/RECORD
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
pyEQL/__init__.py,sha256=bW3CxQ7Wi4uNIgPtsimLXvLln2N3WMGSvZxpTE-ireY,1963
|
|
2
|
-
pyEQL/activity_correction.py,sha256=5zG6TofIx5xV0q_To3o6XZ1VLHvp5Q5vIxonqKu-7jg,37003
|
|
3
|
-
pyEQL/engines.py,sha256=jn7tJKr_p2sEVcuz1F_QLwUqEHQkkhAqlbO59sMGjKo,33659
|
|
4
|
-
pyEQL/equilibrium.py,sha256=Zwn-NstMXE-6X4zulcZ2z0Vk3GX8yoNKVN0hnRXud_Q,8281
|
|
5
|
-
pyEQL/functions.py,sha256=nuyR6hrLQZfSkzOqDm6W6lgMxQpbKT6IRuAj-rPXsjk,16116
|
|
6
|
-
pyEQL/logging_system.py,sha256=_41vA7tZOShWuAZK9SrEM_nsfQF4VyS_xEc0yIWNsDI,2579
|
|
7
|
-
pyEQL/pint_custom_units.txt,sha256=XHmcMlwVvqF9nEW7_e9Xgyq-xWEr-cDYqieas11T3eY,2882
|
|
8
|
-
pyEQL/salt_ion_match.py,sha256=sk5FsyEe6MgCrX0LvGIEKl7NO2kF--SHG39AVIxgzDY,4061
|
|
9
|
-
pyEQL/solute.py,sha256=5kd0IRXA0sbwBAJNdJGuFGr2FmRs-QW4VFEa2fUKuIk,5080
|
|
10
|
-
pyEQL/solution.py,sha256=Nh98LkfoFgrlLjEj4i6KXtb9G7kR6XOpYKdBiP-AFLU,132997
|
|
11
|
-
pyEQL/utils.py,sha256=FKx3xHLAzA-rtSV0L2--fd9h_JubgeyKuXYGtwlh7Tg,4103
|
|
12
|
-
pyEQL/database/geothermal.dat,sha256=kksnfcBtWdOTpNn4CLXU1Mz16cwas2WuVKpuMU8CaVI,234230
|
|
13
|
-
pyEQL/database/llnl.dat,sha256=jN-a0kfUFbQlYMn2shTVRg1JX_ZhLa-tJ0lLw2YSpLU,751462
|
|
14
|
-
pyEQL/database/phreeqc_license.txt,sha256=8W1r8VxC2kVptIMSU9sDFNASYqN7MdwKEtIWWfjTQuM,2906
|
|
15
|
-
pyEQL/database/pyeql_db.json,sha256=TQKKofds7QBNd-Hw5QQuPwP6rQ8YWh_hHlRAtoQX0m8,1080793
|
|
16
|
-
pyEQL/presets/Ringers lactate.yaml,sha256=vtSnuvgALHR27XEjpDzC0xyw5-E6b2FSsF1EUEBiWpw,413
|
|
17
|
-
pyEQL/presets/normal saline.yaml,sha256=i2znhnIeXfNx1iMFFSif7crMRCFRP6xN1m7Wp7USduM,318
|
|
18
|
-
pyEQL/presets/rainwater.yaml,sha256=S0WHZNDfCJyjSSFxNFdkypjn2s3P0jJGCiYIxvi1ibA,337
|
|
19
|
-
pyEQL/presets/seawater.yaml,sha256=oryc1CkhRz20RpWE6uiGiT93HoZnqlB0s-0PmBWr3-U,843
|
|
20
|
-
pyEQL/presets/urine.yaml,sha256=0Njtc-H1fFRo7UhquHdiSTT4z-8VZJ1utDCk02qk28M,679
|
|
21
|
-
pyEQL/presets/wastewater.yaml,sha256=jTTFBpmKxczaEtkCZb0xUULIPZt7wfC8eAJ6rthGnmw,502
|
|
22
|
-
pyEQL-0.15.1.dist-info/AUTHORS.md,sha256=K9ZLhKFwZ2zLlFXwN62VuUYCpr5T6n4mOUCUHlytTUs,415
|
|
23
|
-
pyEQL-0.15.1.dist-info/COPYING,sha256=Ww2oUywfFTn242v9ksCgQdIVSpcMXJiKKePn0GFm25E,7649
|
|
24
|
-
pyEQL-0.15.1.dist-info/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
|
|
25
|
-
pyEQL-0.15.1.dist-info/METADATA,sha256=kgk693lXwqjzaaoKh4DcfhLrB5w14H4n1yPPsvwuhP4,5804
|
|
26
|
-
pyEQL-0.15.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
27
|
-
pyEQL-0.15.1.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
|
|
28
|
-
pyEQL-0.15.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|