Skip to content
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

Add outside_domain parameter to irradiance ratio QC tests #214

Merged
merged 16 commits into from
Oct 24, 2024

Conversation

AdamRJensen
Copy link
Member

@AdamRJensen AdamRJensen commented Oct 9, 2024

  • Closes Values outside QC test domain are incorrectly flagged as in error #191
  • Added tests to cover all new or modified code.
  • Clearly documented all new API functions with PEP257 and numpydoc compliant docstrings.
  • [ ] Added new API functions to docs/api.rst.
  • Non-API functions clearly documented with docstrings or comments as necessary.
  • Adds description and name entries in the appropriate "what's new" file
    in docs/whatsnew
    for all changes. Includes link to the GitHub Issue with :issue:`num`
    or this Pull Request with :pull:`num`. Includes contributor name
    and/or GitHub username (link with :ghuser:`user`).
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

This PR adds an optional out_of_bounds parameter to the irradiance QC tests which allows the user to specify whether to Fail (False) or pass (True) a test when the conditions are outside of the valid test domain.

@AdamRJensen
Copy link
Member Author

@cwhanse, @kandersolar, @kperrynrel Before completing this I'd appreciate a review of the parameter naming and implementation and whether you can support this for future irradiance QC tests

@cwhanse
Copy link
Member

cwhanse commented Oct 9, 2024

The definition of out_of_bounds confuses me: "Whether a test is failed (False) or passes (True) when test conditions are not satisfied." If the test is not satisfied, and the function returns True, what is the point of doing the test?

If instead, you want the control the internal workings of the test, and not apply the GHI and zenith bounds, then "skip_bounds=False" makes more sense to me.

@AdamRJensen
Copy link
Member Author

AdamRJensen commented Oct 20, 2024

The definition of out_of_bounds confuses me: "Whether a test is failed (False) or passes (True) when test conditions are not satisfied." If the test is not satisfied, and the function returns True, what is the point of doing the test?

If instead, you want the control the internal workings of the test, and not apply the GHI and zenith bounds, then "skip_bounds=False" makes more sense to me.

My earlier definition probably wasn't good. The following is probably better:

outside_domain_value : default False
    Value to return when the tests are not applicable, i.e., when the
    inputs fall outside the test domain.

What I'm trying to achieve is that a test isn't considered failing when the test conditions aren't met (e.g., irradiance is below 50 W/m^2). @cwhanse does this make more sense?

@cwhanse
Copy link
Member

cwhanse commented Oct 20, 2024

That makes sense now. "out_of_domain" works for me, "out_of_domain_value" seems like the "value" part is optional.

@AdamRJensen AdamRJensen marked this pull request as ready for review October 21, 2024 23:08
@AdamRJensen
Copy link
Member Author

@cwhanse @kandersolar This PR is ready for review.

Cliff suggested naming the new parameter out_of_domain, whereas I have named it outside_domain - let me know if you have preferences.

Copy link
Member

@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

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

My browser GH is behaving strangely so if the suggested changes look wonky, its not me.

pvanalytics/quality/irradiance.py Outdated Show resolved Hide resolved
pvanalytics/quality/irradiance.py Outdated Show resolved Hide resolved
@cwhanse cwhanse added enhancement New feature or request labels Oct 22, 2024
@cwhanse cwhanse modified the milestone: v0.2.2 Oct 22, 2024
@AdamRJensen AdamRJensen changed the title Add out_of_bounds parameter to irradiance QC tests Add outside_domain parameter to irradiance QC tests Oct 23, 2024
@AdamRJensen AdamRJensen changed the title Add outside_domain parameter to irradiance QC tests Add outside_domain parameter to irradiance ration QC tests Oct 23, 2024
@AdamRJensen
Copy link
Member Author

@kandersolar a review of this would be appreciated

Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

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

Should the .. warning:: at the top of this function docstring (above Parameters) be edited, perhaps to mention this new parameter?

Tests look good to me.

pvanalytics/quality/irradiance.py Outdated Show resolved Hide resolved
pvanalytics/quality/irradiance.py Outdated Show resolved Hide resolved
pvanalytics/quality/irradiance.py Outdated Show resolved Hide resolved
@kandersolar kandersolar changed the title Add outside_domain parameter to irradiance ration QC tests Add outside_domain parameter to irradiance ratio QC tests Oct 23, 2024
@kandersolar
Copy link
Member

Should the .. warning:: at the top of this function docstring (above Parameters) be edited, perhaps to mention this new parameter?

@AdamRJensen any thoughts on this? If you want to leave it the way it is, then LGTM and fine to merge

@AdamRJensen
Copy link
Member Author

This is ready to be merged. Thanks for the help

@kandersolar kandersolar merged commit bf9eff6 into pvlib:main Oct 24, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Values outside QC test domain are incorrectly flagged as in error
3 participants