Vitens / phreeqpython

Object-oriented python wrapper for the VIPhreeqc module
Apache License 2.0
68 stars 19 forks source link

Improve __str__ representation of Solution class #34

Closed martinwk closed 1 year ago

martinwk commented 1 year ago

In previous implementation it sometimes yields an error because the self.number is an int while the str expects it to be a str. Now it uses f-strings instead which makes it more readable and the attributes are cast to a string-representation automatically. I also slightly changed the formatting to make it more concise. It now prints as <PhreeqPython.Solution number 0>

This especially solves issue we experience when we use the PhreeqPython Solutions in a DataFrame as we do in our tool HGC