pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

Replace pytz with standard library's zoneinfo

Open markcampanelli opened this issue 1 year ago • 1 comments

This is a demonstration of how we could remove the direct dependency on pytz and adopt the IANA-compliant standard-library solution zoneinfo, available since Python 3.9. This also leads to a single-source-of-truth simplification of the timezone tracking in pvlib.location.Location. Note that pandas apparently still uses pytz extensively, but I did not find this to conflict.

TODO: [ ] Update the extensive timezone tutorial in timetimezones.rst.

  • [ ] Closes #2342
  • [ ] I am familiar with the contributing guidelines
  • [ ] Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • [ ] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • [ ] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • [ ] Pull request is nearly complete and ready for detailed review.
  • [ ] Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

markcampanelli avatar Dec 23 '24 16:12 markcampanelli

@markcampanelli I'm marking this change for v0.13.0. I think the pytz is likely in many user workflows, and dropping it entirely should have sufficient deprecation. Let's deprecate pytz in v0.12.0 if not sooner.

cwhanse avatar Mar 12 '25 22:03 cwhanse