-
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
Changes from 12 commits
6a5c5d3
6e90468
6ce566e
a3a030f
2f58cc6
05d2781
dd89c33
15e60b0
dac983e
f0b4c74
dee1119
454ea79
bb1b248
3e4137a
84c3fc4
30266e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
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'm okay with keeping just the bare minimal changes to be done in here, but since it's mostly noise, I would revert all changes to it - I won't review this file if there are so many lines changed. It's obvious that you didn't know it, but these files are no longer maintained nor we expect them to work with latest pvlib versions (I think, please any maintainer correct me if I'm wrong).
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 ok I'll just modify the line where the outdated pytz property was used. If it doesn't work anymore, maybe we should delete them.
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. For the ipython files, whatever is easiest from this point onwards. Since the PR submitter updated the workbook, I don't think we need to revert changes. And I don't recall whether we decided (or just talked about) to not update the notebooks.
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. |
| 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], | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.