Putting the world to rights.
Taylors is a good pint!
Sunk in Six

Putting the world to rights.
Taylors is a good pint!
Sunk in Six
'Tis St. Headache's Day
Pain in drinkin' o' the green
Why'd I quaff so much?
#Haiku #OneHaikuADay #WritersCollective #writingcommunity #BackToHaiku #Winter #March #Spring #StPatricksDay #GreenBeer #Hangover #Headache #Drunk #Drinking #Alcohol #Beer #Pint #Guinness
March 18, 2025
I use the #Python library #Pint to integrate units into my #engineering calculations. In general, it works well with #NumPy, but I discovered yesterday that units are lost when using the "piecewise" function on an array with units.
Possibly the problem would be solved if I upgraded to the latest versions of Pint and NumPy; both have seen a lot of development in recent years. But I won't depend upon NumPy > v.2.0 until it's been released in Debian Stable.
The #UnPaAc package is now available on #PyPI. One advantage compared to #pint and #uncertainties (including their #pandas integrations) is, that it allows to store and restore DataFrames with Series containing #units and uncertainties to/from csv files. An example workflow of this procedure is described in the package's readme file: https://codeberg.org/Cs137/UnPaAc#save-a-dataframe-to-csv-and-restore-dataframe-from-csv
I created accessors which simplify working with #uncertainties and #units in #pandas objects. Since the weekend was to short, the package is not ready for a #pypi deposition yet, but available via the #codeberg repo:
https://codeberg.org/Cs137/UnPaAc
Feedback appreciated