Pvlib-python: switch from pandas.util.testing to pandas.testing

Created on 21 Feb 2020  路  5Comments  路  Source: pvlib/pvlib-python

pandas.util.testing is deprecated and we're supposed to switch to the functions in the public API at pandas.testing instead.

I'm not sure what the pandas version compatibility is for this. If there's a problem, we could use try/except statements to handle earlier versions of pandas. Or we could just do nothing until the min pandas we support is high enough.

help wanted testing

All 5 comments

I didn't find a time horizon when pandas.util.testing would disappear. That module is currently executing from pandas._testing import * so changes to pandas._testing will affect us eventually but we should be safe for now. My guess is this won't affect us appreciably until a 1.1.0 release at the earliest.

At this point I'm +1 for waiting and aiming this for our v0.8.0 milestone where we can bump pandas-min to this level.

Looks like pandas.testing was added in pandas 0.20. https://github.com/pandas-dev/pandas/pull/16003

I think we're talking about going up to pandas 0.22 in pvlib 0.8, so let's make this a pvlib 0.8 milestone.

I think this will only take effect in pandas 2.0, according to their versioning policy: https://pandas.pydata.org/docs/whatsnew/v1.0.0.html#new-deprecation-policy

That doesn't mean we have to wait until then to make the switch. @wholmgren are you imagining a straightforward find and replace for this, or maybe something like importing the pandas functions in conftest and then doing from conftest import assert_series_equal and such in the test files?

That doesn't mean we have to wait until then to make the switch.

If we're bumping the minimum pandas in 0.8 then can we just go ahead and do the switch now?

@wholmgren are you imagining a straightforward find and replace for this, or maybe something like importing the pandas functions in conftest and then doing from conftest import assert_series_equal and such in the test files?

I was imagining a find/replace. I don't see any advantage to adding it to conftest but let me know if I'm missing something.

If we're bumping the minimum pandas in 0.8 then can we just go ahead and do the switch now?

Sure.

I was imagining a find/replace. I don't see any advantage to adding it to conftest but let me know if I'm missing something.

Only advantage I see is that if pandas changes it again, we would only update one file instead of many. Seems unlikely. Find/replace is fine with me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wholmgren picture wholmgren  路  4Comments

wholmgren picture wholmgren  路  6Comments

cbirkj picture cbirkj  路  7Comments

chriswmackey picture chriswmackey  路  5Comments

wholmgren picture wholmgren  路  4Comments