Skip to content

Remove dead code clearsky._is_leap_year #2768

Closed

Description

@JoLo90

The following internal functions or methods aren't used in the pvlib codebase

def _is_leap_year(year):

def _prep_inputs_tracking(self):

Should we remove them in a future version ?

Activity

  1. cwhanse commented on May 29, 2026

    @cwhanse
    Member

    I concur with these removals.

    def _prep_inputs_tracking(self):

    This private function was added before the author (me) of the run_model PR realized that tracking computations are expected to be done prior to instantiating the PVSystem that ModelChain operates on.

    ModelChain is clumsy for tracking PV systems. Different issue to improve it.

  2. added
    deprecation
    on Jun 3, 2026
  3. cwhanse commented on Jun 8, 2026

    @cwhanse
    Member

    Second thoughts: let's remove _is_leap_year and keep _prep_inputs_tracking. I'd like to open a new issue to smooth out ModelChain methods for tracking systems, and that function might be needed.

  4. dgowdaan-cmyk commented on Jul 6, 2026

    @dgowdaan-cmyk
    Contributor

    Hi! I can take this.

    I'll remove the _is_leap_year function from pvlib/clearsky.py since it's unused, and verify there are no references to it elsewhere in the codebase.
    I'll also add a test to confirm nothing breaks.

    Let me know if you'd like me to proceed.

  5. changed the title [-]Dead code[/-] [+]Remove dead code clearsky._is_leap_year[/+] on Jul 6, 2026
  6. cwhanse commented on Jul 6, 2026

    @cwhanse
    Member

    @dgowdaan-cmyk go ahead please. No need to deprecate or to add a new test.

  7. added a commit that references this issue on Jul 7, 2026
    df60945
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

    deprecation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions