Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speciation support via phreeqpython #39

Merged
merged 41 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
02cc627
Solution: add get_el_amt_dict
rkingsbury Aug 23, 2023
6e38d87
Solution: add elements and chemsys props
rkingsbury Aug 23, 2023
8506c2e
utils: fix formulae of dissolved diatomic gases
rkingsbury Aug 23, 2023
d4bdd2d
Solute: include factor in from_formula
rkingsbury Aug 28, 2023
983c7cb
changes following update to pmg.Ion
rkingsbury Aug 30, 2023
f2bdd96
Merge branch 'main' into speciation
rkingsbury Sep 1, 2023
63144bd
support speciation via phreeqpython
rkingsbury Sep 1, 2023
70705fc
add llnl.dat and geothermal.dat
rkingsbury Sep 1, 2023
b8447e9
add PHREEQC database license; fix setup.cfg
rkingsbury Sep 1, 2023
74ddd17
Merge branch 'main' into speciation
rkingsbury Sep 10, 2023
7aa11df
updates to engines, charge_balance, and tests
rkingsbury Sep 11, 2023
8b8e5e4
Merge branch 'main' of https://github.com/rkingsbury/pyEQL into speci…
rkingsbury Sep 11, 2023
6f07efd
WIP work on speciation robustness
rkingsbury Sep 14, 2023
52b47c4
Solute: fix missing diatomic oxi state
rkingsbury Sep 14, 2023
8528e35
sort database by formula
rkingsbury Sep 18, 2023
4e0844e
Solution: add get_components_by_element
rkingsbury Sep 19, 2023
0f4885e
Merge branch 'sortdb' into speciation
rkingsbury Sep 19, 2023
d693f4a
Merge branch 'sortdb' into HEAD
rkingsbury Sep 19, 2023
3f28751
Merge branch 'temp2' into speciation
rkingsbury Sep 19, 2023
73c6f90
database merge fixes
rkingsbury Sep 19, 2023
73dfe94
Merge branch 'main' into speciation
rkingsbury Sep 19, 2023
75317f1
Solution: improve get_total_amount; add tests
rkingsbury Sep 19, 2023
1a7fa0e
Solution: add anions, cations, neutrals properties
rkingsbury Sep 19, 2023
25b47c3
Solution: sort anions, cations, neutrals by amount
rkingsbury Sep 19, 2023
b81659d
utils: disable hydrate format in standardize_formula
rkingsbury Sep 22, 2023
dd96e62
Solute: ensure oxi states are always floats
rkingsbury Sep 22, 2023
334be6d
Solution: docstring edits for cations, anions, neutrals
rkingsbury Sep 22, 2023
7f69f7b
Solution: fix get_amount molar_volume
rkingsbury Sep 22, 2023
0c549f0
Solution: automatic charge balancing
rkingsbury Sep 22, 2023
0085d00
Solution: ensure transport.diffusion_coefficient return
rkingsbury Sep 22, 2023
2699f90
add'l tests of get_total_amount
rkingsbury Sep 22, 2023
8ee6fba
Solution: auto charge balance + speciation fixes
rkingsbury Sep 22, 2023
4977a47
update CHANGELOG
rkingsbury Sep 22, 2023
73be445
rm pH check from equilibrate
rkingsbury Sep 22, 2023
79a1bbc
update Solute tests for oxi state changes
rkingsbury Sep 22, 2023
34aaf9b
testing: test_activity -> pytest
rkingsbury Sep 27, 2023
420d53c
testing: add speciation + activity test
rkingsbury Sep 27, 2023
85972ef
Solution: get_components_by_element set->list
rkingsbury Sep 27, 2023
8cf3079
amend previous
rkingsbury Sep 27, 2023
c55b35d
Solution: use total el conc in salt matching
rkingsbury Sep 27, 2023
a8dfe00
comments; rm stray print; adjust test
rkingsbury Sep 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `Solution`: use total element concentrations when performing salt matching (can be disabled via kwarg)
- `Solution`: add speciation support to the native engine via `phreeqpython`
- `Solution`: add keyword argument to enable automatic charge balancing
- `Salt`: class is now MSONable (i.e., serializable via `as_dict` / `from_dict`)
- `Solution`: new properties `anions`, `cations`, `neutrals` provide easy access to subsets `components`.
- `Solution`: improvements to `get_total_amount`.
- `Solution`: new function `get_components_by_element` that lists all species associated with elements in specific
oxidation states.
- `Solution`: new properties `elements` and `chemical_system`, new function `get_el_amt_dict` to compute the total
number of moles of each element present in the Solution.

### Changed

- Update `test_salt_ion_match` to `pytest` format and add additional tests
- Update `test_bulk_properties` to `pytest` format

### Removed

- `Solution.list_salts()` has been removed. See `Solution.get_salt_dict()` for equivalent functionality
- `salt_ion_match.generate_salt_list` and `identify_salt` have been removed. See `Solution.get_salt_dict()` and `Solution.get_salt()` for equivalent functionality.

### Fixed

- Scaling of salt concentrations in `get_salt_dict` was incorrect in some edge cases
- Disable hydrate notation in `standardize_formula`, which caused hydroxides such as 'Ca(OH)3' to be written 'CaO2H.H2O'
- Inconsistent formatting of oxidation states in `get_total_amount` and `Solute`
- Inconsistent return type from `get_property` when `molar_volume` and `diffusion_coefficient` were missing
- Two issues with the formatting of the `H2O(aq)` entry in the database, `pyeql_db.json`

## [0.7.0] - 2023-08-22
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ version_scheme = "no-guess-dev"
line-length = 120

[tool.ruff]
target-version = "py37"
target-version = "py38"
line-length = 120
exclude = [".dat"]
src = ["src"]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
Expand Down Expand Up @@ -65,7 +67,6 @@ ignore = [
]
pydocstyle.convention = "google"
isort.split-on-trailing-comma = false
src = ["src"]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
Expand All @@ -85,5 +86,4 @@ no_implicit_optional = false

[tool.codespell]
ignore-words-list = "nd"
skip = 'tests/test_files/*'
exclude = 'src/pyEQL/database/pyeql_db.json'
skip = "tests/test_files/*,src/pyEQL/database/*"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ python_requires = >=3.8
# new major versions. This works if the required packages follow Semantic Versioning.
# For more information, check out https://semver.org/.
install_requires =
importlib-metadata; python_version<"3.8"
pint>=0.19
numpy
scipy
Expand All @@ -58,6 +57,7 @@ install_requires =
iapws
monty
maggma
phreeqpython

[options.packages.find]
where = src
Expand Down
Loading