diff --git a/docs/sphinx/source/whatsnew/v0.11.3.rst b/docs/sphinx/source/whatsnew/v0.11.3.rst index 4f2637f948..22aca60e9d 100644 --- a/docs/sphinx/source/whatsnew/v0.11.3.rst +++ b/docs/sphinx/source/whatsnew/v0.11.3.rst @@ -4,6 +4,17 @@ v0.11.3 (Anticipated March, 2025) --------------------------------- +Bug fixes +~~~~~~~~~ +* Fix a bug in :py:func:`pvlib.bifacial.get_irradiance_poa` which may have yielded non-zero + ground irradiance when the sun was below the horizon. (:issue:`2245`, :pull:`2359`) +* Fix a bug where :py:func:`pvlib.transformer.simple_efficiency` could only be imported + using the `from pvlib.transformer` syntax (:pull:`2388`) +* :py:class:`~pvlib.modelchain.ModelChain` now requires only a minimal set of + parameters to run the SAPM electrical model. (:issue:`2369`, :pull:`2393`) +* Correct keys for First Solar modules in `~pvlib.spectrum.spectral_factor_pvspec` (:issue:`2398`, :pull:`2400`) + + Deprecations ~~~~~~~~~~~~ @@ -12,15 +23,10 @@ Enhancements ~~~~~~~~~~~~ * :py:func:`~pvlib.irradiance.gti_dirint` now raises an informative message when input data don't include values with AOI<90 (:issue:`1342`, :pull:`2347`) -* Fix a bug in :py:func:`pvlib.bifacial.get_irradiance_poa` which may have yielded non-zero - ground irradiance when the sun was below the horizon. (:issue:`2245`, :pull:`2359`) -* Fix a bug where :py:func:`pvlib.transformer.simple_efficiency` could only be imported - using the `from pvlib.transformer` syntax (:pull:`2388`) * Reduced space requirements by excluding tests and test files from wheel. Zipped wheel is now 66% of the previous size, and installed size is 50% of the previous size. (:issue:`2271`, :pull:`2277`) -* Correct keys for First Solar modules in `~pvlib.spectrum.spectral_factor_pvspec` (:issue:`2398`, :pull:`2400`) Documentation ~~~~~~~~~~~~~ @@ -57,4 +63,5 @@ Contributors * Manoj K S (:ghuser:`manojks1999`) * Kurt Rhee (:ghuser:`kurt-rhee`) * Ayush jariyal (:ghuser:`ayushjariyal`) +* Kevin Anderson (:ghuser:`kandersolar`) * Echedey Luis (:ghuser:`echedey-ls`) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index f99f0275af..662ea6befa 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -29,11 +29,10 @@ # a dict of required parameter names for each DC power model _DC_MODEL_PARAMS = { 'sapm': { - 'A0', 'A1', 'A2', 'A3', 'A4', 'B0', 'B1', 'B2', 'B3', - 'B4', 'B5', 'C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', - 'C7', 'Isco', 'Impo', 'Voco', 'Vmpo', 'Aisc', 'Aimp', 'Bvoco', + 'C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', + 'Isco', 'Impo', 'Voco', 'Vmpo', 'Aisc', 'Aimp', 'Bvoco', 'Mbvoc', 'Bvmpo', 'Mbvmp', 'N', 'Cells_in_Series', - 'IXO', 'IXXO', 'FD'}, + 'IXO', 'IXXO'}, 'desoto': { 'alpha_sc', 'a_ref', 'I_L_ref', 'I_o_ref', 'R_sh_ref', 'R_s'}, diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 836fd3c3a0..815703a435 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -1217,6 +1217,22 @@ def test_infer_dc_model(sapm_dc_snl_ac_system, cec_dc_snl_ac_system, assert isinstance(mc.results.dc, (pd.Series, pd.DataFrame)) +def test_infer_dc_model_sapm_minimal(location): + # GH 2369 -- Omit A*, B*, FD parameters; specify only DC electrical keys + dc_keys = ['C0', 'C1', 'C2', 'C3', 'Isco', 'Impo', 'Voco', 'Vmpo', + 'Aisc', 'Aimp', 'Bvoco', 'Bvmpo', 'Mbvoc', 'Mbvmp', 'N', + 'Cells_in_Series', 'IXO', 'IXXO', 'C4', 'C5', 'C6', 'C7'] + sapm_parameters = {key: 0 for key in dc_keys} + + system = pvsystem.PVSystem(module_parameters=sapm_parameters, + temperature_model_parameters={'u0': 0, 'u1': 0}, + inverter_parameters={'pdc0': 0}) + + mc = ModelChain(system, location, dc_model='sapm', + spectral_model='no_loss', aoi_model='no_loss') + assert isinstance(mc, ModelChain) + + def test_infer_dc_model_incomplete(multi_array_sapm_dc_snl_ac_system, location): match = 'Could not infer DC model from the module_parameters attributes ' @@ -1730,7 +1746,7 @@ def test_invalid_dc_model_params(sapm_dc_snl_ac_system, cec_dc_snl_ac_system, 'aoi_model': 'no_loss', 'spectral_model': 'no_loss', 'temperature_model': 'sapm', 'losses_model': 'no_loss'} for array in sapm_dc_snl_ac_system.arrays: - array.module_parameters.pop('A0') # remove a parameter + array.module_parameters.pop('C0') # remove a parameter with pytest.raises(ValueError): ModelChain(sapm_dc_snl_ac_system, location, **kwargs)