From ea5a383dc1bf6701bf5aa15737269886a9e8947c Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Wed, 11 Nov 2015 10:23:13 -0700 Subject: [PATCH 1/2] fix klucher spelling --- docs/sphinx/source/whatsnew/v0.2.2.txt | 5 +++++ pvlib/irradiance.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.2.2.txt b/docs/sphinx/source/whatsnew/v0.2.2.txt index 28a9e524ac..390129d86d 100644 --- a/docs/sphinx/source/whatsnew/v0.2.2.txt +++ b/docs/sphinx/source/whatsnew/v0.2.2.txt @@ -17,6 +17,11 @@ Enhancements Bug fixes ~~~~~~~~~ +* ``irradiance.total_irrad`` had a typo that required the + Klucher model to be accessed with ``'klutcher'``. Both spellings will work + for the remaining 0.2.* versions of pvlib, + but the misspelled method will be removed in 0.3. + (:issue:`97`) * Fixes an import and KeyError in the IPython notebook tutorials (:issue:`94`). * Uses the ``logging`` module properly by replacing ``format`` diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 4c03e16ba5..0d0e7d5ad4 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -376,7 +376,7 @@ def total_irrad(surface_tilt, surface_azimuth, model = model.lower() if model == 'isotropic': sky = isotropic(surface_tilt, dhi) - elif model == 'klutcher': + elif model in ['klucher', 'klutcher']: sky = klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, solar_azimuth) elif model == 'haydavies': From 846bd17c6e3e94a533705969ef0a7354400d2d7d Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Wed, 11 Nov 2015 11:06:15 -0700 Subject: [PATCH 2/2] add klucher to total_irrad test list --- pvlib/test/test_irradiance.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pvlib/test/test_irradiance.py b/pvlib/test/test_irradiance.py index 47d86a4048..44911253c1 100644 --- a/pvlib/test/test_irradiance.py +++ b/pvlib/test/test_irradiance.py @@ -137,16 +137,18 @@ def test_perez(): dni_et, ephem_data['apparent_zenith'], ephem_data['apparent_azimuth'], AM) - +# klutcher (misspelling) will be removed in 0.3 def test_total_irrad(): - models = ['isotropic', 'klutcher', 'haydavies', 'reindl', 'king', 'perez'] + models = ['isotropic', 'klutcher', 'klucher', + 'haydavies', 'reindl', 'king', 'perez'] AM = atmosphere.relativeairmass(ephem_data['apparent_zenith']) for model in models: total = irradiance.total_irrad( 32, 180, ephem_data['apparent_zenith'], ephem_data['azimuth'], - dni=irrad_data['dni'], ghi=irrad_data['ghi'], dhi=irrad_data['dhi'], + dni=irrad_data['dni'], ghi=irrad_data['ghi'], + dhi=irrad_data['dhi'], dni_extra=dni_et, airmass=AM, model=model, surface_type='urban')