-
Notifications
You must be signed in to change notification settings - Fork 5
align/concat/combine_nested implementation #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Aha, here's a concrete feature request This index is shared between dims So I cannot do
because I get
So I cannot do
Then the alignment does not exclude Q: If asked to concat along a dim with a multi-dim index, then should we exclude all of those dims? Using combine_nested seems promising, perhaps that is the solution
|
Nope,
I don't see any other option at the moment. especially if we want |
It might be worth trying, although I don't know much what implications this rule would have in the general case. Or maybe trying to fit this case into From a UX perspective, however, the alignment error above while technically correct does not give a chance of providing more context. We should probably give this chance, e.g., via some dedicated Xarray Index API (the alignment error is raised from a loop iterating over index objects). |
OK this should be good to go! |
self._shape = { | ||
"x": self._wrapped_indexes["x"].axis_transform.size, | ||
"y": self._wrapped_indexes["y"].axis_transform.size, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid hard-coding "x" and "y" coordinate names.
We should also fix self._shape
for the following cases:
- There's only one wrapped index, either
AxisAffineTransformIndex
orPandasIndex
(e.g., result from indexing with a scalar on one of the raster dimensions) - There's two wrapped
PandasIndex
instances (e.g., result from indexing with arbitrary array values)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got this on the PR branch with docs 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm refactoring RasterIndex in #43. I think it will make our lives much easier... Supporting the cases above in RasterIndex was a (my) bad idea.
Closes #20
TODO:
@benbovy feel free to take over if you have time.
This is ugly BUT for the example in https://github.com/dcherian/rasterix/issues/16#issuecomment-2811585219
now gets as far as