From 38e0cd54a73c0170752e598324cdbfbcfb51e1a4 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Fri, 15 Jun 2018 21:03:47 -0700 Subject: [PATCH 1/2] in modelchain, pass solar position and airmass to get_clearsky --- pvlib/modelchain.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 29f4cfa674..684bf4320b 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -273,7 +273,7 @@ class ModelChain(object): spectral_model: None, str, or function, default None If None, the model will be inferred from the contents of system.module_parameters. Valid strings are 'sapm', - 'first_solar', 'no_loss'. The ModelChain instance will be passed + 'first_solar', 'no_loss'. The ModelChain instance will be passed as the first argument to a user-defined function. @@ -772,8 +772,8 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): if not any([x in ['ghi', 'dni', 'dhi'] for x in self.weather.columns]): self.weather[['ghi', 'dni', 'dhi']] = self.location.get_clearsky( self.solar_position.index, self.clearsky_model, - zenith_data=self.solar_position['apparent_zenith'], - airmass_data=self.airmass['airmass_absolute']) + solar_position=self.solar_position, + airmass_absolute=self.airmass['airmass_absolute']) if not {'ghi', 'dni', 'dhi'} <= set(self.weather.columns): raise ValueError( From baa86f3099464d429d7dfd6026aed9cd3d272726 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Fri, 15 Jun 2018 21:05:39 -0700 Subject: [PATCH 2/2] update whatsnew --- docs/sphinx/source/whatsnew/v0.6.0.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.6.0.rst b/docs/sphinx/source/whatsnew/v0.6.0.rst index 2f205edf04..9513424e1f 100644 --- a/docs/sphinx/source/whatsnew/v0.6.0.rst +++ b/docs/sphinx/source/whatsnew/v0.6.0.rst @@ -20,6 +20,8 @@ Bug fixes * Unset executable bits of irradiance.py and test_irradiance.py (:issue:`460`) * Fix failing tests due to column order on Python 3.6+ and Pandas 0.23+ (:issue:`464`) +* ModelChain.prepare_inputs failed to pass solar_position and airmass to + Location.get_clearsky. Fixed. (:issue:`481`) Documentation