Skip to content

Commit 2eb64ca

Browse files
committed
Raise error if return_components=True used with king or klucher
1 parent 722f6fd commit 2eb64ca

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

pvlib/irradiance.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ def get_total_irradiance(surface_tilt, surface_azimuth,
338338
components available from the selected model
339339
(e.g., isotropic, circumsolar, horizon brightening).
340340
If `False`, only the total diffuse irradiance is returned.
341+
This option is not available for the ``'klucher'`` and
342+
``'king'`` models.
341343
342344
Returns
343345
-------
@@ -420,6 +422,8 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
420422
components available from the selected model
421423
(e.g., isotropic, circumsolar, horizon brightening).
422424
If `False`, only the total diffuse irradiance is returned.
425+
This option is not available for the ``'klucher'`` and
426+
``'king'`` models.
423427
424428
Returns
425429
-------
@@ -454,6 +458,10 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
454458

455459
model = model.lower()
456460

461+
if return_components and model in {'klucher', 'king'}:
462+
raise ValueError('return_components is not supported for'
463+
f' model {model}')
464+
457465
if dni_extra is None and model in {'haydavies', 'reindl',
458466
'perez', 'perez-driesse'}:
459467
raise ValueError(f'dni_extra is required for model {model}')
@@ -462,8 +470,7 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
462470
sky = isotropic(surface_tilt, dhi, return_components=return_components)
463471
elif model == 'klucher':
464472
sky = klucher(surface_tilt, surface_azimuth, dhi, ghi,
465-
solar_zenith, solar_azimuth,
466-
return_components=return_components)
473+
solar_zenith, solar_azimuth)
467474
elif model == 'haydavies':
468475
sky = haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
469476
solar_zenith, solar_azimuth,

0 commit comments

Comments
 (0)