Skip to content

Commit ded543c

Browse files
normanrzmarkbader
andauthored
Always store path in mags (#1290)
* wip * fixes * update cassettes * json * add test for relative paths * moar relative paths * upgrade pylibczirw * changelog * fix issue in setup_mag * Apply suggestions from code review Co-authored-by: Mark Bader <[email protected]> * wip * allow metadata-only editing of read-only layers * Update webknossos/Changelog.md * version 2 * static checks * no version 2 * wip * ./ * tests * frombuffer * tests * rename methods * changelog * tests * cassettes --------- Co-authored-by: Mark Bader <[email protected]>
1 parent f80136f commit ded543c

25 files changed

+3482
-12658
lines changed

webknossos/Changelog.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,27 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1313
[Commits](https://github.com/scalableminds/webknossos-libs/compare/v2.3.11...HEAD)
1414

1515
### Breaking Changes
16+
- `Dataset.shallow_copy_dataset` does not symlink layers, mags and attachments anymore. Instead mags and attachments are referenced by their path. [#1290](https://github.com/scalableminds/webknossos-libs/pull/1290)
17+
- Deprecated a number of methods [#1290](https://github.com/scalableminds/webknossos-libs/pull/1290):
18+
- `Dataset.add_symlink_layer`, use `Dataset.add_layer_as_ref` instead.
19+
- `Dataset.add_remote_layer`, use `Dataset.add_layer_as_ref` instead (renamed).
20+
- `Dataset.add_copy_layer`, use `Dataset.add_layer_as_copy` instead (renamed).
21+
- `Layer.add_symlink_mag`, use `Layer.add_mag_as_ref` instead.
22+
- `Layer.add_remote_mag`, use `Layer.add_mag_as_ref` instead (renamed).
23+
- `Layer.add_copy_mag`, use `Layer.add_mag_as_copy` instead (renamed).
24+
- `Attachments.add_symlink_attachments`, use `Attachments.add_attachment_as_ref` instead (note the singular form).
25+
- `Attachments.add_attachments`, use `Attachments.add_attachment_as_ref` instead (note the singular form).
26+
- `Attachments.add_copy_attachments`, use `Attachments.add_attachment_as_copy` instead (note the singular form).
27+
- `Dataset.add_layer` and `Dataset.add_layer_like` as well as derived methods do not eagerly create a folder for the layer anymore. Folders will be created, if necessary, when mags or attachments are added. [#1290](https://github.com/scalableminds/webknossos-libs/pull/1290)
28+
29+
1630

1731
### Added
1832

1933
### Changed
2034
- Changed the default path type to `UPath` [#1326](https://github.com/scalableminds/webknossos-libs/pull/1326)
35+
- All mags now store their path in the `datasource-properties.json` file. This eliminates the need for symlinks and removes the need to check multiple possible mag paths (e.g. 1-1-1 or 1). It also unifies local and remote mags. [#1290](https://github.com/scalableminds/webknossos-libs/pull/1290)
36+
- Dataset-local mags and attachments use the `./` prefix for their path in compliance with [IETF RFC1808](https://datatracker.ietf.org/doc/html/rfc1808). [#1290](https://github.com/scalableminds/webknossos-libs/pull/1290)
2137

2238
### Fixed
2339

@@ -61,7 +77,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
6177
[Commits](https://github.com/scalableminds/webknossos-libs/compare/v2.3.7...v2.3.8)
6278

6379
### Changed
64-
- Made the folder_id parameter of `Dataset.announce_manual_upload` optional. [#1313](https://github.com/scalableminds/webknossos-libs/pull/1313)
80+
- Made the `folder_id` parameter of `Dataset.announce_manual_upload` optional. [#1313](https://github.com/scalableminds/webknossos-libs/pull/1313)
6581

6682

6783
## [2.3.7](https://github.com/scalableminds/webknossos-libs/releases/tag/v2.3.7) - 2025-05-27

webknossos/testdata/simple_zarr3_dataset/datasource-properties.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"version": 1,
23
"id": {
34
"name": "simple_zarr_dataset",
45
"team": ""
@@ -18,7 +19,8 @@
1819
"dataFormat": "zarr3",
1920
"mags": [
2021
{
21-
"mag": [1, 1, 1]
22+
"mag": [1, 1, 1],
23+
"path": "./color/1"
2224
}
2325
],
2426
"numChannels": 3,

webknossos/testdata/tiff/datasource-properties.zarr-fixture.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"x": 1,
2929
"y": 2,
3030
"z": 3
31-
}
31+
},
32+
"path": "./tiff/1"
3233
}
3334
],
3435
"numChannels": 1,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http_interactions: []

webknossos/tests/cassettes/test_dataset_add_remote_mag_and_layer/test_add_remote_layer_from_path.yml

Lines changed: 0 additions & 3055 deletions
This file was deleted.

webknossos/tests/cassettes/test_dataset_add_remote_mag_and_layer/test_add_remote_mags_from_mag_view.yml

Lines changed: 91 additions & 861 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_dataset_add_remote_mag_and_layer/test_add_remote_mags_from_path.yml

Lines changed: 293 additions & 5563 deletions
Large diffs are not rendered by default.

webknossos/tests/cassettes/test_dataset_add_remote_mag_and_layer/test_ref_layer_from_object.yml

Lines changed: 983 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 293 additions & 561 deletions
Large diffs are not rendered by default.
Lines changed: 381 additions & 971 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)