Skip to content

Fixed division by zero warning in soil.uptake#1147

Merged
jacobcook1995 merged 1 commit intodevelopfrom
1146-soiluptake-module-still-emits-divide-by-zero-warning-for-cases-that-are-handled
Nov 14, 2025
Merged

Fixed division by zero warning in soil.uptake#1147
jacobcook1995 merged 1 commit intodevelopfrom
1146-soiluptake-module-still-emits-divide-by-zero-warning-for-cases-that-are-handled

Conversation

@jacobcook1995
Copy link
Copy Markdown
Collaborator

@jacobcook1995 jacobcook1995 commented Nov 14, 2025

Description

Mini-PR that stops division by zero warnings in the soil.uptake submodule by switching to np.divide (with where as an argument) rather than using np.where

Fixes #1146

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

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works
  • Relevant documentation reviewed and updated

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.35%. Comparing base (18878d7) to head (9b4392c).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1147      +/-   ##
===========================================
- Coverage    94.35%   94.35%   -0.01%     
===========================================
  Files           70       70              
  Lines         7051     7049       -2     
===========================================
- Hits          6653     6651       -2     
  Misses         398      398              

☔ 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

@davidorme davidorme left a comment

Choose a reason for hiding this comment

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

Yup - looks cleaner

@jacobcook1995 jacobcook1995 merged commit 3c5979a into develop Nov 14, 2025
13 checks passed
@jacobcook1995 jacobcook1995 deleted the 1146-soiluptake-module-still-emits-divide-by-zero-warning-for-cases-that-are-handled branch November 14, 2025 11:46
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.

soil.uptake module still emits divide by zero warning for cases that are handled

3 participants