-
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
[Possible bug] ContainsGroupError when trying to overwrite SpatialData object (overwriting a backed sdata/element) #137
Comments
Hi, thanks for reporting. The errors is due to the fact that when you save a More generally, for the same reason, this happens even when you want to add a single element to an existing This is shown in the following example. All works with Shapes (Polygons and Tables), but the equivalent code breaks with Points.
In the latest version from main (I suggest doing a develop install of the repo so that you can install the latest version by just pulling the repo (or changing branch)), the error that you got should not happen: you should get an exception before it happens.
But for |
In the near future we will allow the user to rewrite a backed object in-place. An implementation could be to write the new zarr group in a temporary directory and then do an atomic move of the new data to the original one. In this way we also prevent data loss if something goes wrong in between. For the moment, a quick and dirty workaround is to save the |
Actually I have fixed the bug your encountered and the one that I described, in this PR #138. I used the approach discussed above of writing to another location and then automatically moving the written data. All the test passes, please also check it if works. Thanks again for reporting this critical bug. |
Thanks for looking into it. I will check! |
I can confirm that on main no group error is given anymore and properly overwrites. I checked this by also given a different number of images when overwriting. If you are ok with it, this issue can be closed. |
As discussed in this PR: #138 we decided not to add the support for overwriting the data into the path that is used for backing. This holds true both for |
I am currently retrying writing tiled images and encounter a
ContainsGroupError
in version 0.0.1.dev0.Specifically running something similar to this twice with the first time no overwrite results in the error:
Is this expected behaviour?
The text was updated successfully, but these errors were encountered: