Skip to content
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 tests with ":" indexing #40

Closed
keller-mark opened this issue Aug 18, 2023 · 4 comments
Closed

Add tests with ":" indexing #40

keller-mark opened this issue Aug 18, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@keller-mark
Copy link
Owner

No description provided.

@keller-mark keller-mark added the enhancement New feature or request label Aug 18, 2023
@dblodgett-usgs
Copy link
Collaborator

I just implemented a test that I think addresses this -- but I'm not sure I know exactly what you mean by ":" indexing.

Is this what you are getting at?

test_that("Zarr Array can be accessed with ", {
  g <- zarr_volcano()
  
  a <- g$get_item("volcano")
  
  sub <- a[1:10,1]
  
  expect_equal(class(sub), c("NestedArray", "R6"))
  expect_equal(dim(sub$as.array()), 10, 1)
})

dblodgett-usgs added a commit to dblodgett-usgs/pizzarr that referenced this issue Jun 1, 2024
@keller-mark
Copy link
Owner Author

I had meant using the string literal ":" in the selection list to achieve the equivalent behavior of Numpy like

a = np.zeros((4,5,6))
b = a[1:2,:,0:3]

Where the middle : without a start or end selects all 5 items along the middle axis.

This would be in contrast to the behavior of the string "..." which we use to select along all of the remaining array dimensions.

@dblodgett-usgs
Copy link
Collaborator

I see -- I knew I was missing something. My Python isn't super strong. I'm working through a few things related to this and will see if I can write up some testing.

dblodgett-usgs added a commit to dblodgett-usgs/pizzarr that referenced this issue Jun 3, 2024
@keller-mark
Copy link
Owner Author

Fixed in #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants