Skip to content

BUG: suppress RuntimeWarning in snow.categorize and outliers.zscore - #238

Open
Omesh37 wants to merge 4 commits into
pvlib:mainfrom
Omesh37:fix/runtime-warnings-snow-outliers
Open

BUG: suppress RuntimeWarning in snow.categorize and outliers.zscore#238
Omesh37 wants to merge 4 commits into
pvlib:mainfrom
Omesh37:fix/runtime-warnings-snow-outliers

Conversation

@Omesh37

@Omesh37 Omesh37 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Closes #237

Description

Two functions emitted RuntimeWarning for valid edge-case inputs:
1. snow.py:229 —> invalid value encountered in divide when modeled_voltage_with_snow_copy contains zeros. The existing np.errstate(divide='ignore') did not cover the invalid case (0/0). Added invalid='ignore' to the existing errstate.

2. outliers.py:78 —> Precision loss RuntimeWarning from scipy.stats.zscore when all input values are identical. Wrapped the zscore call with np.errstate(invalid='ignore').

  • Closes BUG: RuntimeWarning in snow.categorize and outliers.zscore for edge case inputs #237
  • Added tests to cover all new or modified code.
  • 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: RuntimeWarning in snow.categorize and outliers.zscore for edge case inputs

1 participant