Skip to content

Commit 4872296

Browse files
authored
improve modelchain inference error text (#703)
* improve modelchain inference error text * add link to mc doc page * fix so many typos
1 parent c9adf8b commit 4872296

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Enhancements
3030
* Add SOLRAD data reader to :ref:`iotools`.
3131
* Add EPW data reader to :ref:`iotools`. (:issue:`591`)
3232
* Add PSM3 reader to :ref:`iotools`. (:issue:`592`)
33+
* Improve ModelChain inference method error text. (:issue:`621`)
3334

3435
Bug fixes
3536
~~~~~~~~~
@@ -60,3 +61,4 @@ Contributors
6061
* Todd Hendricks (:ghuser:`tahentx`)
6162
* Kevin Anderson (:ghuser:`kevinsa5`)
6263
* :ghuser:`bentomlinson`
64+
* Jonathan Gaffiot (:ghuser:`jgaffiot`)

pvlib/modelchain.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ class ModelChain(object):
216216
interface for all of the modeling steps necessary for calculating PV
217217
power from a time series of weather inputs.
218218
219+
See https://pvlib-python.readthedocs.io/en/stable/modelchain.html
220+
for examples.
221+
219222
Parameters
220223
----------
221224
system : PVSystem
@@ -411,7 +414,9 @@ def infer_dc_model(self):
411414
return self.pvwatts_dc, 'pvwatts'
412415
else:
413416
raise ValueError('could not infer DC model from '
414-
'system.module_parameters')
417+
'system.module_parameters. Check '
418+
'system.module_parameters or explicitly '
419+
'set the model with the dc_model kwarg.')
415420

416421
def sapm(self):
417422
self.dc = self.system.sapm(self.effective_irradiance/1000.,
@@ -530,7 +535,9 @@ def infer_ac_model(self):
530535
return self.pvwatts_inverter
531536
else:
532537
raise ValueError('could not infer AC model from '
533-
'system.inverter_parameters')
538+
'system.inverter_parameters. Check '
539+
'system.inverter_parameters or explicitly '
540+
'set the model with the ac_model kwarg.')
534541

535542
def snlinverter(self):
536543
self.ac = self.system.snlinverter(self.dc['v_mp'], self.dc['p_mp'])
@@ -577,7 +584,11 @@ def infer_aoi_model(self):
577584
return self.ashrae_aoi_loss
578585
else:
579586
raise ValueError('could not infer AOI model from '
580-
'system.module_parameters')
587+
'system.module_parameters. Check that the '
588+
'system.module_parameters contain parameters for '
589+
'the physical, aoi, or ashrae model; explicitly '
590+
'set model with aoi_model kwarg; or set '
591+
'aoi_model="no_loss".')
581592

582593
def ashrae_aoi_loss(self):
583594
self.aoi_modifier = self.system.ashraeiam(self.aoi)
@@ -628,9 +639,10 @@ def infer_spectral_model(self):
628639
else:
629640
raise ValueError('could not infer spectral model from '
630641
'system.module_parameters. Check that the '
631-
'parameters contain valid '
632-
'first_solar_spectral_coefficients or a valid '
633-
'Material or Technology value')
642+
'system.module_parameters contain valid '
643+
'first_solar_spectral_coefficients, a valid '
644+
'Material or Technology value, or set '
645+
'spectral_model="no_loss".')
634646

635647
def first_solar_spectral_loss(self):
636648
self.spectral_modifier = self.system.first_solar_spectral_loss(

0 commit comments

Comments
 (0)