Add timerange constraint#399
Merged
bouweandela merged 2 commits intoClimate-REF:mainfrom Sep 17, 2025
Merged
Conversation
4ecd71e to
5e009cf
Compare
5e009cf to
6b30569
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
bouweandela
commented
Sep 15, 2025
Comment on lines
+59
to
+60
| for dataset in datasets: | ||
| dataset["timerange"] = "1996/2014" |
lewisjared
approved these changes
Sep 16, 2025
|
|
||
|
|
||
| @frozen | ||
| @total_ordering |
Contributor
There was a problem hiding this comment.
I didn't know about this. Useful
| def __repr__(self) -> str: | ||
| return f"{self.__class__.__name__}({', '.join(f'{a}={v}' for a, v in self._attrs.items())})" | ||
|
|
||
| def __eq__(self, other: object) -> bool: |
Contributor
There was a problem hiding this comment.
Should we type hint that other should only be a `datetime.datetime?
Contributor
Author
There was a problem hiding this comment.
| Only the specified fields are used for comparison. | ||
| """ | ||
|
|
||
| year: int | None = None |
Contributor
There was a problem hiding this comment.
Suggested change
| year: int | None = None | |
| year: int |
Should year be required? Is there a use case where you would skip fields, i.e. only specifying months?
Contributor
Author
There was a problem hiding this comment.
Yes, e.g selecting a season. Though the current implementation of the continuity check isn't smart enough for that.
lewisjared
approved these changes
Sep 16, 2025
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.
Description
Add a timerange constraint. This will ensure the required data is available before attempting to run a diagnostic.
Requires #402
Checklist
Please confirm that this pull request has done the following:
changelog/