Skip to content

fix: replace deprecated datetime.utcnow() with timezone-aware alternatives#413

Open
nightcityblade wants to merge 1 commit intoopenclimatefix:mainfrom
nightcityblade:fix/issue-403
Open

fix: replace deprecated datetime.utcnow() with timezone-aware alternatives#413
nightcityblade wants to merge 1 commit intoopenclimatefix:mainfrom
nightcityblade:fix/issue-403

Conversation

@nightcityblade
Copy link
Copy Markdown

Fixes #403

Replaces deprecated datetime.utcnow() and pd.Timestamp.utcnow() with timezone-aware alternatives across the Elexon plotting flow and related modules:

  • src/plots/elexon_plots.pydatetime.now(timezone.utc)
  • tests/test_elexon_plot.pydatetime.now(timezone.utc)
  • src/pvsite_forecast.pypd.Timestamp.now(tz="UTC")
  • src/mlmodel.pypd.Timestamp.now(tz="UTC")

datetime.utcnow() was deprecated in Python 3.12 as it returns naive datetimes despite implying UTC. pd.Timestamp.utcnow() was deprecated in pandas 2.1 for the same reason.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace deprecated datetime.utcnow() in Elexon plotting and tests

1 participant