Skip to content

Commit fe5d90d

Browse files
alamathe1wholmgren
authored andcommitted
remove irradiance parameter from ModelChain.run_model and ModelChain.prepare_inputs (#490)
* Addressed Issue #488 * Removed comments related to irradiance parameter * Updated API section of docs/sphinx/source/whatsnew/v0.6.0.rst
1 parent ec99661 commit fe5d90d

File tree

3 files changed

+5
-35
lines changed

3 files changed

+5
-35
lines changed

docs/sphinx/source/whatsnew/v0.6.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ v0.6.0 (___, 2018)
66
API Changes
77
~~~~~~~~~~~
88
* pvsystem.calcparams_desoto now requires arguments for each module model parameter.
9+
* removed irradiance parameter from ModelChain.run_model and ModelChain.prepare_inputs
910

1011

1112
Enhancements
@@ -43,4 +44,5 @@ Contributors
4344
* Will Holmgren
4445
* Yu Cao
4546
* Cliff Hansen
47+
* Alan Mathew
4648

pvlib/modelchain.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ def complete_irradiance(self, times=None, weather=None):
713713

714714
return self
715715

716-
def prepare_inputs(self, times=None, irradiance=None, weather=None):
716+
def prepare_inputs(self, times=None, weather=None):
717717
"""
718718
Prepare the solar position, irradiance, and weather inputs to
719719
the model.
@@ -723,8 +723,6 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None):
723723
times : None or DatetimeIndex, default None
724724
Times at which to evaluate the model. Can be None if
725725
attribute `times` is already set.
726-
irradiance : None or DataFrame
727-
This parameter is deprecated. Please use `weather` instead.
728726
weather : None or DataFrame, default None
729727
If None, the weather attribute is used. If the weather
730728
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):
747745
if self.weather is None:
748746
self.weather = pd.DataFrame()
749747

750-
# The following part could be removed together with the irradiance
751-
# parameter at version v0.5 or v0.6.
752-
# **** Begin ****
753-
wrn_txt = ("The irradiance parameter will be removed soon.\n" +
754-
"Please use the weather parameter to pass a DataFrame " +
755-
"with irradiance (ghi, dni, dhi), wind speed and " +
756-
"temp_air.\n")
757-
if irradiance is not None:
758-
warnings.warn(wrn_txt, FutureWarning)
759-
for column in irradiance.columns:
760-
self.weather[column] = irradiance[column]
761-
# **** End ****
762-
763748
if times is not None:
764749
self.times = times
765750

@@ -824,7 +809,7 @@ def prepare_inputs(self, times=None, irradiance=None, weather=None):
824809
self.weather['temp_air'] = 20
825810
return self
826811

827-
def run_model(self, times=None, irradiance=None, weather=None):
812+
def run_model(self, times=None, weather=None):
828813
"""
829814
Run the model.
830815
@@ -833,8 +818,6 @@ def run_model(self, times=None, irradiance=None, weather=None):
833818
times : None or DatetimeIndex, default None
834819
Times at which to evaluate the model. Can be None if
835820
attribute `times` is already set.
836-
irradiance : None or DataFrame
837-
This parameter is deprecated. Please use `weather` instead.
838821
weather : None or DataFrame, default None
839822
If None, assumes air temperature is 20 C, wind speed is 0
840823
m/s and irradiation calculated from clear sky data. Column
@@ -852,7 +835,7 @@ def run_model(self, times=None, irradiance=None, weather=None):
852835
aoi_modifier, spectral_modifier, dc, ac, losses.
853836
"""
854837

855-
self.prepare_inputs(times, irradiance, weather)
838+
self.prepare_inputs(times, weather)
856839
self.aoi_model()
857840
self.spectral_model()
858841
self.effective_irradiance_model()

pvlib/test/test_modelchain.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -463,21 +463,6 @@ def test_ModelChain___repr__(system, location, strategy, strategy_str):
463463
assert mc.__repr__() == expected
464464

465465

466-
@requires_scipy
467-
def test_weather_irradiance_input(system, location):
468-
"""Test will raise a warning and should be removed in future versions."""
469-
mc = ModelChain(system, location)
470-
times = pd.date_range('2012-06-01 12:00:00', periods=2, freq='H')
471-
i = pd.DataFrame({'dni': [2, 3], 'dhi': [4, 6], 'ghi': [9, 5]}, index=times)
472-
w = pd.DataFrame({'wind_speed': [11, 5], 'temp_air': [30, 32]}, index=times)
473-
mc.run_model(times, irradiance=i, weather=w)
474-
475-
assert_series_equal(mc.weather['dni'],
476-
pd.Series([2, 3], index=times, name='dni'))
477-
assert_series_equal(mc.weather['wind_speed'],
478-
pd.Series([11, 5], index=times, name='wind_speed'))
479-
480-
481466
@requires_scipy
482467
def test_complete_irradiance_clean_run(system, location):
483468
"""The DataFrame should not change if all columns are passed"""

0 commit comments

Comments
 (0)