Repository navigation
fix: preserve explicitly provided zero carbon intensity - #1441
Open
nawaaaaaAaar wants to merge 2 commits into
Open
nawaaaaaAaar wants to merge 2 commits into
nawaaaaaAaar wants to merge 2 commits into
Conversation
This was referenced Oct 5, 2026
davidberenstein1957
approved these changes
Oct 9, 2026
davidberenstein1957
left a comment
Collaborator
There was a problem hiding this comment.
Correct fix: a zero source factor is a value, not a missing one, so is not None is the right test in both places in core/emissions.py. total_TWh still resolves to None and is skipped, so nothing else changes. Tests included. Fixes #1440.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1441 +/- ##
==========================================
+ Coverage 92.07% 92.30% +0.23%
==========================================
Files 49 49
Lines 5199 5199
==========================================
+ Hits 4787 4799 +12
+ Misses 412 400 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1440.
Treat a numeric zero carbon-intensity value as a provided factor, not as missing data. This applies both to direct country intensity and to zero-valued source factors when accounting for covered generation.
No shipped factor values, accounting definitions, or fallback behavior for genuinely missing source factors are changed.
Verification on Python 3.12.13:
Zero-valued source factors are tested with a controlled factor-table fixture. The package test scope excludes visualization and API/dashboard integration; it is not a scientific validation of alternative factor tables.
AI disclosure: autonomously implemented and tested using Perplexity Computer (GPT-6.1). No human review is claimed.
Combined with #1439 and #1443: 695 passed, two skipped, three integration cases deselected and twelve subtests passed. PR is open and ready for review; hosted verification workflows require maintainer approval. A successful PR-size labeler is not a hosted test pass.