Fix summary_id set to -1 for wheatsheaf mean outputs#407
Open
benhayes21 wants to merge 1 commit intodevelopfrom
Open
Fix summary_id set to -1 for wheatsheaf mean outputs#407benhayes21 wants to merge 1 commit intodevelopfrom
benhayes21 wants to merge 1 commit intodevelopfrom
Conversation
Guard against sentinel value -1 propagating as summary_id in the indexed path when the summary index file is empty or contains no processable data. Skip unpopulated mean_count entries in WriteWheatsheafMean to prevent writing rows with zero return period and loss when all insured losses are zero. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Fixes #399 — when all insured losses are zero, wheatsheaf mean EP outputs (
wheatsheaf_mean_aep/oep) incorrectly contain rows withsummary_id = -1instead of producing empty output like other report types.leccalc.cpp: Guard the post-loopoutputaggreportscall withif (last_summary_id != -1)to prevent the sentinel value from propagating when the summary index file is empty or has no processable dataaggreports.cpp: Skipmean_countentries wherecount == 0inWriteWheatsheafMean, preventing pre-populated but never-filled entries from producing rows withretperiod=0.0andloss=0.0Test plan
summary_id = -1rows) when all insured losses are zero🤖 Generated with Claude Code