You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I find pytz to be somewhat confusing and cumbersome. Since Python 3.9, pytz can be replaced by the standard library's zoneinfo package for full and up-to-date IANA timezone support. Furthermore, it appears that localization of "naive" timedate timestamps is fully supported without using pytz. For example:
In particular, the pvlib.location.Location class can be streamlined significantly by using only the zoneinfo.ZoneInfo class as the timezone attribute. Of course, pytz would still be lurking in the background due to its significant usage in pandas.
Describe the solution you'd like
Switch from pytz to zoneinfo. We could optionally deprecate pytz usage initially in the pvlib.location.Location constructor, but my sense is that simply removing it entirely will not break many people who typically instead use timezone strings in the initializer. Also, https://pvlib-python.readthedocs.io/en/latest/user_guide/timetimezones.html would need a significant update.
Describe alternatives you've considered
Keep using pytz.
Additional context
See #2339#2343 for an example of pytz's full removal.
The text was updated successfully, but these errors were encountered:
I confess this is the first I've heard of zoneinfo, but it seems like the python community at large is agreed that switching from pytz to zoneinfo is a good idea. Thanks @markcampanelli for bringing it up!
Is your feature request related to a problem? Please describe.
I find
pytz
to be somewhat confusing and cumbersome. Since Python 3.9,pytz
can be replaced by the standard library's zoneinfo package for full and up-to-date IANA timezone support. Furthermore, it appears that localization of "naive"timedate
timestamps is fully supported without usingpytz
. For example:In particular, the
pvlib.location.Location
class can be streamlined significantly by using only thezoneinfo.ZoneInfo
class as the timezone attribute. Of course,pytz
would still be lurking in the background due to its significant usage inpandas
.Describe the solution you'd like
Switch from
pytz
tozoneinfo
. We could optionally deprecatepytz
usage initially in thepvlib.location.Location
constructor, but my sense is that simply removing it entirely will not break many people who typically instead use timezone strings in the initializer. Also, https://pvlib-python.readthedocs.io/en/latest/user_guide/timetimezones.html would need a significant update.Describe alternatives you've considered
Keep using
pytz
.Additional context
See
#2339#2343 for an example ofpytz
's full removal.The text was updated successfully, but these errors were encountered: