Closed dblodgett-usgs closed 5 months ago
Here's a social media sized logo to add to the repository in settings @keller-mark
Been doing a whole bunch of testing and investigation of the array and nested array internals. I uncovered a handful of bugs in the process.
is_scalar()
to be what I think you mean it to be?!? JKLOL -- I need to learn more about the use of jsonlite::unbox and the scalar class.Open questions in test-nested-array.R:
# Should this be the case?!?
expect_error(a[1:10, 1:20]$set("...", new_vals),
"selection must be a list of slices")
a[1:10, 1:20]$set(list(slice(1,10), slice(1,20)), new_vals)
# it does not update the original array -- should it?
expect_equal(a[1:10, 1:20]$as.array(),
vals)
This latest commit gets the tests passing, but the handling of is_scalar vs is_integer is maybe not 100% -- very much worth a review on those details.
With my latest commits, I see no errors, no warnings, and one note in check. The note is the dog.ome.zarr size issue noted in #87.
Should the set method of NestedArray support integer and "..."/":" indexing? Should the set method of NestedArray update the parent array ?
Good point, this could get confusing, especially when using the bracket access notation on the ZarrArray since it may be less obvious that what you get back is a NestedArray. We could check how the analogous pattern in Python behaves and then follow that. Alternatively, maybe we need a mechanism for the user to opt-in or opt-out of updating the parent (might be useful/needed in cases where the Store is read-only). Another option may be to try to get away from the NestedArray
by returning plain array
s in more cases.
the handling of is_scalar vs is_integer is maybe not 100%
Good point, these and is_integer_vec
should to be renamed to be more clear what they are doing. I will do that and add some more comments/tests. Luckily I think they only need to be used in a handful of cases.
Likely some other checks, I'll comment in #18 with what I checked so far.