Skip to content

Commit 4af80cb

Browse files
authored
Datastore client by ID (#1363)
* kwargs * fixes * types * update cassettes * fixes * type * changelog * rm comment
1 parent 16c1f8c commit 4af80cb

File tree

62 files changed

+6634
-3759
lines changed

Some content is hidden

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

62 files changed

+6634
-3759
lines changed

webknossos/Changelog.md

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

1515
### Breaking Changes
16+
- All internal API client methods (`webknossos.client`) use keyword-only arguments. [#1363](https://github.com/scalableminds/webknossos-libs/pull/1363)
17+
- The signature of `Dataset.trigger_reload_on_datastore` changed. `dataset_name` has been renamed to `dataset_name_or_url`. Alternatively, a `dataset_id` can be supplied. [#1363](https://github.com/scalableminds/webknossos-libs/pull/1363)
1618

1719
### Added
1820

1921
### Changed
22+
- The API methods now use `v10` API version of Webknossos. Datasets are now referenced by ID instead of dataset name or directory name. [#1363](https://github.com/scalableminds/webknossos-libs/pull/1363)
2023

2124
### Fixed
2225

webknossos/examples/announce_dataset_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def main() -> None:
2222
# To trigger a reload of the dataset properties manually, use:
2323

2424
wk.Dataset.trigger_reload_in_datastore(
25-
dataset_name="my_new_dataset_name", organization="sample_organization"
25+
dataset_name_or_url="my_new_dataset_name", organization="sample_organization"
2626
)
2727

2828

webknossos/tests/cassettes/test_annotation/test_annotation_upload_download_roundtrip.yml

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

webknossos/tests/cassettes/test_annotation/test_bounding_box_roundtrip.yml

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

webknossos/tests/cassettes/test_annotation/test_dataset_access_via_annotation.yml

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

webknossos/tests/cassettes/test_annotation/test_remote_annotation_list.yml

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

webknossos/tests/cassettes/test_api_client/test_annotation_info.yml

Lines changed: 4 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/v9/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1755084091000
5+
/api/v10/annotations/570ba0092a7c0e980056fe9b/info?timestamp=1756493078000
66
headers:
77
host: localhost:9000
88
accept: '*/*'
@@ -19,10 +19,12 @@ http_interactions:
1919
status:
2020
code: 200
2121
headers:
22+
x-powered-by: Express
2223
cache-control: no-cache
2324
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2425
x-permitted-cross-domain-policies: master-only
25-
date: Wed, 13 Aug 2025 11:21:31 GMT
26+
date: Fri, 29 Aug 2025 18:44:38 GMT
27+
connection: close
2628
content-type: application/json
2729
content-length: '1911'
2830
body:

webknossos/tests/cassettes/test_api_client/test_build_info.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v9/buildinfo
4+
path: /api/v10/buildinfo
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -18,17 +18,19 @@ http_interactions:
1818
status:
1919
code: 200
2020
headers:
21+
x-powered-by: Express
2122
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2223
access-control-max-age: '600'
2324
access-control-allow-origin: '*'
2425
x-permitted-cross-domain-policies: master-only
25-
date: Wed, 13 Aug 2025 11:21:32 GMT
26+
date: Fri, 29 Aug 2025 18:44:38 GMT
27+
connection: close
2628
content-type: application/json
27-
content-length: '427'
29+
content-length: '409'
2830
body:
2931
encoding: utf8
3032
data: >-
31-
{"webknossos":{"name":"webknossos","ciTag":"","commitHash":"a7f514b5c7b7a22db133537e7989d37d6880c522","ciBuild":"16935386461","scalaVersion":"2.13.16","version":"16935386461","sbtVersion":"1.11.0","datastoreApiVersion":"2.0","commitDate":"Wed
32-
Aug 13 11:06:17 2025
33-
+0000"},"schemaVersion":138,"httpApiVersioning":{"currentApiVersion":9,"oldestSupportedApiVersion":5},"localDataStoreEnabled":true,"localTracingStoreEnabled":true}
33+
{"webknossos":{"name":"webknossos","ciTag":"","commitHash":"0858f84b3e03f2d4a45c4ce4665dcad8de43ae76","ciBuild":"","scalaVersion":"2.13.16","version":"dev","sbtVersion":"1.11.4","datastoreApiVersion":"2.0","commitDate":"Fri
34+
Aug 29 17:31:37 2025
35+
+0200"},"schemaVersion":138,"httpApiVersioning":{"currentApiVersion":10,"oldestSupportedApiVersion":5},"localDataStoreEnabled":true,"localTracingStoreEnabled":true}
3436
compression: none

webknossos/tests/cassettes/test_api_client/test_current_user_info_and_user_logged_time.yml

Lines changed: 8 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/v9/user
4+
path: /api/v10/user
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -18,10 +18,12 @@ http_interactions:
1818
status:
1919
code: 200
2020
headers:
21+
x-powered-by: Express
2122
cache-control: no-cache
2223
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2324
x-permitted-cross-domain-policies: master-only
24-
date: Wed, 13 Aug 2025 11:21:31 GMT
25+
date: Fri, 29 Aug 2025 18:44:38 GMT
26+
connection: close
2527
content-type: application/json
2628
content-length: '717'
2729
body:
@@ -31,7 +33,7 @@ http_interactions:
3133
compression: none
3234
- request:
3335
method: GET
34-
path: /api/v9/users/570b9f4d2a7c0e4d008da6ef/loggedTime
36+
path: /api/v10/users/570b9f4d2a7c0e4d008da6ef/loggedTime
3537
headers:
3638
host: localhost:9000
3739
accept: '*/*'
@@ -48,10 +50,12 @@ http_interactions:
4850
status:
4951
code: 200
5052
headers:
53+
x-powered-by: Express
5154
cache-control: no-cache
5255
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
5356
x-permitted-cross-domain-policies: master-only
54-
date: Wed, 13 Aug 2025 11:21:31 GMT
57+
date: Fri, 29 Aug 2025 18:44:38 GMT
58+
connection: close
5559
content-type: application/json
5660
content-length: '691'
5761
body:

webknossos/tests/cassettes/test_api_client/test_dataset_info.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
http_interactions:
22
- request:
33
method: GET
4-
path: /api/v9/datasets/disambiguate/Organization_X/l4_sample/toId
4+
path: /api/v10/datasets/disambiguate/Organization_X/l4_sample/toId
55
headers:
66
host: localhost:9000
77
accept: '*/*'
@@ -18,10 +18,12 @@ http_interactions:
1818
status:
1919
code: 200
2020
headers:
21+
x-powered-by: Express
2122
cache-control: no-cache
2223
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
2324
x-permitted-cross-domain-policies: master-only
24-
date: Wed, 13 Aug 2025 11:21:31 GMT
25+
date: Fri, 29 Aug 2025 18:44:38 GMT
26+
connection: close
2527
content-type: application/json
2628
content-length: '112'
2729
body:
@@ -31,7 +33,7 @@ http_interactions:
3133
compression: none
3234
- request:
3335
method: GET
34-
path: /api/v9/datasets/59e9cfbdba632ac2ab8b23b5
36+
path: /api/v10/datasets/59e9cfbdba632ac2ab8b23b5
3537
headers:
3638
host: localhost:9000
3739
accept: '*/*'
@@ -48,14 +50,16 @@ http_interactions:
4850
status:
4951
code: 200
5052
headers:
53+
x-powered-by: Express
5154
cache-control: no-cache
5255
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
5356
x-permitted-cross-domain-policies: master-only
54-
date: Wed, 13 Aug 2025 11:21:31 GMT
57+
date: Fri, 29 Aug 2025 18:44:38 GMT
58+
connection: close
5559
content-type: application/json
56-
content-length: '1575'
60+
content-length: '1627'
5761
body:
5862
encoding: utf8
5963
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","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":1755084092226,"logoUrl":"/assets/images/mpi-logos.svg","sortingKey":1508495293789,"metadata":[{"key":"key","type":"string","value":"value"},{"key":"number","type":"number","value":42},{"key":"list","type":"string[]","value":["a","b","c"]}],"isUnreported":false,"tags":[],"folderId":"570b9f4e4bb848d0885ea917","publication":null,"usedStorageBytes":0}
64+
{"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","allowsUpload":true,"jobsSupportedByAvailableWorkers":[],"jobsEnabled":false},"owningOrganization":"Organization_X","allowedTeams":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X","isOrganizationTeam":true}],"allowedTeamsCumulative":[{"id":"570b9f4b2a7c0e3b008da6ec","name":"team_X1","organization":"Organization_X","isOrganizationTeam":true}],"isActive":true,"isPublic":true,"description":null,"directoryName":"l4_sample","created":1508495293789,"isEditable":true,"lastUsedByUser":1756493079131,"logoUrl":"/assets/images/mpi-logos.svg","sortingKey":1508495293789,"metadata":[{"key":"key","type":"string","value":"value"},{"key":"number","type":"number","value":42},{"key":"list","type":"string[]","value":["a","b","c"]}],"isUnreported":false,"tags":[],"folderId":"570b9f4e4bb848d0885ea917","publication":null,"usedStorageBytes":0}
6165
compression: none

0 commit comments

Comments
 (0)