hgrecco / pint-pandas

Pandas support for pint
Other
172 stars 42 forks source link

Custom ureg support #149

Open redhog opened 1 year ago

redhog commented 1 year ago

Currently pint.get_application_registry() is used everywhere. PintArray should probably dig out the unit registry from the quantities sent in...

andrewgsavage commented 1 year ago

As I understand it, that's the correct way to work with pint. Before that was used in pint-pandas there were several issues where people were creating a second unit registry trying to operate between two registeries, which doesn't work.

You also need to be able to know what unit registry is being used ahead a PintType being created as you need to be able to construct from string, eg pd.Series([1, 2, 2, 3], dtype="pint[rpm]")