Skip to content

test(sipnet): cover JSON segmentation and restart chaining - #4098

Merged
infotroph merged 3 commits into
PecanProject:developfrom
ANAMASGARD:test/4021-sipnet-segmented-restart
Sep 19, 2026
Merged

infotroph merged 3 commits into
PecanProject:developfrom
ANAMASGARD:test/4021-sipnet-segmented-restart

Conversation

@ANAMASGARD

Copy link
Copy Markdown
Contributor

Description

  • Added a regression test for segment_dataframe() using event_json when crop_changes is absent. Verify site filtering, segment dates and IDs, crop codes, and the initial PFT.
  • Verify restart assignments in generated sipnet.in files: the first segment has no RESTART_IN, each segment writes its own RESTART_OUT, and subsequent segments read the previous segment’s output.
  • Update SIPNET NEWS and the root changelog.

No production code or dependencies are changed.

Motivation and Context

Closes #4021.

Adds the two coverage improvements suggested during review of #4008, protecting JSON-based segmentation and the restart chain without requiring a SIPNET executable.

Validation

  • Focused segmented-config tests: 25 assertions passed.
  • Full SIPNET test suite: 132 assertions passed.
  • Package check with RUN_TESTS=TRUE: failed because existing tests use PEcAn.settings without declaring it as a test dependency. The same failure was reproduced on an unchanged baseline copy.
image ------ image

The package-check failure remains unresolved, so the overall test checklist below is left unchecked.

Review Time Estimate

  • When possible

Types of changes

Test coverage only; no runtime behavior changes.

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Check the license agreement yourself before submitting, and the citation checkbox only if your name is already listed.

Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>

@infotroph infotroph left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! This looks good except for one place I may have moved the ground under you -- can you confirm this test still behaves right after #4110?

Comment thread models/sipnet/tests/testthat/test-write_segmented_configs.R
@infotroph
infotroph added this pull request to the merge queue Sep 19, 2026
Merged via the queue into PecanProject:develop with commit 2caee58 Sep 19, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more tests of Sipnet segmented restart

2 participants