-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add transformations to polygons and points bounding box query #143
Conversation
@@ -206,7 +207,7 @@ def _(data: DaskDataFrame, transformation: BaseTransformation) -> DaskDataFrame: | |||
indices = xtransformed["dim"] == ax | |||
new_ax = xtransformed[:, indices].data.flatten() | |||
# mypy says that from_array is not a method of DaskDataFrame, but it is | |||
transformed[ax] = da.from_array(np.array(new_ax)) # type: ignore[attr-defined] | |||
transformed[ax] = dd.from_dask_array(da.from_array(np.array(new_ax))) # type: ignore[attr-defined] |
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 one is supposed to add a Series, not an array here.
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 changed this code, now it is fully lazy. I still use a dask array and not a series. I think it works both way, but if there will be performance problems or some other problems I will keep this in mind and maybe check again.
I have reviewed this code and made mainly two changes:
If you are ok with the changes, please merge the PR into |
Thanks @LucaMarconato ! I went ahead and merged to keep things moving forward. |
Hey @LucaMarconato . Here are the transforms added to the bounding box query for points and polygons. This gets the main infrastructure in. We can extend the tests for a few corner cases in a follow up PR.
A couple of notes:
I won't be able to work on this tomorrow, so please feel free to take the PR over and directly push to it!