-
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
Discussion: how incremental addition/modification of elements and IO interact #186
Comments
LucaMarconato
changed the title
Discussion: how incremental addition/modification of elements and IO
Discussion: how incremental addition/modification of elements and IO interact
Mar 14, 2023
We also need functions to remove elements, not just in-memory but also on disk. |
In the end we went for the accessor option and we separated the phase of adding new elements in-memory and writing them to disk. |
Semi related, and might be of interest: Basically, making it easy to cache new elements to disk without modifying any existing on disk data. |
Thanks for sharing, very interesting! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is to collect points to discuss in major redesign of how IO interacts with the capabilities of extending an object by adding/removing or modifying particular elements. In other words, we need to decide how the user can modify/extend a
SpatialData
object after its constructor is called, and how this relates with IO.It evolves from previous discussions in this old issue #137 (and it's related PR #138).
I'll just dump all the points and reformat later on.
add_image(), add_labels()
sdata.images
or not, or if it is unique across all elements. This check is important, but currently it can be overridden by simply doingsdata.images['my_image'] = image
. We should decide on one of the following:.images
private and we removesdata.add_images('my_image', image)
. The user will not usesdata.images['my_image']
anymore, leaving only with the option to dosdata['my_image'] = image
, which internally usesget_schema()
to know whatimage
is..images
with an accessor class for which we override__set_item__()
and__get_item__()
, and we make these__set_item__()
calladd_image()
internally.The text was updated successfully, but these errors were encountered: