Skip to content

Fix summary_id set to -1 for wheatsheaf mean outputs#407

Open
benhayes21 wants to merge 1 commit intodevelopfrom
fix/399-summary-id-incorrect-for-wheatsheaf-mean
Open

Fix summary_id set to -1 for wheatsheaf mean outputs#407
benhayes21 wants to merge 1 commit intodevelopfrom
fix/399-summary-id-incorrect-for-wheatsheaf-mean

Conversation

@benhayes21
Copy link
Contributor

Summary

Fixes #399 — when all insured losses are zero, wheatsheaf mean EP outputs (wheatsheaf_mean_aep/oep) incorrectly contain rows with summary_id = -1 instead of producing empty output like other report types.

  • leccalc.cpp: Guard the post-loop outputaggreports call with if (last_summary_id != -1) to prevent the sentinel value from propagating when the summary index file is empty or has no processable data
  • aggreports.cpp: Skip mean_count entries where count == 0 in WriteWheatsheafMean, preventing pre-populated but never-filled entries from producing rows with retperiod=0.0 and loss=0.0

Test plan

  • Build and run existing leccalc tests
  • Verify wheatsheaf mean AEP/OEP outputs are empty (not summary_id = -1 rows) when all insured losses are zero
  • Verify normal (non-zero loss) wheatsheaf mean outputs are unaffected

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

summary_id is incorrectly set to -1 for wheatsheaf mean outputs if no losses

1 participant

Comments