Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
50 changes: 50 additions & 0 deletions docs/sphinx/source/whatsnew/v0.17.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. _whatsnew_0_X_Y:


v0.X.Y (Month XX, 20YY)
-----------------------

Breaking Changes
~~~~~~~~~~~~~~~~
* ``ModelChain`` no longer infers cell type for modules in the CEC database
with Technology of 'Thin Film'. Previously cell type 'cigs' was assigned
for all such modules, which is incorrect for some. Cell type is used to
infer default parameters for :py:func:`pvlib.spectrum.spectral_factor_firstsolar`
Users should assign spectral model parameters in ``PVSystem.module_parameters``
or set ``PVSystem.Technology`` to the correct cell type.

Deprecations
~~~~~~~~~~~~


Bug fixes
~~~~~~~~~


Enhancements
~~~~~~~~~~~~


Documentation
~~~~~~~~~~~~~


Testing
~~~~~~~


Benchmarking
~~~~~~~~~~~~


Requirements
~~~~~~~~~~~~


Maintenance
~~~~~~~~~~~


Contributors
~~~~~~~~~~~~
* Cliff Hansen (:ghuser:`cwhanse`)
9 changes: 7 additions & 2 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,12 @@ def _spectral_correction(array, pw):
else:
module_type = array._infer_cell_type()
coefficients = None

if (module_type is None):
msg = (
"No parameters provided for the First Solar spectral",
" model and pvlib could not infer spectral model",
" parameters from the module parameters.")
raise ValueError(msg)
return spectrum.spectral_factor_firstsolar(
pw, airmass_absolute, module_type, coefficients
)
Expand Down Expand Up @@ -1090,7 +1095,7 @@ def _infer_cell_type(self):

_cell_type_dict = {'Multi-c-Si': 'multisi',
'Mono-c-Si': 'monosi',
'Thin Film': 'cigs',
'Thin Film': None, # mixes CIGS & CdTe GH#1984
'a-Si/nc': 'asi',
'CIS': 'cigs',
'CIGS': 'cigs',
Expand Down
14 changes: 14 additions & 0 deletions tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,14 @@ def test_PVSystem_multi_array_first_solar_spectral_loss():
assert loss_one == loss_two


def test_PVSsytem_first_solar_spectral_loss_error():
module_parameters = {'Technology': 'Thin Film'} # returns None
system = pvsystem.PVSystem(module_parameters=module_parameters)
with pytest.raises(ValueError,
match='No parameters provided for the First Solar'):
system.first_solar_spectral_loss(3, 3)


@pytest.mark.parametrize('test_input,expected', [
([1000, 100, 5, 45], 1140.0510967821877),
([np.array([np.nan, 1000, 1000]),
Expand Down Expand Up @@ -842,6 +850,12 @@ def test_Array__infer_cell_type():
array = pvsystem.Array(mount=pvsystem.FixedMount(0, 180),
module_parameters={})
assert array._infer_cell_type() is None
array = pvsystem.Array(mount=pvsystem.FixedMount(0, 180),
module_parameters={'Technology': 'Thin Film'})
assert array._infer_cell_type() is None
array = pvsystem.Array(mount=pvsystem.FixedMount(0, 180),
module_parameters={'Technology': 'Multi-c-Si'})
assert array._infer_cell_type() == 'multisi'


def _calcparams_correct_Python_type_numeric_type_cases():
Expand Down
Loading