Skip to content

Fix2461 #2486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix2461 #2486

wants to merge 2 commits into from

Conversation

OmarBahamida
Copy link

Enhance Huld model with EU JRC coefficients

  • Introduced a new function to infer updated coefficients for the Huld model based on EU JRC research.
  • Added a parameter to the existing Huld function to optionally use these updated coefficients.
  • Updated documentation to reflect the new functionality and included references to the EU JRC paper.
  • Added tests to verify the implementation and ensure compatibility with existing functionality.

- Introduced a new function to infer updated coefficients for the Huld model based on EU JRC research.
- Added a parameter to the existing Huld function to optionally use these updated coefficients.
- Updated documentation to reflect the new functionality and included references to the EU JRC paper.
- Added tests to verify the implementation and ensure compatibility with existing functionality.

(cherry picked from commit f0ba338)
- Updated the test for the Huld model to use non-reference values for irradiance and temperature.
- Enhanced the test to verify that results differ for all supported cell types when using EU JRC coefficients.
- Added checks to ensure all cell types are supported and that a KeyError is raised for invalid cell types.

(cherry picked from commit 7c0feba)
@cwhanse
Copy link
Member

cwhanse commented Jun 17, 2025

I'm -1 on the new kwarg use_eu_jrc. The way I read the 2025 reference, the intent is to replace the older set of coefficients, to reflect "modern" modules. If we need to retain the older coefficients for continuity, we can add a table to the docstring.

Comments for my fellow maintainers?

@echedey-ls
Copy link
Contributor

I'm between @cwhanse and @OmarBahamida ; I prefer a version keyword only parameter that can be either 2025 or 2011, and defaults to the latest one. I think it's valuable to ease the use of older parameters, given their lifetime is long and post analysis of systems is great for diagnosis.

Copy link
Contributor

@echedey-ls echedey-ls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done. Overall a good approach. Please, also add a whatsnew entry in docs/sphinx/source/whatsnew once you apply the new changes.

Comment on lines +376 to +377
.. [2] EU JRC paper, "Updated coefficients for the Huld model",
https://doi.org/10.1002/pip.3926
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you didn't change this to fit the IEEE citation format nor the :doi: directive (see the citation just above).

I recommend you to read https://pvlib-python.readthedocs.io/en/latest/contributing/style_guide.html

@@ -69,3 +69,23 @@ def test_huld():
with pytest.raises(ValueError,
match='Either k or cell_type must be specified'):
res = pvarray.huld(1000, 25, 100)


def test_huld_eu_jrc():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check for some specific values, up to 4-5 decimals? It would be better if you calculate them outside of your Python implementation.

@echedey-ls echedey-ls added this to the v0.13.1 milestone Jun 18, 2025
@echedey-ls echedey-ls mentioned this pull request Jun 18, 2025
@AdamRJensen
Copy link
Member

AdamRJensen commented Jun 18, 2025

I'm between @cwhanse and @OmarBahamida ; I prefer a version keyword only parameter that can be either 2025 or 2011, and defaults to the latest one. I think it's valuable to ease the use of older parameters, given their lifetime is long and post analysis of systems is great for diagnosis.

I fully support this implementation. It would be a shame to remove existing features. This way we can also have a deprecation cycle, i.e., a period where a warning is raised if the version parameter is not specified. Eventually, we can make the breaking change of switching the default version to the most recent version of the coefficients.

@cwhanse
Copy link
Member

cwhanse commented Jun 18, 2025

Any set of coefficients can be provided directly to the existing function, so kwargs like version aren't strictly necessary.

But if we lean towards providing built-in parameters, as a convenience, or as a means to repeat previous analyses (where parameters were not explicit, which is a different problem), then I think the user should be required to affirmatively select them: version=None would have my vote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants