Skip to content

Simplify or remove assert_*_equal wrappers around pandas.testing functions #2263

Open

Description

@kandersolar

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)).

Activity

  1. AdamRJensen commented on Oct 22, 2024

    @AdamRJensen
    Member

    I think we should just get rid of our own wrappers, and use pandas.

  2. dgowdaan-cmyk commented on Jul 8, 2026

    @dgowdaan-cmyk
    Contributor

    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.

  3. DresdenGman commented on Nov 3, 2026

    @DresdenGman

    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?

    1. Full removal: delete the wrappers in conftest.py and update all call sites to use pandas.testing directly.
    2. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions