Skip to content

[#421] Fix missed event detection across year boundaries - #428

Open
ANAMASGARD wants to merge 2 commits into
PecanProject:masterfrom
ANAMASGARD:421-fix-missed-events-year-boundary
Open

ANAMASGARD wants to merge 2 commits into
PecanProject:masterfrom
ANAMASGARD:421-fix-missed-events-year-boundary

Conversation

@ANAMASGARD

Copy link
Copy Markdown
Contributor

Summary

  • What: Compare complete (year, day) dates in carbon processing, nitrogen processing, and event output using a shared helper.
  • Motivation: A missed event from a previous year could silently block later events while SIPNET returned success. It now triggers the existing missing-climate error immediately, with exit code 5.

Valid event schedules and output formats remain unchanged. New tests are in tests/sipnet/test_events_infrastructure, as requested.

How was this change tested?

  • Confirmed the new regression fails before the fix and passes afterward.
  • Tested overdue events across years, same-year misses, future events, valid rollover schedules, repeated climate dates, and empty queues, including nitrogen processing.
  • Verified the CLI reproducer exits 5; removing the missed event allows the later tillage to run with exit 0.
  • Clean build, make test (29 unit executables passed), and make testrun passed.
  • Smoke tests: four executed passes and one existing forced pass. No output fixtures changed.
  • LLVM 19 clang-format, clang-tidy, and git diff --check passed.

Reproduction steps

Run the reproducer in #421, which uses:

  • Climate dates: 2016/100, then 2017/10.
  • Tillage events: 2016/200, then 2017/10.

Before: Exit 0, with neither event written to events.out.

After: Exit 5, reporting that event 2016/200 has no matching climate record when climate reaches 2017/10.

Related issues

Checklist

  • Related approved issue is listed above and assigned by a maintainer.
  • PR title includes the issue number.
  • Regression tests added.
  • Documentation updated (not applicable; existing documentation already specifies this behavior).
  • docs/CHANGELOG.md updated.
  • Code formatted with clang-format.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Alomir

Alomir commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@ANAMASGARD Please resolve the branch conflicts for this PR, and bring it back to ready-for review. Thanks!

@ANAMASGARD

Copy link
Copy Markdown
Contributor Author

@Alomir can you please re review it i have resolved the conflict . Thanks

This branch has not been deployed

No deployments
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.

Missed event across a year boundary silently blocks later events

3 participants