-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use zarrita #168
Merged
Merged
Use zarrita #168
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toloudis
reviewed
Nov 22, 2023
src/loaders/OmeZarrLoader.ts
Outdated
@@ -213,8 +184,8 @@ function pickLevelToLoad(loadSpec: LoadSpec, spatialDimsZYX: [number, number, nu | |||
return Math.max(optimalLevel, loadSpec.multiscaleLevel ?? 0); | |||
} | |||
|
|||
function convertChannel(channelData: TypedArray, dtype: string): Uint8Array { | |||
if (dtype === "|u1") { | |||
function convertChannel(channelData: zarr.TypedArray<"uint8" | "uint16">): Uint8Array { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this work with more types.
toloudis
reviewed
Nov 22, 2023
src/loaders/OmeZarrLoader.ts
Outdated
// TODO: fix "could not find a declaration file for module 'zarrita'." It has a .d.ts, so why isn't it being found? | ||
// For now, I pinkie swear I'm using its types right | ||
import * as zarr from "zarrita"; | ||
import { AbsolutePath, AsyncReadable, Readable } from "@zarrita/storage/dist/src/types"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there's any way to make TS happier that would be good
toloudis
approved these changes
Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Zarrita.js is a slightly more modular zarr library which works in a similar way to zarr.js, but fixes a number of problems we've been facing with the current library:
Store
(calledReadable
), which solves a huge problem we've been facing with tracking prefetch requestsThis PR switches us from zarr to zarrita. Remarkably little actually changes about how we interact with the library. The biggest change is converting the store wrapper from an instance of
Store
, which requires lots of methods that look like interacting with a filesystem, to an instance ofReadable
, which requires only one method:get
.