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

zarr list directory shows . and trailing / handling #6336

Closed
jstriebel opened this issue Jul 14, 2022 · 0 comments · Fixed by #6359
Closed

zarr list directory shows . and trailing / handling #6336

jstriebel opened this issue Jul 14, 2022 · 0 comments · Fixed by #6359

Comments

@jstriebel
Copy link
Contributor

jstriebel commented Jul 14, 2022

Context

The following wk-libs script recurses infinitely, since walking the zarr directories has an infinite loop:

import webknossos as wk
wk.Dataset.open_remote("https://webknossos.org/datasets/scalable_minds/l4_sample_dev").upload("l4_sample_dev_copy20")

This is the start of the debug output, when adding print(path) to _walk() in _upload_dataset.py:

https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev
https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev/.
https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev/./.
https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev/././.
https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev/./././.
…

When visiting the respective sites, the listed folders and respective links seem to be off:
https://data-humerus.webknossos.org/data/zarr/scalable_minds/skin/

  • skin: . leads to the same page (but probably should not be listed)
  • color: skin/color leads to /data/zarr/scalable_minds/skin/skin/color, which is not valid

https://data-humerus.webknossos.org/data/zarr/scalable_minds/skin

  • skin: . leads to the parent folder
  • color: skin/color works

Expected Behavior

. should not be listed. Less important but nice to have: The human readable pages should have working links (probably simply color, and not color: skin/color). If a certain format is expected (trailing slash or not), there should be redirects to it.

Current Behavior

. is listed for folders of zarr routes:

>>> from upath import UPath
>>> list(UPath("https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev").iterdir())
[HTTPPath('https://data-humerus.webknossos.org/data/zarr/scalable_minds/l4_sample_dev/.')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant