Skip to content

SIP80/SIP83 Remove multi-site support#92

Merged
Alomir merged 21 commits into
masterfrom
SIP80_Remove_multi_location_support
Jun 18, 2025
Merged

SIP80/SIP83 Remove multi-site support#92
Alomir merged 21 commits into
masterfrom
SIP80_Remove_multi_location_support

Conversation

@Alomir
Copy link
Copy Markdown
Collaborator

@Alomir Alomir commented Jun 6, 2025

#80
#83

This PR:

  • Removes multi-site support from SIPNET
    • Removed location from all places
    • Maintains compatibility with existing *.param files; the location column is ignored for those files
    • Simplifies "spatial" params
  • For new param structures, removed obsolete members related to senstest/estimate parameters
    • Compatibility maintained here as well, extra columns are ignored
  • Updates existing tests
  • Adds new tests for reading old (and new) .clim and .param files

Note: I replaced spatialParams.h|c with modelParams.h|c (via git mv), but it appears here like a deletion and creation.

  • This is not necessarily bad, as it may be easier to review modelParams on its own
  • I am not at all locked into the name modelParams if anyone wants to suggest something else

@Alomir Alomir changed the title SIP80 Remove multi-site support SIP80/SIP83 Remove multi-site support Jun 6, 2025
@Alomir Alomir requested review from dlebauer and infotroph and removed request for dlebauer June 6, 2025 21:48
@Alomir Alomir marked this pull request as ready for review June 6, 2025 21:48
Copy link
Copy Markdown
Member

@dlebauer dlebauer left a comment

Choose a reason for hiding this comment

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

I really appreciate your thorough use of validation, checks for exceptions, use of tests, and maintaining backwards compatibility! A am impressed that you can keep all of this logic in your while dissecting and excising this code.

  • I am not sure if this was intentionally in this PR vs #96, but I think that it is safe to remove the moisture_bwb and moisture_pm functions (that were commented out in this PR). When removing functionality like this I'd just make it clear in the changelog when and why it was done to help facilitate discovery and resurrection in the future for anyone so motivated.
  • We discussed deprecating src/utilities/subsetData.c in which case this is just one more reason to do so - although the utility only works for files with one location, it expects there to be a location column and then confirms that there is only one location.
  • As suggested on Slack I only skimmed the tests to make sure they make sense!

@@ -0,0 +1,114 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Sipnet parameter files
!!! Modified from the original version by Bill Sacks (wsacks@wisc.edu)
Copy link
Copy Markdown
Member

@dlebauer dlebauer Jun 12, 2025

Choose a reason for hiding this comment

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

Is there or should there be a standard set of 'reference' input files (e.g. that we can link to in docs?) I like the idea of such files being used in tests (like this one) to make sure they are up to date.

Also:

Suggested change
!!! Modified from the original version by Bill Sacks (wsacks@wisc.edu)
!!! Modified from Bill's version by Mike Longfritz (@Alomir)
!!! Modified from the original version by Bill Sacks (wsacks@wisc.edu)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I like this idea! I'd go so far as to suggest a /tests/sipnet/reference_inputs directory for them (or some such) - a central place for a suite of input files. I think this would be best as a separate ticket?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Created issue #102 for this (I put it in with the more general unit test revamp that's needed once this PR gets in)

Comment thread tools/trim_first_chars
Comment thread src/sipnet/events.c Outdated
Comment thread src/common/util.c
Comment thread src/sipnet/sipnet.in Outdated

LOCATION = 0
! Location to run at (-1 means run at all locations)
! LOCATION is obsolete; this value is ignored
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.

? is this correct?

Suggested change
! LOCATION is obsolete; this value is ignored
! LOCATION is obsolete and this value is ignored; maintained for backward compatibility

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually, I think this should just get deleted (both here and in /tests/smoke/sipnet.in)

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.

Works for me!

Comment thread src/sipnet/sipnet.in
Co-authored-by: David LeBauer <dlebauer@gmail.com>
@Alomir
Copy link
Copy Markdown
Collaborator Author

Alomir commented Jun 13, 2025

  • I am not sure if this was intentionally in this PR vs SIP78 Convert switches to run time options #96, but I think that it is safe to remove the moisture_bwb and moisture_pm functions (that were commented out in this PR). When removing functionality like this I'd just make it clear in the changelog when and why it was done to help facilitate discovery and resurrection in the future for anyone so motivated.

I meant to un-comment those out before committing - I was only checking here that they actually were not needed. I'd like to restore them here, and let them get dealt with more appropriately in that other ticket

  • We discussed deprecating src/utilities/subsetData.c in which case this is just one more reason to do so - although the utility only works for files with one location, it expects there to be a location column and then confirms that there is only one location.

Agreed. If no GSOC person picks that ticket up, I'm likely to do it soon so it stops nagging at me :-)

  • As suggested on Slack I only skimmed the tests to make sure they make sense!
    👍

@Alomir Alomir requested a review from dlebauer June 13, 2025 20:20
@Alomir Alomir merged commit ed448dc into master Jun 18, 2025
7 checks passed
@Alomir Alomir deleted the SIP80_Remove_multi_location_support branch June 18, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants