Skip to content

Commit 2e2f7a8

Browse files
authored
pandas 0.20 compatibility (#326)
* fix Location.get_clearsky for pandas 0.20 * fix ephemeris for pandas 0.20 * add whatsnew * fix whatsnew issue number
1 parent 683dfe4 commit 2e2f7a8

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

docs/sphinx/source/whatsnew.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ What's New
66

77
These are new features and improvements of note in each release.
88

9+
.. include:: whatsnew/v0.4.5.txt
910
.. include:: whatsnew/v0.4.4.txt
1011
.. include:: whatsnew/v0.4.3.txt
1112
.. include:: whatsnew/v0.4.2.txt
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. _whatsnew_0450:
2+
3+
v0.4.5 (May xx, 2017)
4+
---------------------
5+
6+
7+
Bug fixes
8+
~~~~~~~~~
9+
10+
* Fix pandas 0.20 incompatibilities in Location.get_clearsky,
11+
solarposition.ephemeris (:issue:`325`)
12+
13+
14+
Contributors
15+
~~~~~~~~~~~~
16+
17+
* Will Holmgren

pvlib/location.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def get_clearsky(self, times, model='ineichen', solar_position=None,
191191
Column names are: ``ghi, dni, dhi``.
192192
"""
193193
if dni_extra is None:
194-
dni_extra = irradiance.extraradiation(times.dayofyear)
194+
dni_extra = irradiance.extraradiation(times)
195195

196196
try:
197197
pressure = kwargs.pop('pressure')

pvlib/solarposition.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,11 @@ def ephemeris(time, latitude, longitude, pressure=101325, temperature=12):
616616
DecHours = (time_utc.hour + time_utc.minute/60. + time_utc.second/3600. +
617617
time_utc.microsecond/3600.e6)
618618

619-
UnivDate = DayOfYear
620-
UnivHr = DecHours
619+
# np.array needed for pandas > 0.20
620+
UnivDate = np.array(DayOfYear)
621+
UnivHr = np.array(DecHours)
621622

622-
Yr = time_utc.year - 1900
623+
Yr = np.array(time_utc.year) - 1900
623624
YrBegin = 365 * Yr + np.floor((Yr - 1) / 4.) - 0.5
624625

625626
Ezero = YrBegin + UnivDate

0 commit comments

Comments
 (0)