From 634182b94003701d1bc88832293bd3be740e8663 Mon Sep 17 00:00:00 2001 From: Ryan Kingsbury Date: Wed, 15 May 2024 13:50:52 -0400 Subject: [PATCH 1/2] Set character encoding explicitly in JSONStore --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++++ setup.cfg | 2 +- src/pyEQL/__init__.py | 3 ++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778df835..9a408e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- `UnicodeDecodeError` when trying to connect to ion database on non-English platforms ([#122](https://github.com/KingsburyLab/pyEQL/issues/122)) + +### Changed + +- Docs: Fix missing close parentheses in docstring (@Andrew S. Rosen) + +## [1.0.0] - 2024-03-17 + +### Added + +- `Solution.__init__`: new keyword argument `log_level` allows user to control the verbosity of log messages by setting + the level (e.g., ERROR, WARNING, etc.) that will be shown in stdout. +- Docs: added a note about a workaround for Apple M1/M2 Macs proposed by @xiaoxiaozhu123 + +### Changed + +- `Solution.__init__`: The deprecated format for specifying solutes (e.g., `[["Na+", "0.5 mol/L]]`) + which previously only generated log warning message, now raises a `DeprecationWarning`. Use dict-style input (e.g., + `{"Na+":"0.5 mol/L"}`) instead. +- New logo! Updated the `pyEQL` logo (for the first time in 9 years!) to address an obsolete font in the .svg + and modernize the design. + +### Removed + +- **BREAKING** All methods and functions (with the exception of `Solution.list_XXX` methods) previously marked with + deprecation warnings have been removed. + +## [0.15.1] - 2024-03-13 + +### Fixed + +- `Solution.get_total_amount`: Fixed an issue in which `ppm` units would fail. + +## [0.15.0] - 2024-03-13 + ### Added - `utils.interpret_units`: New method to "sanitize" environmental engineering units like ppm to strings that `pint` diff --git a/setup.cfg b/setup.cfg index e0b36c7e..078c1a1a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,7 +55,7 @@ install_requires = pymatgen>=2023.10.11 iapws monty - maggma>=0.57.5 + maggma>=0.67.0 phreeqpython [options.packages.find] diff --git a/src/pyEQL/__init__.py b/src/pyEQL/__init__.py index 544762fc..29bc21dd 100644 --- a/src/pyEQL/__init__.py +++ b/src/pyEQL/__init__.py @@ -5,6 +5,7 @@ :copyright: 2013-2024 by Ryan S. Kingsbury :license: LGPL, see LICENSE for more details. """ + from importlib.metadata import PackageNotFoundError, version # pragma: no cover from importlib.resources import files @@ -39,7 +40,7 @@ # create a Store for the default database json_db_file = files("pyEQL") / "database" / "pyeql_db.json" -IonDB = JSONStore(str(json_db_file), key="formula") +IonDB = JSONStore(str(json_db_file), key="formula", encoding="utf8") # By calling connect on init, we get the expensive JSON reading operation out # of the way. Subsequent calls to connect will bypass this and access the already- # instantiated Store in memory, which should speed up instantiation of Solution objects. From 3ae9a6e0ee3b5e4c93cae374a7a328536b51ac27 Mon Sep 17 00:00:00 2001 From: Ryan Kingsbury Date: Wed, 15 May 2024 13:55:14 -0400 Subject: [PATCH 2/2] fix CHANGELOG --- CHANGELOG.md | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83420537..57a34865 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,34 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.0] - 2024-03-17 - -### Added - -- `Solution.__init__`: new keyword argument `log_level` allows user to control the verbosity of log messages by setting - the level (e.g., ERROR, WARNING, etc.) that will be shown in stdout. -- Docs: added a note about a workaround for Apple M1/M2 Macs proposed by @xiaoxiaozhu123 - -### Changed - -- `Solution.__init__`: The deprecated format for specifying solutes (e.g., `[["Na+", "0.5 mol/L]]`) - which previously only generated log warning message, now raises a `DeprecationWarning`. Use dict-style input (e.g., - `{"Na+":"0.5 mol/L"}`) instead. -- New logo! Updated the `pyEQL` logo (for the first time in 9 years!) to address an obsolete font in the .svg - and modernize the design. - -### Removed - -- **BREAKING** All methods and functions (with the exception of `Solution.list_XXX` methods) previously marked with - deprecation warnings have been removed. - -## [0.15.1] - 2024-03-13 - -### Fixed - -- `Solution.get_total_amount`: Fixed an issue in which `ppm` units would fail. - -## [0.15.0] - 2024-03-13 +## Unreleased ### Fixed