-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Bump pandas to 0.25.0; test updates #1448
Changes from 11 commits
05e9d95
0fbc534
23b3b79
258a2aa
1ae6dee
efc3873
f1195a0
e02d9d3
cb486a3
d97f067
5d64cb8
12eb84a
d000079
2fbccdd
6494ea0
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
import pandas as pd | ||
import scipy.optimize as so | ||
import warnings | ||
import pytz | ||
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. pytz isn't in the standard library right? Is there some alternative to 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. pandas is built on pytz, so I don't have a problem with the dependency. Interesting idea, though: could we avoid pytz explicitly and just use pandas instead. |
||
|
||
from pvlib import atmosphere | ||
from pvlib.tools import datetime_to_djd, djd_to_datetime | ||
|
@@ -574,9 +575,10 @@ def sun_rise_set_transit_ephem(times, latitude, longitude, | |
trans = [] | ||
for thetime in times: | ||
thetime = thetime.to_pydatetime() | ||
# pyephem drops timezone when converting to its internal datetime | ||
# format, so handle timezone explicitly here | ||
obs.date = ephem.Date(thetime - thetime.utcoffset()) | ||
# older versions of pyephem ignore timezone when converting to its | ||
# internal datetime format, so convert to UTC here to support | ||
# all versions. GH #1449 | ||
obs.date = ephem.Date(thetime.astimezone(pytz.UTC)) | ||
kandersolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sunrise.append(_ephem_to_timezone(rising(sun), tzinfo)) | ||
sunset.append(_ephem_to_timezone(setting(sun), tzinfo)) | ||
trans.append(_ephem_to_timezone(transit(sun), tzinfo)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ def test_read_crn_problems(testfile_problems, columns_mapped, dtypes): | |
'2020-07-06 13:10:00'], | ||
freq=None).tz_localize('UTC') | ||
values = np.array([ | ||
[92821, 20200706, 1200, 20200706, 700, '3.0', -80.69, 28.62, 24.9, | ||
[92821, 20200706, 1200, 20200706, 700, '3', -80.69, 28.62, 24.9, | ||
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 think 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. mystery solved, thanks! |
||
0.0, np.nan, 0, 25.5, 'C', 0, 93.0, 0, nan, nan, 990, 0, 1.57, 0], | ||
[92821, 20200706, 1310, 20200706, 810, '2.623', -80.69, 28.62, | ||
26.9, 0.0, 430.0, 0, 30.2, 'C', 0, 87.0, 0, nan, nan, 989, 0, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this reworking of
read_crn
is more correct in two ways:.0
to string columns that happen to only contain numeric characters.Technically this change does affect the returned values (e.g.
'3'
vs'3.0'
); does it warrant a what's new entry?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so