10000 Bump pandas to 0.25.0; test updates by kandersolar · Pull Request #1448 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Bump pandas to 0.25.0; test updates #1448

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

Merged
merged 15 commits into from
Apr 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
better UTC conversion in sun_rise_set_transit_ephem
  • Loading branch information
kandersolar committed Apr 25, 2022
commit 1ae6deedd633613e482bb70aa303f9e23865c016
3 changes: 2 additions & 1 deletion pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import pandas as pd
import scipy.optimize as so
import warnings
import pytz
Copy link
Member Author

Choose a reason for hiding this comment

The 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 pytz.UTC that we can use to prevent making this an explicit dependency? I'm not at all familiar with non-pandas timezone code.

Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -576,7 +577,7 @@ def sun_rise_set_transit_ephem(times, latitude, longitude,
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())
obs.date = ephem.Date(thetime.astimezone(pytz.UTC))
sunrise.append(_ephem_to_timezone(rising(sun), tzinfo))
sunset.append(_ephem_to_timezone(setting(sun), tzinfo))
trans.append(_ephem_to_timezone(transit(sun), tzinfo))
Expand Down
0