-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor: deprecate pytz in favor of builtin zoneinfo #2757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6a5c5d3
6e90468
6ce566e
a3a030f
2f58cc6
05d2781
dd89c33
15e60b0
dac983e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| import requests | ||
| import numpy as np | ||
| import pandas as pd | ||
| import pytz | ||
| import zoneinfo | ||
| from pvlib.iotools import read_epw | ||
|
|
||
| URL = 'https://re.jrc.ec.europa.eu/api/' | ||
|
|
@@ -413,10 +413,10 @@ def _coerce_and_roll_tmy(tmy_data, tz, year): | |
| re-interpreted as zero / UTC. | ||
| """ | ||
| if tz: | ||
| tzname = pytz.timezone(f'Etc/GMT{-tz:+d}') | ||
| tzname = zoneinfo.ZoneInfo(f'Etc/GMT{-tz:+d}') # noqa: E231 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see the commit history, did you add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @echedey-ls yes it was a false positive, flake8 insisted on putting a space after the : |
||
| else: | ||
| tz = 0 | ||
| tzname = pytz.timezone('UTC') | ||
| tzname = zoneinfo.ZoneInfo('UTC') | ||
| new_index = pd.DatetimeIndex([ | ||
| timestamp.replace(year=year, tzinfo=tzname) | ||
| for timestamp in tmy_data.index], | ||
|
|
||
|
JoLo90 marked this conversation as resolved.
|
Uh oh!
There was an error while loading. Please reload this page.