From 0e8715de891f1f00f4eab68277bccda276e4b7b9 Mon Sep 17 00:00:00 2001 From: Marc Anoma Date: Thu, 2 Feb 2017 11:36:37 -0800 Subject: [PATCH 1/3] Allowing spa_c() to use localized time index * converting time to 'UTC' if time index is localized --- pvlib/solarposition.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pvlib/solarposition.py b/pvlib/solarposition.py index 7b9690a69d..1b80393dbf 100644 --- a/pvlib/solarposition.py +++ b/pvlib/solarposition.py @@ -173,7 +173,11 @@ def spa_c(time, latitude, longitude, pressure=101325, altitude=0, pvl_logger.debug('using built-in spa code to calculate solar position') - time_utc = time + # if localized, convert to UTC. otherwise, assume UTC. + try: + time_utc = time.tz_convert('UTC') + except TypeError: + time_utc = time spa_out = [] @@ -184,7 +188,7 @@ def spa_c(time, latitude, longitude, pressure=101325, altitude=0, hour=date.hour, minute=date.minute, second=date.second, - timezone=0, # must input localized or utc time + timezone=0, # date uses utc time latitude=latitude, longitude=longitude, elevation=altitude, @@ -193,7 +197,7 @@ def spa_c(time, latitude, longitude, pressure=101325, altitude=0, delta_t=delta_t )) - spa_df = pd.DataFrame(spa_out, index=time_utc) + spa_df = pd.DataFrame(spa_out, index=time) if raw_spa_output: return spa_df From c8cef3fb21b0c7026ada08f0d649f8c77fac7b10 Mon Sep 17 00:00:00 2001 From: Marc Anoma Date: Thu, 2 Feb 2017 11:48:33 -0800 Subject: [PATCH 2/3] Updating whatsnew file with changes --- docs/sphinx/source/whatsnew/v0.4.4.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.4.4.txt b/docs/sphinx/source/whatsnew/v0.4.4.txt index 48ff7da142..0f3d8d8fd6 100644 --- a/docs/sphinx/source/whatsnew/v0.4.4.txt +++ b/docs/sphinx/source/whatsnew/v0.4.4.txt @@ -13,9 +13,11 @@ Documentation * Fixes the Forecasting page's broken links to the tutorials. * Fixes the Forecasting page's broken examples. (:issue:`299`) * Fixes broken Classes link in the v0.3.0 documentation. +* Fixes timezone issue in solarposition spa_c function (:issue:`237`) Contributors ~~~~~~~~~~~~ * Will Holmgren +* Marc Anoma \ No newline at end of file From c88144570d3cca00dd59188be8300935df074ec1 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Fri, 12 May 2017 13:38:05 -0700 Subject: [PATCH 3/3] move note from one whatsnew to the other --- docs/sphinx/source/whatsnew/v0.4.4.txt | 34 +++++++++++++++++++++++--- docs/sphinx/source/whatsnew/v0.4.5.txt | 19 ++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 docs/sphinx/source/whatsnew/v0.4.5.txt diff --git a/docs/sphinx/source/whatsnew/v0.4.4.txt b/docs/sphinx/source/whatsnew/v0.4.4.txt index 0f3d8d8fd6..e84e847490 100644 --- a/docs/sphinx/source/whatsnew/v0.4.4.txt +++ b/docs/sphinx/source/whatsnew/v0.4.4.txt @@ -1,11 +1,27 @@ .. _whatsnew_0440: -v0.4.4 (January xx, 2017) +v0.4.4 (February 18, 2017) -------------------------- Enhancements ~~~~~~~~~~~~ +* Added Anton Driesse Inverter database and made compatible with + pvsystem.retrieve_sam. (:issue:`169`) +* Ported Anton Driesse Inverter model from PV_LIB Toolbox. (:issue:`160`) +* Added Kasten pyrheliometric formula to calculate Linke turbidity factors with + improvements by Ineichen and Perez to extend range of air mass (:issue:`278`) +* Added coefficients for CIGS and a-Si modules types to the + first_solar_spectral_correction function (:issue:`308`) + + +API Changes +~~~~~~~~~~~ + +* Change PVSystem default module_parameters and inverter_parameters to + empty dict. Code that relied on these attributes being None or raising + a TypeError will need to be updated. (issue:`294`) + Documentation ~~~~~~~~~~~~~ @@ -13,11 +29,23 @@ Documentation * Fixes the Forecasting page's broken links to the tutorials. * Fixes the Forecasting page's broken examples. (:issue:`299`) * Fixes broken Classes link in the v0.3.0 documentation. -* Fixes timezone issue in solarposition spa_c function (:issue:`237`) + + +Bug fixes +~~~~~~~~~ + +* Resolved several issues with the forecast module tests. Library import + errors were resolved by prioritizing the conda-forge channel over the + default channel. Stalled ci runs were resolved by adding a timeout to + the HRRR_ESRL test. (:issue:`293`) +* Fixed issue with irradiance jupyter notebook tutorial. (:issue:`309`) Contributors ~~~~~~~~~~~~ * Will Holmgren -* Marc Anoma \ No newline at end of file +* Volker Beutner +* Mark Mikofski +* Anton Driesse +* Mitchell Lee diff --git a/docs/sphinx/source/whatsnew/v0.4.5.txt b/docs/sphinx/source/whatsnew/v0.4.5.txt new file mode 100644 index 0000000000..da5af2d0bf --- /dev/null +++ b/docs/sphinx/source/whatsnew/v0.4.5.txt @@ -0,0 +1,19 @@ +.. _whatsnew_0450: + +v0.4.5 (May xx, 2017) +--------------------- + + +Bug fixes +~~~~~~~~~ + +* Fix pandas 0.20 incompatibilities in Location.get_clearsky, + solarposition.ephemeris (:issue:`325`) +* Fixes timezone issue in solarposition spa_c function (:issue:`237`) + + +Contributors +~~~~~~~~~~~~ + +* Will Holmgren +* Marc Anoma