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 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(