saalfeldlab / n5

Not HDF5
BSD 2-Clause "Simplified" License
158 stars 22 forks source link

Store String Used to Create N5 Reader/Writer #84

Closed cmhulbert closed 10 months ago

cmhulbert commented 2 years ago

Currently, there is no consistent way across N5Reader/Writers to query what source was used to open the container. It would be convenient if the N5 API stored the URL used to create the instance, and exposed via an API call, e.g. getUrl().

bogovicj commented 1 year ago

This is in progress here: https://github.com/saalfeldlab/n5/tree/wip/KeyValueInterface wherein we added a getBasePath to the N5Reader api https://github.com/saalfeldlab/n5/commit/607233c38b8b263042908d9a0fd8679c495e830f

While working on the AWS backend, @tpietzsch added:

@cmhulbert and I like these. It inspired these ideas:

cmhulbert commented 1 year ago

I'd also consider having the URI methods actually return the URI object, instead of the string

tpietzsch commented 1 year ago

These ideas sound all good to me.

bogovicj commented 1 year ago

in progress: https://github.com/saalfeldlab/n5/tree/wip/basePath2Uri

bogovicj commented 1 year ago

This commit adds a test for the behavior of N5Reader.getURI and (indirectly) KeyValueAccess.uri . and ensures that FileSystemKeyValueAccess behaves as desired. Do we agree about the expected behavior though?

bogovicj commented 10 months ago

N5Readers now provide a getURI that serves this purpose.