You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simplify or remove assert_*_equal wrappers around pandas.testing functions #2263
We have our own wrappers in conftest.py for the three pandas assert_X_equal functions. We originally added those because the default tolerances of those functions changed in pandas 1.1.0 (see #1018). Our wrappers check the version of pandas and do some simple kwarg manipulation based on whether the installed pandas is greater or lower than 1.1.0.
Now that our minimum pandas is greater than 1.1.0, the version checking is no longer needed and we can simplify those functions.
It is also worth looking into whether we can/should get rid of those wrappers entirely and just use the pandas functions directly, but that change might require a lot of work (#1018 (comment)).
Hi @kandersolar / @AdamRJensen, I'd like to take this on. Based on the discussion, I'll go with
full removal per Adam's suggestion — replacing the check_less_precise=True usages with explicit
atol=1e-3, rtol=1e-3, removing the wrapper functions from conftest.py, and updating the test
files to import assert_series_equal/assert_frame_equal/assert_index_equal directly from
pandas.testing. Will open a PR once done and all tests pass.
I would like to pick this up. As I read the current state: pvlib/conftest.py wraps three pandas.testing assert functions, including version checks and kwargs rewriting that date from the pandas 1.1.0 era. The minimum supported pandas is well past that now, so the version logic is dead code, and the direction noted in this thread is to remove the wrappers and use the pandas.testing functions directly.
Before I start, could a maintainer confirm the intended scope?
Full removal: delete the wrappers in conftest.py and update all call sites to use pandas.testing directly.
Simplification only: keep thin wrappers but drop the dead version-dependent logic.
I am happy to do either. For context, I have a PR open in pvlib (#2932) and have worked through the iotools test suite, so I can verify the affected tests as I go. I also noticed a detailed plan was posted here in July — if that contributor is still planning to work on this, I do not want to duplicate the effort and will step aside.
Activity
AdamRJensen commentedon Oct 22, 2024
I think we should just get rid of our own wrappers, and use pandas.
dgowdaan-cmyk commentedon Jul 8, 2026
Hi @kandersolar / @AdamRJensen, I'd like to take this on. Based on the discussion, I'll go with
full removal per Adam's suggestion — replacing the check_less_precise=True usages with explicit
atol=1e-3, rtol=1e-3, removing the wrapper functions from conftest.py, and updating the test
files to import assert_series_equal/assert_frame_equal/assert_index_equal directly from
pandas.testing. Will open a PR once done and all tests pass.
DresdenGman commentedon Nov 3, 2026
I would like to pick this up. As I read the current state:
pvlib/conftest.pywraps threepandas.testingassert functions, including version checks and kwargs rewriting that date from the pandas 1.1.0 era. The minimum supported pandas is well past that now, so the version logic is dead code, and the direction noted in this thread is to remove the wrappers and use thepandas.testingfunctions directly.Before I start, could a maintainer confirm the intended scope?
conftest.pyand update all call sites to usepandas.testingdirectly.I am happy to do either. For context, I have a PR open in pvlib (#2932) and have worked through the iotools test suite, so I can verify the affected tests as I go. I also noticed a detailed plan was posted here in July — if that contributor is still planning to work on this, I do not want to duplicate the effort and will step aside.