hgrecco / pint-pandas

Pandas support for pint
Other
169 stars 42 forks source link

Support for Pandas 1.5/1.6 #133

Closed andrewgsavage closed 1 year ago

andrewgsavage commented 1 year ago

Probably closes #120

This is running locally, with https://github.com/hgrecco/pint/pull/1596. Quite a few additional tests passing! This is following the change to is_list_like in pandas, so allows constrcutors and setitem to work.

andrewgsavage commented 1 year ago

I've pointed this to my pint branch which adds ndim for Quantity, and my pandas branch which changes makes assert...equal recognise pint Quantitys as scalar. This is down to =========== 489 passed, 11 xfailed, 7 xpassed, 6 warnings in 11.20s ============ It was previously ========== 433 passed, 64 xfailed, 8 xpassed, 246 warnings in 24.09s ===========

andrewgsavage commented 1 year ago

That's all the tests working with, the exception of the ones xfailed in pandas!

andrewgsavage commented 1 year ago

some issue with python 3.11 installing pyarrow so I'll leave that out for another PR.

andrewgsavage commented 1 year ago

This is ready now. @hgrecco Could you take a look at it?

I have set it to use my fork of pandas with branches for 1.5.x and 1.6.x to get around the assert_series_equal issue (pint scalars are recognised as iterable in a testing function). I've got a pandas issue and PR for this.

Is it better to have the affected tests xpassed, or to use my branches? I'm leaning towards using my branches as this lets us run these tests and know if any changes cause behaviour to change.

hgrecco commented 1 year ago

I have review it and I like the code. Should I release a new pint-pandas version now?

I agree that you should use your branches for testing

andrewgsavage commented 1 year ago

OK great, I'll merge this and #132 and then you can release a new version.

andrewgsavage commented 1 year ago

bors r+

bors[bot] commented 1 year ago

Build succeeded: