Fix year-range validation for start/end years (#306, #335)#458
Open
brianpm wants to merge 1 commit into
Open
Conversation
Validate user-supplied start_year/end_year against the discovered [found_syear, found_eyear] range instead of membership in a constructed collection, at all four sites (test/baseline x timeseries/history). - NCAR#306: the timeseries paths used np.arange(found_syear, found_eyear, 1), which is end-exclusive, so a config end_year equal to the last available year was wrongly rejected and silently overridden (shrinking the plotted span by one). Replaced with an inclusive range comparison and removed the now-unused found_yr_range. - NCAR#335: the history paths tested membership in case_climo_yrs/base_climo_yrs (the set of years parsed from filenames, one per file). When files span more than one year, an in-range year not literally named in a filename was wrongly rejected. Replaced with a range comparison against the found min/max years. Also corrected the baseline timeseries end-year warning ("first" -> "last"). The warn-and-override fallback is retained; it now fires only for genuinely out-of-range requests.
c26e8e9 to
9adbccb
Compare
nusbaume
approved these changes
Jun 26, 2026
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.
Validate user-supplied start_year/end_year against the discovered [found_syear, found_eyear] range instead of membership in a constructed collection, at all four sites (test/baseline x timeseries/history).
Also corrected the baseline timeseries end-year warning ("first" -> "last"). The warn-and-override fallback is retained; it now fires only for genuinely out-of-range requests.