Skip to content

Conversation

@danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Nov 25, 2025

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Name of contributors Added to AUTHORS.rst
  • Description in RELEASE_NOTES.md Added

Description of PR

PR #937 added safeguards against inf-values in timeseries data, but this can lead to errors when using the IamDataFrame.divide() method. This PR raises an error when diving by a scalar and drops the offending rows (and prints to log) if dividing the data along an axis.

@danielhuppmann danielhuppmann self-assigned this Nov 25, 2025
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.9%. Comparing base (4b60586) to head (ff71b9d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #943   +/-   ##
=====================================
  Coverage   94.8%   94.9%           
=====================================
  Files         68      68           
  Lines       6474    6504   +30     
=====================================
+ Hits        6143    6173   +30     
  Misses       331     331           

☔ 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.

@danielhuppmann
Copy link
Member Author

Also added some refactoring to avoid importing internal methods to remove some formatting-warnings.

Copy link
Contributor

@phackstock phackstock left a comment

Choose a reason for hiding this comment

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

Looks good to me in principle. As detailed below, I think the two explicit zero checks outside of the series are a bit overkill as you'd get the division by zero error anyway.

Copy link
Contributor

@phackstock phackstock left a comment

Choose a reason for hiding this comment

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

Good to be merged from my side.

@danielhuppmann danielhuppmann merged commit 1ac9541 into IAMconsortium:main Nov 26, 2025
17 checks passed
@danielhuppmann danielhuppmann deleted the quickfix/divide-inf branch November 26, 2025 11:01
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.

2 participants