pyEQL 0.12.2__py2.py3-none-any.whl → 0.14.0__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/utils.py CHANGED
@@ -1,7 +1,7 @@
1
1
  """
2
2
  pyEQL utilities
3
3
 
4
- :copyright: 2023 by Ryan S. Kingsbury
4
+ :copyright: 2013-2024 by Ryan S. Kingsbury
5
5
  :license: LGPL, see LICENSE for more details.
6
6
 
7
7
  """
@@ -30,9 +30,10 @@ def standardize_formula(formula: str):
30
30
  ValueError if `formula` cannot be processed or is invalid.
31
31
 
32
32
  Notes:
33
- Currently this method standardizes formulae by passing them through pymatgen.core.ion.Ion.reduced_formula(). For ions, this means that 1) the
34
- charge number will always be listed explicitly and 2) the charge number will be enclosed in square brackets to remove any ambiguity in the meaning of the formula. For example, 'Na+', 'Na+1', and 'Na[+]' will all
35
- standardize to "Na[+1]"
33
+ Currently this method standardizes formulae by passing them through `pymatgen.core.ion.Ion.reduced_formula()`.
34
+ For ions, this means that 1) the charge number will always be listed explicitly and 2) the charge number will
35
+ be enclosed in square brackets to remove any ambiguity in the meaning of the formula. For example, 'Na+',
36
+ 'Na+1', and 'Na[+]' will all standardize to "Na[+1]"
36
37
  """
37
38
  return Ion.from_formula(formula).reduced_formula
38
39
 
@@ -63,7 +64,7 @@ def format_solutes_dict(solute_dict: dict, units: str):
63
64
  @ureg.wraps(ret=None, args=["K", "MPa"], strict=False)
64
65
  def create_water_substance(temperature: float, pressure: float):
65
66
  """
66
- Instantiate a water substance model from IAPWS
67
+ Instantiate a water substance model from IAPWS.
67
68
 
68
69
  Args:
69
70
  temperature: the desired temperature in K
@@ -98,5 +99,10 @@ class FormulaDict(UserDict):
98
99
  # sort contents anytime an item is set
99
100
  self.data = dict(sorted(self.items(), key=lambda x: x[1], reverse=True))
100
101
 
102
+ # Necessary to define this so that .get() works properly in python 3.12+
103
+ # see https://github.com/python/cpython/issues/105524
104
+ def __contains__(self, key):
105
+ return standardize_formula(key) in self.data
106
+
101
107
  def __delitem__(self, key):
102
108
  super().__delitem__(standardize_formula(key))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyEQL
3
- Version: 0.12.2
3
+ Version: 0.14.0
4
4
  Summary: Python tools for solution chemistry
5
5
  Home-page: https://github.com/KingsburyLab/pyEQL
6
6
  Author: Ryan Kingsbury
@@ -0,0 +1,28 @@
1
+ pyEQL/__init__.py,sha256=bW3CxQ7Wi4uNIgPtsimLXvLln2N3WMGSvZxpTE-ireY,1963
2
+ pyEQL/activity_correction.py,sha256=5zG6TofIx5xV0q_To3o6XZ1VLHvp5Q5vIxonqKu-7jg,37003
3
+ pyEQL/engines.py,sha256=7sQ5DJ2f8OoF0aXn8q6Cs10xEzGRuv6K8W8c8-4mVic,33033
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=LCt8xS35g4qQEWNRw3FMU9cIXce1mgkCnYMRMcAI5ZI,4992
10
+ pyEQL/solution.py,sha256=gAVemd1-U6EW7gx8guiavZTJp0vlandkDUn0V0GL-4o,132821
11
+ pyEQL/utils.py,sha256=RpU9W8f64PaqkCF_HhtvO9XUmXobfTh4ciyb5oShIy8,3571
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.14.0.dist-info/AUTHORS.md,sha256=K9ZLhKFwZ2zLlFXwN62VuUYCpr5T6n4mOUCUHlytTUs,415
23
+ pyEQL-0.14.0.dist-info/COPYING,sha256=Ww2oUywfFTn242v9ksCgQdIVSpcMXJiKKePn0GFm25E,7649
24
+ pyEQL-0.14.0.dist-info/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
25
+ pyEQL-0.14.0.dist-info/METADATA,sha256=CgQKmSyAmIArLPD71d8cgH7-LeqHH4hN4crY5cK0LhU,5653
26
+ pyEQL-0.14.0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
27
+ pyEQL-0.14.0.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
28
+ pyEQL-0.14.0.dist-info/RECORD,,
@@ -1,28 +0,0 @@
1
- pyEQL/__init__.py,sha256=ed5aZRIiFdRgTZ6AuavXPe-6kldn0hC70ELRskxSazM,1963
2
- pyEQL/activity_correction.py,sha256=Vn8haVkdJ-l6d58El0QSW5vzu65shEFFhtoATIIuS-k,38075
3
- pyEQL/engines.py,sha256=6xwgxjJOZEZpZOJxDmH-y6HW9gOPZLEsZsBvZdO8Xpc,32478
4
- pyEQL/equilibrium.py,sha256=fHVugR4RzQAlHXA3Njq016hd5iIinH-v914jxJVHIUY,9017
5
- pyEQL/functions.py,sha256=fpd_3tt2AKiMazcNpnLY4SEPzIq5XKYwlrkLFlxEpVU,16089
6
- pyEQL/logging_system.py,sha256=pwNmMTXc5E5ycMhls4Lw2rVGAmN6ClDg7O3HEZRwor4,2579
7
- pyEQL/pint_custom_units.txt,sha256=XHmcMlwVvqF9nEW7_e9Xgyq-xWEr-cDYqieas11T3eY,2882
8
- pyEQL/salt_ion_match.py,sha256=iSXLOHCXurfShyXzmNzLpt-khJK1cmogxVtDb-6jDGw,4156
9
- pyEQL/solute.py,sha256=rY3lrVbW7XhLtQHgcNQC__Y-Yg1tZVuERmYvcQW1IlY,4754
10
- pyEQL/solution.py,sha256=HoJiuc2E-FuxUYqN4Awe4a5g2HQVNLMy3_CFT5SWPds,132953
11
- pyEQL/utils.py,sha256=_uiQQlslX-k4SG7AdDb4qkFEMc-xNq1qCM2l1C1LVTw,3333
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.12.2.dist-info/AUTHORS.md,sha256=K9ZLhKFwZ2zLlFXwN62VuUYCpr5T6n4mOUCUHlytTUs,415
23
- pyEQL-0.12.2.dist-info/COPYING,sha256=Ww2oUywfFTn242v9ksCgQdIVSpcMXJiKKePn0GFm25E,7649
24
- pyEQL-0.12.2.dist-info/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
25
- pyEQL-0.12.2.dist-info/METADATA,sha256=SXpt8uYxQnTXU62QguzD-KUdea5yKWrHAYUgblSLpT8,5653
26
- pyEQL-0.12.2.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
27
- pyEQL-0.12.2.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
28
- pyEQL-0.12.2.dist-info/RECORD,,
File without changes