Skip to content

Pandas4Warning: DatetimeIndex.dayofyear is deprecated #2947

Closed

Description

@jonasfd

Hello all,

We've been getting this warning in our CI pipelines and we'd like to raise it here.

pvlib/tools.py:217: Pandas4Warning: DatetimeIndex.dayofyear is deprecated and will be removed in a future version. Use DatetimeIndex.day_of_year instead.
    return _pandas_to_utc(pd_object).dayofyear

and

pvlib/clearsky.py:248: Pandas4Warning: DatetimeIndex.dayofyear is deprecated and will be removed in a future version. Use DatetimeIndex.day_of_year instead.
    dayofyear = time_utc.dayofyear

How to reproduce:

import warnings

import pandas as pd
import pvlib

warnings.simplefilter("always")

times = pd.date_range("2024-01-01", periods=24, freq="h", tz="UTC")
pvlib.clearsky.lookup_linke_turbidity(times, latitude=-34.93, longitude=138.60)

We are running
python 3.12
pvlivb 0.16.1
pandas 3.1.1

Activity

  1. cwhanse commented on Nov 16, 2026

    @cwhanse
    Member

    This has been addressed in #2924, will be in the next release. Thanks for reporting it.

  2. added this to the v0.16.2 milestone on Nov 16, 2026
  3. kandersolar commented on Nov 21, 2026

    @kandersolar
    Member

    Already addressed, so closing.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions