Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -754,10 +752,6 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None):
"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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines from "# The following part could be removed together with the irradiance" through "# **** End ****" should also be deleted.

warnings.warn(wrn_txt, FutureWarning)
for column in irradiance.columns:
self.weather[column] = irradiance[column]
# **** End ****

if times is not None:
Expand Down Expand Up @@ -824,7 +818,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.

Expand All @@ -833,8 +827,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
Expand All @@ -852,7 +844,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()
Expand Down
15 changes: 0 additions & 15 deletions pvlib/test/test_modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down