pyEQL.functions.autogenerate() provides an easy way to instantiate common solutions like seawater, rainwater, etc. This function should be deprecated in favor of a Solution classmethod that serves the same purpose. What I envision is
@classmethod
def from_preset(preset: str) -> Solution:
"""
Instatiate a solution from a preset composition
Args:
preset: a named preset e.g. 'seawater' or the path to a .yaml file that defines the desired preset
Returns:
Solution
"""
Instead of hard-coding the composition of each preset in the function body (like autogenerate does), the properties (solute concentrations, pH, etc. can be stored in yaml or json files that are read in by from_preset. That will make the presets more transparent and make it easier to add additional ones in the future.
So when all is said and done, a user could:
s = Solution.from_preset('seawater')
<pyEQL.Solution object>
pyEQL.functions.autogenerate()
provides an easy way to instantiate common solutions like seawater, rainwater, etc. This function should be deprecated in favor of aSolution
classmethod that serves the same purpose. What I envision isInstead of hard-coding the composition of each preset in the function body (like
autogenerate
does), the properties (solute concentrations, pH, etc. can be stored inyaml
orjson
files that are read in byfrom_preset
. That will make the presets more transparent and make it easier to add additional ones in the future.So when all is said and done, a user could: