8000 Add example using a Zarr array by jakirkham · Pull Request #191 · napari/napari · GitHub
[go: up one dir, main page]

Skip to content

Add example using a Zarr array #191

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

Merged
merged 3 commits into from
Apr 2, 2019
Merged

Add example using a Zarr array #191

merged 3 commits into from
Apr 2, 2019

Conversation

jakirkham
Copy link
Contributor

Description

Creates a large Zarr array that is mostly zero except for a small square of 1's in the middle. Demonstrates how one might combine Dask and Zarr to move through larger data in the viewer.

Type of change

  • Bug-fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

References

How has this been tested?

  • example: the test suite for my feature covers cases x, y, and z
  • example: all tests pass with my change

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Contributor
@sofroniewn sofroniewn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jakirkham
Copy link
Contributor Author

As a note, this works reasonably fast using this in-memory dataset.

@sofroniewn and I looked at a dataset stored in Zarr on disk, but found it less responsive than desired. There are any number of potential reasons for that. It’s probably worth benchmarking to identify the exact cause.

@jni mentioned one cause may be the disk’s read speed, which could be significant here. Other issues may be performance issues in Zarr; however, these presumably would impact the in-memory case as well, but don’t seem to.

Besides benchmarking some other things to try would be using Zarr’s LRUStoreCache and/or using memory-mapping ( zarr-developers/zarr-python#377 ).

If there are still problems loading data quickly, would suggest engaging with the Zarr community. There’s a meta issue ( zarr-developers/zarr-python#382 ), which discusses and links to a number of potential improvements in the data loading process. This involves a few different caches at different stages for different purposes.

@jni jni merged commit df1a963 into napari:master Apr 2, 2019
@jni
Copy link
Member
jni commented Apr 3, 2019

More side notes:

Thanks for the links to the community, @jakirkham!

@sofroniewn
Copy link
Contributor

@jni @jakirkham I'm making great progress with the on-disk zarr example. Unsurprisingly it is all about finding the right chunk size and making sure the chunking dimensions align with our slicing dimensions. Any order of the dimensions is fine, but things just have to match up.

I havn't had to make any changes to the code apart from adding an optional clim_range argument so as to avoid the min / max calls.

It's very exciting! Thanks again @jakirkham for your help - this would have taken A LOT longer for me to figure out without your help

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

Successfully merging this pull request may close these issues.

3 participants
0