-
Notifications
You must be signed in to change notification settings - Fork 6
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
Code separation for storage location and storage format #10
Comments
@axtimwalde and I talked about this recently. This would involve big changes, and so won't happen soon, but I agree its desirable and should be on the roadmap. |
@bogovicj : do you have any idea of a workaround? Our hope was to be able to access IDR data in OME-Zarr on S3 via the N5 stack for I2K? (Wow. The acronyms abound!) My best guess would be to make a copy/fork of n5-aws-s3, add a dependency on n5-zarr, and migrate the N5ZarrReader use of DType etc. into https://github.com/saalfeldlab/n5-aws-s3/blob/master/src/main/java/org/janelia/saalfeldlab/n5/s3/N5AmazonS3Reader.java (or a subclass). |
😂
Either that or the reverse - fork n5-zarr and depend on n5-aws-s3. Not sure which would be less work in the end... Were I to try to hack something together quickly, I think I might start with |
Gotcha. The only other suggestion that has also been discussed on the Zarr side (zarr-developers/zarr-python#540) would be a wrapper strategy roughly of the form:
|
I think the most mature path forward is to introduce a separate interface for |
@axtimwalde : hmmm.... could you sketch out a bit of the inheritance hierarchy that you'd see? Or is the design of that hierarchy part of the problem and therefore needs more time? Is there any short-term path forward that you wouldn't consider monsterous? |
As a short term hack, I would plug the AWS S3 access logic into a copy of n5-zarr as @bogovicj sugested, and add alternative readers and writers to the n5-zarr repo. It's not too much work and will be consistent with people using N5 through the |
…bclass Until there are interfaces, wrappers, or similar composable objects which allow having both S3 access and Zarr reading, the N5S3ZarrReader allows a client to explicitly choose the combination of both. This commit copies methods in order to having a working version of the reader. Future clean up includes extracting methods to a helper class, introducing abstract methods to reduce repeated code blocks, and similar. see: saalfeldlab/n5-aws-s3#10 (comment)
I've opened saalfeldlab/n5-zarr#5 as a draft. It's possible that this should never be merged and instead should exist in a separate branch and/or repository. |
Closing this issue now that |
@axtimwalde
@joshmoore and I were thinking whether it would be possible (and make sense) to separate the code in terms of storage location and storage format.
So for example, one could have something like
with, e.g.,
This would of course mainly make sense if one would manage within the
N5Reader
class to be able to mix and match the two things, thereby avoiding code duplication.Not sure I am making sense?
Maybe @joshmoore can formulate this more professionally?
The text was updated successfully, but these errors were encountered: