Skip to content

Refactor matching functionality to a separate module and add more functionality#228

Merged
ph-kev merged 7 commits intomainfrom
kp/checks
Oct 1, 2025
Merged

Refactor matching functionality to a separate module and add more functionality#228
ph-kev merged 7 commits intomainfrom
kp/checks

Conversation

@ph-kev
Copy link
Member

@ph-kev ph-kev commented Sep 19, 2025

This PR refactors the matching of OutputVar to metadata to another module and add more functionality such as a verbose option and other Matcher that would be helpful.

TODO

  • Add documentation about checkers
  • Add an option to pass your own checkers when filling the G ensemble matrix

@ph-kev ph-kev force-pushed the kp/checks branch 7 times, most recently from 1dbbacd to 65d7001 Compare September 23, 2025 18:10
@ph-kev
Copy link
Member Author

ph-kev commented Sep 23, 2025

This PR is not ready to be merged in, but I would like a review before working on it anymore.

The only checker that should be provided, but is not in this PR is checking the signs between simulation data and observational data. I think that functionality though should belong in another PR.

@ph-kev ph-kev marked this pull request as ready for review September 23, 2025 23:26
@ph-kev ph-kev force-pushed the kp/checks branch 3 times, most recently from 4ebc739 to 858f1b6 Compare September 25, 2025 17:40
Copy link
Member

@nefrathenrici nefrathenrici left a comment

Choose a reason for hiding this comment

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

Thank you! I like that this is easily extensible.

ext/checkers.jl Outdated
obs_dates = ClimaAnalysis.dates(metadata)
sim_dates = ClimaAnalysis.dates(var)
for dates in (obs_dates, sim_dates)
allunique(dates) || error("Dates in $dates are not unique")
Copy link
Member

Choose a reason for hiding this comment

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

Should this throw an error? I think this could just warn and return false.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should throw an error, because there shouldn't be duplicate dates.

I can remove this though, since this is checked in _match_dates.

Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to remove it. I think it should be moved to another checker or enforced everywhere, since it does not make sense to have duplicate dates.

@ph-kev ph-kev force-pushed the kp/checks branch 3 times, most recently from e479a09 to 0309982 Compare September 29, 2025 18:05
@ph-kev
Copy link
Member Author

ph-kev commented Sep 29, 2025

I added documentation since the last review.

@ph-kev ph-kev merged commit 3194b44 into main Oct 1, 2025
7 of 9 checks passed
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.

2 participants