Skip to content

Commit 0efedee

Browse files
markbadernormanrz
andauthored
Support renameable datasets and WK API v9 (#1231)
* Start implementing support for renameable datasets. * WIP support deprecated urls and open_remote_dataset requests. * Fix issues and update test cassettes. * Update changelog and fix remaining tests. * WIP adapt parsing remote dataset urls. * Fix regex for new dataset urls. * Remove comments and reformat timestamp. * Update webknossos/Changelog.md Co-authored-by: Norman Rzepka <[email protected]> --------- Co-authored-by: Norman Rzepka <[email protected]>
1 parent 07be3c0 commit 0efedee

File tree

47 files changed

+3831
-1907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3831
-1907
lines changed

webknossos/Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1313
[Commits](https://github.com/scalableminds/webknossos-libs/compare/v0.16.2...HEAD)
1414

1515
### Breaking Changes
16+
- `RemoteDataset.display_name` is deprecated. To change the name of a dataset use the `name` property instead.
17+
- `Dataset.get_remote_datasets()` returns a mapping. The keys of this mapping changed from datasets name to datasets id.
18+
- `Task.create()` needs a `dataset_id` now instead of a `dataset_name`. Alternativly a `RemoteDataset` object can be used. The `dataset_name` is marked as deprecated. As `dataset_name` is an optional argument now its position has changed, this is important if `create()` is called only with positional arguments.
1619

1720
### Added
21+
- `Dataset` method `get_remote_datasets()` accepts `name` and `folder_id` as arguments now to filter remote datasets.
22+
- `RemoteDataset` got an additional property: `created`.
23+
- `Annotation` got an additional property: `dataset_id`.
1824

1925
### Changed
26+
- Updated to WEBKNOSSOS API version 9. This includes support for the new url structure for datasets and [#1231](https://github.com/scalableminds/webknossos-libs/pull/1231)
2027

2128
### Fixed
2229
- Fixed Mag setup for non-public datasets. [#1222](https://github.com/scalableminds/webknossos-libs/pull/1222)

webknossos/tests/cassettes/test_annotation/test_annotation_upload_download_roundtrip.yml

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

webknossos/tests/cassettes/test_annotation/test_bounding_box_roundtrip.yml

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

webknossos/tests/cassettes/test_api_client/test_annotation_info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ http_interactions:
22
- request:
33
method: GET
44
path: >-
5-
/api/v8/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1734529349000
5+
/api/v9/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1736433032000
66
headers:
77
host: localhost:9000
88
accept: '*/*'
@@ -22,7 +22,7 @@ http_interactions:
2222
cache-control: no-cache
2323
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2424
x-permitted-cross-domain-policies: master-only
25-
date: Wed, 18 Dec 2024 13:42:29 GMT
25+
date: Thu, 09 Jan 2025 14:30:32 GMT
2626
content-type: application/json
2727
content-length: '1929'
2828
body:

webknossos/tests/cassettes/test_api_client/test_build_info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v8/buildinfo
4+
path: /api/v9/buildinfo
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -22,7 +22,7 @@ http_interactions:
2222
access-control-max-age: '600'
2323
access-control-allow-origin: '*'
2424
x-permitted-cross-domain-policies: master-only
25-
date: Wed, 18 Dec 2024 13:42:30 GMT
25+
date: Thu, 09 Jan 2025 14:30:33 GMT
2626
content-type: application/json
2727
content-length: '415'
2828
body:

webknossos/tests/cassettes/test_api_client/test_current_user_info_and_user_logged_time.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v8/user
4+
path: /api/v9/user
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -21,17 +21,17 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Wed, 18 Dec 2024 13:42:30 GMT
24+
date: Thu, 09 Jan 2025 14:30:33 GMT
2525
content-type: application/json
2626
content-length: '682'
2727
body:
2828
encoding: utf8
2929
data: >-
30-
{"id":"570b9f4d2a7c0e4d008da6ef","email":"[email protected]","firstName":"user_A","lastName":"last_A","isAdmin":true,"isOrganizationOwner":true,"isDatasetManager":true,"isActive":true,"teams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","isTeamManager":true},{"id":"59882b370d889b84020efd3f","name":"team_X3","isTeamManager":false},{"id":"59882b370d889b84020efd6f","name":"team_X4","isTeamManager":true}],"experiences":{"abc":5},"lastActivity":1734529175482,"isAnonymous":false,"isEditable":true,"organization":"Organization_X","novelUserExperienceInfos":{},"selectedTheme":"auto","created":1460379469000,"lastTaskTypeId":null,"isSuperUser":true,"isEmailVerified":true}
30+
{"id":"570b9f4d2a7c0e4d008da6ef","email":"[email protected]","firstName":"user_A","lastName":"last_A","isAdmin":true,"isOrganizationOwner":true,"isDatasetManager":true,"isActive":true,"teams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","isTeamManager":true},{"id":"59882b370d889b84020efd3f","name":"team_X3","isTeamManager":false},{"id":"59882b370d889b84020efd6f","name":"team_X4","isTeamManager":true}],"experiences":{"abc":5},"lastActivity":1736432857848,"isAnonymous":false,"isEditable":true,"organization":"Organization_X","novelUserExperienceInfos":{},"selectedTheme":"auto","created":1460379469000,"lastTaskTypeId":null,"isSuperUser":true,"isEmailVerified":true}
3131
compression: none
3232
- request:
3333
method: GET
34-
path: /api/v8/users/570b9f4d2a7c0e4d008da6ef/loggedTime
34+
path: /api/v9/users/570b9f4d2a7c0e4d008da6ef/loggedTime
3535
headers:
3636
host: localhost:9000
3737
accept: '*/*'
@@ -51,11 +51,11 @@ http_interactions:
5151
cache-control: no-cache
5252
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
5353
x-permitted-cross-domain-policies: master-only
54-
date: Wed, 18 Dec 2024 13:42:30 GMT
54+
date: Thu, 09 Jan 2025 14:30:33 GMT
5555
content-type: application/json
56-
content-length: '692'
56+
content-length: '691'
5757
body:
5858
encoding: utf8
5959
data: >-
60-
{"loggedTime":[{"paymentInterval":{"month":4,"year":2016},"durationInSeconds":58},{"paymentInterval":{"month":8,"year":2018},"durationInSeconds":265},{"paymentInterval":{"month":1,"year":2021},"durationInSeconds":112},{"paymentInterval":{"month":3,"year":2021},"durationInSeconds":24},{"paymentInterval":{"month":5,"year":2021},"durationInSeconds":158},{"paymentInterval":{"month":8,"year":2021},"durationInSeconds":14},{"paymentInterval":{"month":11,"year":2021},"durationInSeconds":12},{"paymentInterval":{"month":2,"year":2024},"durationInSeconds":114},{"paymentInterval":{"month":3,"year":2024},"durationInSeconds":200},{"paymentInterval":{"month":12,"year":2024},"durationInSeconds":0}]}
60+
{"loggedTime":[{"paymentInterval":{"month":4,"year":2016},"durationInSeconds":58},{"paymentInterval":{"month":8,"year":2018},"durationInSeconds":265},{"paymentInterval":{"month":1,"year":2021},"durationInSeconds":112},{"paymentInterval":{"month":3,"year":2021},"durationInSeconds":24},{"paymentInterval":{"month":5,"year":2021},"durationInSeconds":158},{"paymentInterval":{"month":8,"year":2021},"durationInSeconds":14},{"paymentInterval":{"month":11,"year":2021},"durationInSeconds":12},{"paymentInterval":{"month":2,"year":2024},"durationInSeconds":114},{"paymentInterval":{"month":3,"year":2024},"durationInSeconds":200},{"paymentInterval":{"month":1,"year":2025},"durationInSeconds":0}]}
6161
compression: none

webknossos/tests/cassettes/test_api_client/test_dataset_info.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v8/datasets/Organization_X/l4_sample
4+
path: /api/v9/datasets/disambiguate/Organization_X/l4_sample/toId
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -21,11 +21,41 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Wed, 18 Dec 2024 13:42:30 GMT
24+
date: Thu, 09 Jan 2025 14:30:33 GMT
2525
content-type: application/json
26-
content-length: '1501'
26+
content-length: '112'
2727
body:
2828
encoding: utf8
2929
data: >-
30-
{"id":"59e9cfbdba632ac2ab8b23b5","name":"l4_sample","dataSource":{"id":{"name":"l4_sample","team":"Organization_X"},"dataLayers":[{"name":"color","category":"color","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint8","defaultViewConfiguration":{"color":[255,0,0]}},{"name":"segmentation","category":"segmentation","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint32","largestSegmentId":2504697}],"scale":{"factor":[11.239999771118164,11.239999771118164,28],"unit":"nanometer"}},"dataStore":{"name":"localhost","url":"http://localhost:9000","isScratch":false,"allowsUpload":true,"jobsSupportedByAvailableWorkers":[],"jobsEnabled":false},"owningOrganization":"Organization_X","allowedTeams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"allowedTeamsCumulative":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"isActive":true,"isPublic":true,"description":null,"created":1508495293789,"isEditable":true,"lastUsedByUser":1734529351088,"logoUrl":"/assets/images/mpi-logos.svg","sortingKey":1508495293789,"metadata":[{"key":"key","type":"string","value":"value"}],"isUnreported":false,"tags":[],"folderId":"570b9f4e4bb848d0885ea917","publication":null,"usedStorageBytes":1692207513,"displayName":"l4_sample"}
30+
{"id":"59e9cfbdba632ac2ab8b23b5","name":"l4_sample","organization":"Organization_X","directoryName":"l4_sample"}
31+
compression: none
32+
- request:
33+
method: GET
34+
path: /api/v9/datasets/59e9cfbdba632ac2ab8b23b5
35+
headers:
36+
host: localhost:9000
37+
accept: '*/*'
38+
accept-encoding: gzip, deflate, zstd
39+
connection: keep-alive
40+
user-agent: python-httpx/0.27.2
41+
x-auth-token: >-
42+
1b88db86331a38c21a0b235794b9e459856490d70408bcffb767f64ade0f83d2bdb4c4e181b9a9a30cdece7cb7c65208cc43b6c1bb5987f5ece00d348b1a905502a266f8fc64f0371cd6559393d72e031d0c2d0cabad58cccf957bb258bc86f05b5dc3d4fff3d5e3d9c0389a6027d861a21e78e3222fb6c5b7944520ef21761e
43+
body:
44+
encoding: utf8
45+
data: ''
46+
compression: none
47+
response:
48+
status:
49+
code: 200
50+
headers:
51+
cache-control: no-cache
52+
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
53+
x-permitted-cross-domain-policies: master-only
54+
date: Thu, 09 Jan 2025 14:30:33 GMT
55+
content-type: application/json
56+
content-length: '1503'
57+
body:
58+
encoding: utf8
59+
data: >-
60+
{"id":"59e9cfbdba632ac2ab8b23b5","name":"l4_sample","dataSource":{"id":{"name":"l4_sample","team":"Organization_X"},"dataLayers":[{"name":"color","category":"color","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint8","defaultViewConfiguration":{"color":[255,0,0]}},{"name":"segmentation","category":"segmentation","boundingBox":{"topLeft":[3072,3072,512],"width":1024,"height":1024,"depth":1024},"resolutions":[[1,1,1],[2,2,1],[4,4,1],[8,8,2],[16,16,4]],"elementClass":"uint32","largestSegmentId":2504697}],"scale":{"factor":[11.239999771118164,11.239999771118164,28],"unit":"nanometer"}},"dataStore":{"name":"localhost","url":"http://localhost:9000","isScratch":false,"allowsUpload":true,"jobsSupportedByAvailableWorkers":[],"jobsEnabled":false},"owningOrganization":"Organization_X","allowedTeams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"allowedTeamsCumulative":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X"}],"isActive":true,"isPublic":true,"description":null,"directoryName":"l4_sample","created":1508495293789,"isEditable":true,"lastUsedByUser":1736433034081,"logoUrl":"/assets/images/mpi-logos.svg","sortingKey":1508495293789,"metadata":[{"key":"key","type":"string","value":"value"}],"isUnreported":false,"tags":[],"folderId":"570b9f4e4bb848d0885ea917","publication":null,"usedStorageBytes":1692207513}
3161
compression: none

webknossos/tests/cassettes/test_api_client/test_datastore_list.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v8/datastores
4+
path: /api/v9/datastores
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -21,7 +21,7 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Wed, 18 Dec 2024 13:42:29 GMT
24+
date: Thu, 09 Jan 2025 14:30:32 GMT
2525
content-type: application/json
2626
content-length: '147'
2727
body:

webknossos/tests/cassettes/test_api_client/test_generate_token_for_data_store.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: POST
4-
path: /api/v8/userToken/generate
4+
path: /api/v9/userToken/generate
55
headers:
66
host: localhost:9000
77
content-length: '0'
@@ -22,10 +22,10 @@ http_interactions:
2222
cache-control: no-cache
2323
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2424
x-permitted-cross-domain-policies: master-only
25-
date: Wed, 18 Dec 2024 13:42:30 GMT
25+
date: Thu, 09 Jan 2025 14:30:33 GMT
2626
content-type: application/json
2727
content-length: '34'
2828
body:
2929
encoding: utf8
30-
data: '{"token":"IyV-W-lxr-YovycgMxWBvg"}'
30+
data: '{"token":"NEdSmVtaQai_RdfG3fDxNQ"}'
3131
compression: none

webknossos/tests/cassettes/test_api_client/test_health.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v8/health
4+
path: /api/v9/health
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -21,7 +21,7 @@ http_interactions:
2121
cache-control: no-cache
2222
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2323
x-permitted-cross-domain-policies: master-only
24-
date: Wed, 18 Dec 2024 13:42:29 GMT
24+
date: Thu, 09 Jan 2025 14:30:32 GMT
2525
content-type: text/plain; charset=UTF-8
2626
content-length: '2'
2727
body:

0 commit comments

Comments
 (0)