Skip to content

added conditional statement to avoid division by zero#870

Merged
vgro merged 1 commit intodevelopfrom
869-avoid-division-by-zero-in-rainfall-generator
May 22, 2025
Merged

added conditional statement to avoid division by zero#870
vgro merged 1 commit intodevelopfrom
869-avoid-division-by-zero-in-rainfall-generator

Conversation

@vgro
Copy link
Copy Markdown
Collaborator

@vgro vgro commented May 20, 2025

Some experiments returned this warning, which is hopefully fixed here:

RuntimeWarning: invalid value encountered in scalar divide
  daily_rainfall *= rainfall / np.sum(daily_rainfall)

Fixes #869

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

@vgro vgro linked an issue May 20, 2025 that may be closed by this pull request
@vgro vgro requested a review from jacobcook1995 May 20, 2025 14:32
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.79%. Comparing base (b490fda) to head (3fb2ff1).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #870   +/-   ##
========================================
  Coverage    94.79%   94.79%           
========================================
  Files           75       75           
  Lines         5589     5591    +2     
========================================
+ Hits          5298     5300    +2     
  Misses         291      291           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@jacobcook1995 jacobcook1995 left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgro vgro merged commit af805f4 into develop May 22, 2025
16 checks passed
@vgro vgro deleted the 869-avoid-division-by-zero-in-rainfall-generator branch May 22, 2025 07:55
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.

avoid division by zero in rainfall generator

3 participants