pyEQL 0.5.2__py3-none-any.whl → 1.1.0__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 +50 -43
- pyEQL/activity_correction.py +481 -707
- pyEQL/database/geothermal.dat +5693 -0
- pyEQL/database/llnl.dat +19305 -0
- pyEQL/database/phreeqc_license.txt +54 -0
- pyEQL/database/pyeql_db.json +35902 -0
- pyEQL/engines.py +793 -0
- pyEQL/equilibrium.py +148 -228
- pyEQL/functions.py +121 -416
- pyEQL/pint_custom_units.txt +2 -2
- pyEQL/presets/Ringers lactate.yaml +20 -0
- pyEQL/presets/normal saline.yaml +17 -0
- pyEQL/presets/rainwater.yaml +17 -0
- pyEQL/presets/seawater.yaml +29 -0
- pyEQL/presets/urine.yaml +26 -0
- pyEQL/presets/wastewater.yaml +21 -0
- pyEQL/salt_ion_match.py +53 -284
- pyEQL/solute.py +126 -191
- pyEQL/solution.py +2163 -2090
- pyEQL/utils.py +165 -0
- pyEQL-1.1.0.dist-info/AUTHORS.md +13 -0
- {pyEQL-0.5.2.dist-info → pyEQL-1.1.0.dist-info}/COPYING +1 -1
- pyEQL-0.5.2.dist-info/LICENSE → pyEQL-1.1.0.dist-info/LICENSE.txt +3 -7
- pyEQL-1.1.0.dist-info/METADATA +129 -0
- pyEQL-1.1.0.dist-info/RECORD +27 -0
- {pyEQL-0.5.2.dist-info → pyEQL-1.1.0.dist-info}/WHEEL +2 -1
- pyEQL/chemical_formula.py +0 -1006
- pyEQL/database/Erying_viscosity.tsv +0 -18
- pyEQL/database/Jones_Dole_B.tsv +0 -32
- pyEQL/database/Jones_Dole_B_inorganic_Jenkins.tsv +0 -75
- pyEQL/database/LICENSE +0 -4
- pyEQL/database/dielectric_parameter.tsv +0 -30
- pyEQL/database/diffusion_coefficient.tsv +0 -116
- pyEQL/database/hydrated_radius.tsv +0 -35
- pyEQL/database/ionic_radius.tsv +0 -35
- pyEQL/database/partial_molar_volume.tsv +0 -22
- pyEQL/database/pitzer_activity.tsv +0 -169
- pyEQL/database/pitzer_volume.tsv +0 -132
- pyEQL/database/template.tsv +0 -14
- pyEQL/database.py +0 -300
- pyEQL/elements.py +0 -4552
- pyEQL/logging_system.py +0 -53
- pyEQL/parameter.py +0 -435
- pyEQL/tests/__init__.py +0 -32
- pyEQL/tests/test_activity.py +0 -578
- pyEQL/tests/test_bulk_properties.py +0 -86
- pyEQL/tests/test_chemical_formula.py +0 -279
- pyEQL/tests/test_debye_length.py +0 -79
- pyEQL/tests/test_density.py +0 -106
- pyEQL/tests/test_dielectric.py +0 -153
- pyEQL/tests/test_effective_pitzer.py +0 -276
- pyEQL/tests/test_mixed_electrolyte_activity.py +0 -154
- pyEQL/tests/test_osmotic_coeff.py +0 -99
- pyEQL/tests/test_pyeql_volume_concentration.py +0 -428
- pyEQL/tests/test_salt_matching.py +0 -337
- pyEQL/tests/test_solute_properties.py +0 -251
- pyEQL/water_properties.py +0 -352
- pyEQL-0.5.2.dist-info/AUTHORS +0 -7
- pyEQL-0.5.2.dist-info/METADATA +0 -72
- pyEQL-0.5.2.dist-info/RECORD +0 -47
- pyEQL-0.5.2.dist-info/entry_points.txt +0 -3
- {pyEQL-0.5.2.dist-info → pyEQL-1.1.0.dist-info}/top_level.txt +0 -0
pyEQL/__init__.py
CHANGED
|
@@ -1,49 +1,56 @@
|
|
|
1
1
|
"""
|
|
2
|
-
pyEQL
|
|
3
|
-
=====
|
|
4
|
-
|
|
5
2
|
pyEQL is a python package for calculating the properties of aqueous solutions
|
|
6
3
|
and performing chemical thermodynamics computations.
|
|
7
4
|
|
|
8
|
-
:copyright: 2013-
|
|
5
|
+
:copyright: 2013-2024 by Ryan S. Kingsbury
|
|
9
6
|
:license: LGPL, see LICENSE for more details.
|
|
10
|
-
|
|
11
7
|
"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
#
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
#
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
from importlib.metadata import PackageNotFoundError, version # pragma: no cover
|
|
11
|
+
from importlib.resources import files
|
|
12
|
+
|
|
13
|
+
from maggma.stores import JSONStore
|
|
14
|
+
from pint import UnitRegistry
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
# Change here if project is renamed and does not equal the package name
|
|
18
|
+
dist_name = __name__
|
|
19
|
+
__version__ = version(dist_name)
|
|
20
|
+
except PackageNotFoundError: # pragma: no cover
|
|
21
|
+
__version__ = "unknown"
|
|
22
|
+
finally:
|
|
23
|
+
del version, PackageNotFoundError
|
|
24
|
+
|
|
25
|
+
# logging
|
|
26
|
+
logger = logging.getLogger("pyEQL")
|
|
27
|
+
logger.setLevel(logging.WARNING)
|
|
28
|
+
logger.addHandler(logging.NullHandler())
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Units handling
|
|
32
|
+
# per the pint documentation, it's important that pint and its associated Unit
|
|
33
|
+
# Registry are only instantiated once.
|
|
34
|
+
# here we assign the identifier 'unit' to the UnitRegistry
|
|
35
|
+
# the cache_folder arg is added to speed up registry instantiation
|
|
36
|
+
ureg = UnitRegistry(cache_folder=":auto:")
|
|
37
|
+
# convert "offset units" so that, e.g. Quantity('25 degC') works without error
|
|
38
|
+
# see https://pint.readthedocs.io/en/0.22/user/nonmult.html?highlight=offset#temperature-conversion
|
|
39
|
+
ureg.autoconvert_offset_to_baseunit = True
|
|
40
|
+
# append custom unit definitions and contexts
|
|
41
|
+
fname = files("pyEQL") / "pint_custom_units.txt"
|
|
42
|
+
ureg.load_definitions(fname)
|
|
43
|
+
# activate the "chemistry" context globally
|
|
44
|
+
ureg.enable_contexts("chem")
|
|
45
|
+
# set the default string formatting for pint quantities
|
|
46
|
+
ureg.default_format = "P~"
|
|
47
|
+
|
|
48
|
+
# create a Store for the default database
|
|
49
|
+
json_db_file = files("pyEQL") / "database" / "pyeql_db.json"
|
|
50
|
+
IonDB = JSONStore(str(json_db_file), key="formula", encoding="utf8")
|
|
51
|
+
# By calling connect on init, we get the expensive JSON reading operation out
|
|
52
|
+
# of the way. Subsequent calls to connect will bypass this and access the already-
|
|
53
|
+
# instantiated Store in memory, which should speed up instantiation of Solution objects.
|
|
54
|
+
IonDB.connect()
|
|
55
|
+
|
|
56
|
+
from pyEQL.solution import Solution # noqa: E402
|