Add Var.are_compatible for FlatVar and Metadata#409
Conversation
8217db3 to
699bfa3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
=======================================
Coverage 99.49% 99.50%
=======================================
Files 19 19
Lines 2181 2201 +20
=======================================
+ Hits 2170 2190 +20
Misses 11 11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nefrathenrici
left a comment
There was a problem hiding this comment.
This looks good. I'm a bit confused about how ignore_dims is meant to be used, since there are three checks and it only blocks one. For example, if vars differ in the flatten order or the drop mask, arecompatible will return false even though the specific dimension has been "ignored". The docstring is precisely worded, but it would be good to add a single line that differing flatten orders or drop masks will make the vars incompatible.
I am confused on what three checks you are referring to. One way of thinking about what it means for two |
699bfa3 to
061b023
Compare
Ok, thanks for the explanation, the behavior makes sense. The three checks I meant are: flatten order, per-dimension coordinate values + units, and the drop mask. A differing flatten order or drop mask would make the vars incompatible so we shouldn't ignore them. |
061b023 to
471b642
Compare
|
Note that this PR haven't been merged since CliMA/ClimaCalibrate.jl#334 isn't merged in. Once that PR is ready to be merged, this PR can be merged in. |
This functionality is needed in ClimaCalibrate for comparing two different
FlatVarorMetadataand determining whether they are compatible on physical space and the values dropped are on the same coordinates. The functionarecompatibleforFlatVarandMetadatais needed to avoid accessingdrop_maskfrom theMetadatawhich is internal to ClimaAnalysis.