[c++,python] Fix default reads on unwritten dense arrays #3136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue and/or context:
Found issue while working on spatial's
MultiscaleImage
and erroring out when applyingread_spatial_region
to a level that had not been written to yet.Changes:
non_empty_domain_slot_opt
alongsidenon_empty_domain_slot
that returnsstd::nullopt
if it is empty rather than (0, 0)ManagedQuery::setup_read
to check if the array has been written to yet. If it hasn't, set the subarray to use soma_dim_0's full domain. Otherwise, use the non-empty domain as beforeDenseNDArray.read
to use the newnon_empty_domain_slot_opt
and correctly set thedata_shape
to the full domain if the array has not been written to yet