Skip to content

Commit

Permalink
restore Quantity conversion
Browse files Browse the repository at this point in the history
need to wait for next monty release
  • Loading branch information
rkingsbury committed Jul 27, 2024
1 parent 68e1482 commit 8a50214
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pyEQL/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,10 @@ def as_dict(self) -> dict:
if self.volume_update_required:
self._update_volume()
d = super().as_dict()
for k, v in d.items():
# convert all Quantity to str
if isinstance(v, Quantity):
d[k] = str(v)
# replace solutes with the current composition
d["solutes"] = {k: f"{v} mol" for k, v in self.components.items()}
# replace the engine with the associated str
Expand Down

0 comments on commit 8a50214

Please sign in to comment.