Enable individual indexing for merged lookups#980
Conversation
|
Had a thought: what happens if e.g. X and and Y are in the regular dimensions, and also in the merged dimensions |
|
In the current implementation the merged dimensions are ignored, because X and Y don't make it out of otherdims We could in theory duplicate those. But it seems fragile and pretty ambiguous if your array is already fully specified. |
|
Yeah, Its probably best. I just wondered about the behaviour where there are two merged dims and X/Y working on both of them, but not if there is also regular X/Y. That may be slightly confusing. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #980 +/- ##
==========================================
- Coverage 83.44% 75.81% -7.64%
==========================================
Files 54 54
Lines 5154 5168 +14
==========================================
- Hits 4301 3918 -383
- Misses 853 1250 +397 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think the MergedLookup docstring need indexing examples so this isn't hidden |
|
ok, all relevant tests are passing. no clue why plots is failing though..are you using some strange backend? |
|
It's just GR. We can ignore it for now |
|
previously threw an error, with this PR it just works
What this does is that it introduces a new AbstractMergedLookup supertype that requires that the lookup have dims. this way we can find all lookups that might be secretly multidimensional (currently just merged lookup and geometry lookup) and pass all matching dims into them directly. That gets us back a vector index like thing that we can replace the placeholder Colon with that we receive from the split_dims.
This enables geometry lookups in Rasters to work like this as well, and also selecting by extents, crop, etc.
This isn't actually breaking in any way so can be merged for a non breaking release, I think.
Needs tests and benchmarks to check that this does not impact the getindex time, ie it should just compile away