diff --git a/docs/sphinx/source/whatsnew/v0.6.0.rst b/docs/sphinx/source/whatsnew/v0.6.0.rst index 9513424e1f..a9a93f1b24 100644 --- a/docs/sphinx/source/whatsnew/v0.6.0.rst +++ b/docs/sphinx/source/whatsnew/v0.6.0.rst @@ -6,6 +6,7 @@ v0.6.0 (___, 2018) API Changes ~~~~~~~~~~~ * pvsystem.calcparams_desoto now requires arguments for each module model parameter. +* removed irradiance parameter from ModelChain.run_model and ModelChain.prepare_inputs Enhancements @@ -43,4 +44,5 @@ Contributors * Will Holmgren * Yu Cao * Cliff Hansen +* Alan Mathew diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 684bf4320b..7c9169f28a 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -713,7 +713,7 @@ def complete_irradiance(self, times=None, weather=None): return self - def prepare_inputs(self, times=None, irradiance=None, weather=None): + def prepare_inputs(self, times=None, weather=None): """ Prepare the solar position, irradiance, and weather inputs to the model. @@ -723,8 +723,6 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): times : None or DatetimeIndex, default None Times at which to evaluate the model. Can be None if attribute `times` is already set. - irradiance : None or DataFrame - This parameter is deprecated. Please use `weather` instead. weather : None or DataFrame, default None If None, the weather attribute is used. If the weather attribute is also None assumes air temperature is 20 C, wind @@ -747,19 +745,6 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): if self.weather is None: self.weather = pd.DataFrame() - # The following part could be removed together with the irradiance - # parameter at version v0.5 or v0.6. - # **** Begin **** - wrn_txt = ("The irradiance parameter will be removed soon.\n" + - "Please use the weather parameter to pass a DataFrame " + - "with irradiance (ghi, dni, dhi), wind speed and " + - "temp_air.\n") - if irradiance is not None: - warnings.warn(wrn_txt, FutureWarning) - for column in irradiance.columns: - self.weather[column] = irradiance[column] - # **** End **** - if times is not None: self.times = times @@ -824,7 +809,7 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None): self.weather['temp_air'] = 20 return self - def run_model(self, times=None, irradiance=None, weather=None): + def run_model(self, times=None, weather=None): """ Run the model. @@ -833,8 +818,6 @@ def run_model(self, times=None, irradiance=None, weather=None): times : None or DatetimeIndex, default None Times at which to evaluate the model. Can be None if attribute `times` is already set. - irradiance : None or DataFrame - This parameter is deprecated. Please use `weather` instead. weather : None or DataFrame, default None If None, assumes air temperature is 20 C, wind speed is 0 m/s and irradiation calculated from clear sky data. Column @@ -852,7 +835,7 @@ def run_model(self, times=None, irradiance=None, weather=None): aoi_modifier, spectral_modifier, dc, ac, losses. """ - self.prepare_inputs(times, irradiance, weather) + self.prepare_inputs(times, weather) self.aoi_model() self.spectral_model() self.effective_irradiance_model() diff --git a/pvlib/test/test_modelchain.py b/pvlib/test/test_modelchain.py index de8ba049c9..225063d37b 100644 --- a/pvlib/test/test_modelchain.py +++ b/pvlib/test/test_modelchain.py @@ -463,21 +463,6 @@ def test_ModelChain___repr__(system, location, strategy, strategy_str): assert mc.__repr__() == expected -@requires_scipy -def test_weather_irradiance_input(system, location): - """Test will raise a warning and should be removed in future versions.""" - mc = ModelChain(system, location) - times = pd.date_range('2012-06-01 12:00:00', periods=2, freq='H') - i = pd.DataFrame({'dni': [2, 3], 'dhi': [4, 6], 'ghi': [9, 5]}, index=times) - w = pd.DataFrame({'wind_speed': [11, 5], 'temp_air': [30, 32]}, index=times) - mc.run_model(times, irradiance=i, weather=w) - - assert_series_equal(mc.weather['dni'], - pd.Series([2, 3], index=times, name='dni')) - assert_series_equal(mc.weather['wind_speed'], - pd.Series([11, 5], index=times, name='wind_speed')) - - @requires_scipy def test_complete_irradiance_clean_run(system, location): """The DataFrame should not change if all columns are passed"""