Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
b411724
making the path optional in dataset, and layers
Aug 26, 2025
ba1fac5
typecheck. format. lint
Aug 26, 2025
20a84d0
add default for version. fix structuring
Aug 27, 2025
02c4685
fix more type errors
Aug 27, 2025
821dead
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Sep 1, 2025
7b8e19b
add reserve manual upload.
Sep 2, 2025
87d1415
implement upload on dataset object.
Sep 2, 2025
8a2e741
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Sep 3, 2025
1b3439d
update to api_version 11
Sep 3, 2025
69a6035
use enrich_path
Sep 3, 2025
b65135e
remove status from valid DatasetProperties
Sep 3, 2025
fb12c23
add default argument
Sep 3, 2025
004e656
always ask for included paths in dataset_info
Sep 3, 2025
b6b83c7
make dataset.path and layer.path optional
Sep 11, 2025
7b3cb28
moved dataset_properties
Sep 11, 2025
0ed681e
format
Sep 11, 2025
20b3e85
fix ruff for __init__
Sep 11, 2025
f9823f6
fix missing import
Sep 11, 2025
3804399
fix copy of attachments
Sep 11, 2025
8106055
fix imports
Sep 12, 2025
f719f79
fix import
Sep 12, 2025
dc51517
move layer_categories.py
Sep 12, 2025
ae47ced
reorder code in structuring
Sep 12, 2025
3a14b90
reorder is None check
Sep 12, 2025
9a8d31a
improve comment
Sep 12, 2025
c800547
move layer category
Sep 12, 2025
7176b0e
move imports
Sep 12, 2025
947ae35
no need for conversion anymore
Sep 12, 2025
15d8482
fix disambiguate
Sep 12, 2025
043a3dc
fix schema
Sep 12, 2025
ebbead2
wk now has lower case user emails
Sep 12, 2025
3500d9d
wk now has lower case user emails
Sep 12, 2025
5d822db
missing 7 cassettes.
Sep 12, 2025
5d016cc
elaborate comment about legacy field DatasetProperties.id
fm3 Sep 15, 2025
f31799a
add_attachment_as_copy now supports RemoteDatasets
Sep 15, 2025
0bae0c9
don't use RemoteDataset type
Sep 15, 2025
ae25d55
fix user names
Sep 15, 2025
b488f5e
missing one cassette
Sep 15, 2025
34f75f8
Merge branch 's3_remote_datasets' of github.com:scalableminds/webknos…
Sep 15, 2025
b41e219
separate type names and container names
Sep 16, 2025
be2a790
do not pass includePaths
Sep 16, 2025
a4b13e3
all cassettes!
Sep 16, 2025
d65b726
allow add_attachment_as_copy to publish attachments to remote datasets
Sep 16, 2025
7ff509c
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Sep 16, 2025
80b18d2
update cassettes
Sep 16, 2025
7a6ab6e
rename manual_upload to upload_to_path*s
fm3 Sep 17, 2025
5239295
Adapt reserve routes to pass dataset_id in path; add new reserve_data…
fm3 Sep 17, 2025
8f2a182
remove default for version
Sep 17, 2025
bcf8c19
add publish_to_preliminary_dataset
Sep 17, 2025
5311b77
add announce_dataset_upload.py
Sep 18, 2025
56ca7c7
update docs
Sep 18, 2025
d510f47
Merge branch 'master' into s3_remote_datasets
valentin-pinkau Sep 18, 2025
0a25507
allow moving of the data when publishing
Sep 18, 2025
5109ca2
Merge remote-tracking branch 'origin/s3_remote_datasets' into s3_remo…
Sep 18, 2025
a8489d3
use dataset updatePartial, update snapshots
fm3 Sep 18, 2025
2a1ffc2
Merge branch 's3_remote_datasets' of github.com:scalableminds/webknos…
fm3 Sep 18, 2025
20b4093
Allow saving RemoteDataset DatasetProperties changes back to server
fm3 Sep 18, 2025
fc56dcd
in case of symlink, directly link, no move
Sep 22, 2025
cc7f29d
rename
Sep 22, 2025
d7c1686
add env variable to __init__.py
Sep 22, 2025
3fed75a
move layer to link
Sep 22, 2025
4039eda
consolidate upload
Sep 22, 2025
e3f2ca6
Revert "move layer to link"
Sep 22, 2025
a42fe2f
format
Sep 22, 2025
6994821
use corrent variable
Sep 22, 2025
f493b17
refactor dataset, remote_dataset, and layer
Sep 26, 2025
37c51fb
clean up
Sep 26, 2025
0b0478f
refactor packages. typecheck runs through
Sep 29, 2025
4030fbb
fixed imports
Sep 30, 2025
1a4b3b9
move _array
Sep 30, 2025
37bd096
add layer and remote_layer to mag view
Sep 30, 2025
905e354
rename attachments_type
Sep 30, 2025
f24c1fb
move download to abstract dataset
Sep 30, 2025
cd5bbce
move open_remote to abstract_dataset.py
Sep 30, 2025
6c5a6cb
remove init
Sep 30, 2025
eb67fb3
make magview generic over layer
Oct 1, 2025
3c801e2
adapt comment
Oct 8, 2025
a227c2e
add_layer_like now accepts RemoteLayers. remove test for adding remot…
Oct 8, 2025
35d26f1
update snapshots
Oct 8, 2025
124db09
increase chunk shape
Oct 8, 2025
751cb8d
add changelog
Oct 8, 2025
5db21cf
merge master
Oct 8, 2025
a6bfc84
format and lint
Oct 8, 2025
6389609
remove unnecessary asserts
Oct 8, 2025
101064f
fix magview rechunk
Oct 8, 2025
a110d19
remove unused method
Oct 8, 2025
b5de338
clean up, removing code from older iterations
Oct 8, 2025
fda0c92
removed None checks
Oct 8, 2025
3b07bca
update changelog
Oct 8, 2025
3d303fe
format
Oct 8, 2025
403883b
restore from_remote_layer method
Oct 8, 2025
d5e3203
use Mapping
Oct 8, 2025
2865995
move download_mesh to RemoteSegmentationLayer
Oct 8, 2025
6d33d92
move Dataset.get_remote_datasets -> RemoteDataset.list and Dataset.op…
Oct 8, 2025
d1771b8
use RemoteDataset.open instead of Dataset.open_remote
Oct 8, 2025
9a24644
fix usage of deprecated methods
Oct 8, 2025
6fc4009
format
Oct 8, 2025
4e7fd21
add backwards compatible deprecated is_foreign property on MagView
Oct 9, 2025
e1a6dd2
make ensure_layer compatible with remote layers
Oct 9, 2025
b1e878d
update changelog
Oct 9, 2025
b39d10d
merge master
Oct 9, 2025
f384549
update cassettes
Oct 9, 2025
7afad19
update api version to 12
Oct 9, 2025
c205b0f
rename
Oct 9, 2025
8ad9971
add upload_to_webknossos example to docs
Oct 9, 2025
9fcdeff
Merge branch 'master' of github.com:scalableminds/webknossos-libs int…
Oct 9, 2025
bcf522a
remove old link
Oct 9, 2025
bf61051
fix changelog
Oct 9, 2025
053d0f4
allow new name to be passed to LayerToLink.from_remote_layer
Oct 9, 2025
25c274a
add tests for upload to common storage
Oct 9, 2025
2187418
lint & format
Oct 9, 2025
d23ee1a
update cassettes
Oct 9, 2025
7586ae7
move _parse_remote, _disambiguate_remote, get_remote_datasets from ab…
Oct 9, 2025
6aa7d85
Update webknossos/Changelog.md
valentin-pinkau Oct 9, 2025
2938379
add deprecation to changelog
Oct 9, 2025
50d2dde
Merge branch 'refactor_dataset' of github.com:scalableminds/webknosso…
Oct 9, 2025
21b9f26
fix changelog
Oct 9, 2025
2e92e8c
format and fix ensure_layer
Oct 9, 2025
87f02bc
add missing cassettes
Oct 10, 2025
d81a14b
skip upload tests
Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ nav:
- webknossos-py/examples/download_tiff_stack.md
- webknossos-py/examples/remote_datasets.md
- webknossos-py/examples/convert_4d_tiff.md
- webknossos-py/examples/announce_dataset_upload.md
- webknossos-py/examples/accessing_metadata.md
- webknossos-py/examples/explore_and_add_remote.md
- webknossos-py/examples/upload_to_webknossos.md
- Annotation Examples:
- webknossos-py/examples/apply_merger_mode.md
- webknossos-py/examples/learned_segmenter.md
Expand Down
9 changes: 0 additions & 9 deletions docs/src/webknossos-py/examples/announce_dataset_upload.md

This file was deleted.

9 changes: 9 additions & 0 deletions docs/src/webknossos-py/examples/upload_to_webknossos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Upload dataset to WEBKNOSSOS

This example demonstrates the process of uploading a Dataset.

```python
--8<--
webknossos/examples/upload_to_webknossos.py
--8<--
```
12 changes: 12 additions & 0 deletions webknossos/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@ For upgrade instructions, please check the respective _Breaking Changes_ section

### Breaking Changes
- Removed Docker image `scalableminds/webknossos-cli` build. It will not be released further. [#1376](https://github.com/scalableminds/webknossos-libs/pull/1376)
- `Dataset.add_layer_as_ref(remote_layer.path)` does not work anymore. Please use `Dataset.add_layer_as_ref(remote_layer)` instead. [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371])
- Due to the refactoring, the imports of various classes have changed. Please update your code accordingly. [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371])
- Deprecated a number of methods [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371]):
- `Dataset.open_remote()`, use `RemoteDataset.open` instead.
- `RemoteDatset.download_mesh()`, use `remote_segmentation_layer.download_mesh()` instead.
- `Dataset.get_remote_datasets()`, use `RemoteDataset.list()` instead.
- `Dataset.download()`, use `RemoteDataset.download()` instead.
- `mag_view.is_foreign`, use `layer.is_mag_view_foreign(mag_view)` instead.
- `Dataset.trigger_reload_in_datastore()`, use `RemoteDataset.trigger_reload_in_datastore()` instead.

### Added
- Dataset.add_layer_as_ref() now accepts RemoteLayer objects as well as Layer objects. [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371])

### Changed
- Refactored the architecture, by introducing RemoteLayers, RemoteSegmentationLayers and their abstract base classes. [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371])
- Updated the api version of the webknossos-api to 12. [#1371](https://github.com/scalableminds/webknossos-libs/pull/1371])

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion webknossos/examples/accessing_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def main() -> None:
l4_sample_dataset = wk.Dataset.open_remote("l4_sample")
l4_sample_dataset = wk.RemoteDataset.open("l4_sample")
# Access the metadata of the dataset
print(l4_sample_dataset.metadata)

Expand Down
30 changes: 0 additions & 30 deletions webknossos/examples/announce_dataset_upload.py

This file was deleted.

30 changes: 10 additions & 20 deletions webknossos/examples/apply_merger_mode.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from pathlib import Path

import fastremap

import webknossos as wk

TESTDATA_DIR = Path(__file__).parent.parent / "testdata"


def main() -> None:
####################################
Expand All @@ -18,15 +14,14 @@ def main() -> None:
).skeleton

###############################################
# Download and open the corresponding dataset #
# Open the corresponding dataset #
###############################################

dataset = wk.Dataset.download(
input_dataset = wk.RemoteDataset.open(
"l4_sample",
bbox=wk.BoundingBox((3457, 3323, 1204), (40, 10, 10)),
path="testoutput/l4_sample",
organization_id="scalable_minds",
)
in_layer = dataset.get_segmentation_layer("segmentation")
in_layer = input_dataset.get_segmentation_layer("segmentation")
in_mag1 = in_layer.get_mag("1")

##############################
Expand All @@ -52,8 +47,10 @@ def main() -> None:
############################
# Creating an output layer #
############################

out_layer = dataset.add_layer(
output_dataset = wk.Dataset(
"testoutput/l4_sample", voxel_size=input_dataset.voxel_size
)
out_layer = output_dataset.add_layer(
"segmentation_remapped",
wk.SEGMENTATION_CATEGORY,
dtype_per_channel=in_layer.dtype_per_channel,
Expand Down Expand Up @@ -84,16 +81,9 @@ def apply_mapping_for_chunk(args: tuple[wk.View, wk.View, int]) -> None:
########################################

out_layer.downsample()
dataset.delete_layer("segmentation")
dataset.upload(
output_dataset.upload(
"l4_sample_remapped",
layers_to_link=[
wk.LayerToLink(
dataset_name="l4_sample",
layer_name="color",
organization_id="scalable_minds",
)
],
layers_to_link=[input_dataset.get_layer("color")],
)


Expand Down
3 changes: 1 addition & 2 deletions webknossos/examples/create_dataset_from_images.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path

from webknossos import Dataset
from webknossos.dataset import COLOR_CATEGORY
from webknossos import COLOR_CATEGORY, Dataset

INPUT_DIR = Path(__file__).parent.parent / "testdata" / "tiff"
OUTPUT_DIR = Path("testoutput/my_tiff_dataset")
Expand Down
3 changes: 1 addition & 2 deletions webknossos/examples/dataset_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def main() -> None:
#####################
# Opening a dataset #
#####################

dataset = wk.Dataset.open("testdata/simple_wkw_dataset")
# Assuming that the dataset has a layer "color"
# and the layer has the magnification 1
Expand Down Expand Up @@ -67,7 +66,7 @@ def main() -> None:

copy_of_dataset = dataset.copy_dataset(
"testoutput/copy_of_dataset",
chunk_shape=(8, 8, 8),
chunk_shape=(32, 32, 32),
shard_shape=(64, 64, 64),
compress=True,
)
Expand Down
5 changes: 3 additions & 2 deletions webknossos/examples/download_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ def main() -> None:
bbox = wk.BoundingBox([50, 50, 50], [50, 50, 50])

# Download the dataset
ds = wk.Dataset.download(
ds = wk.RemoteDataset.open(
dataset_name_or_url=name,
organization_id=organization_id,
webknossos_url="https://webknossos.org",
).download(
bbox=bbox,
layers=layers,
mags=mags,
webknossos_url="https://webknossos.org",
)

# Check that the layer was downloaded
Expand Down
2 changes: 1 addition & 1 deletion webknossos/examples/download_tiff_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def main() -> None:
dataset = wk.Dataset.open_remote(
dataset = wk.RemoteDataset.open(
DATASET_NAME,
organization_id="scalable_minds",
webknossos_url="https://webknossos.org",
Expand Down
3 changes: 1 addition & 2 deletions webknossos/examples/image_stack_to_dataset.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path

from webknossos import Dataset
from webknossos.dataset import COLOR_CATEGORY
from webknossos import COLOR_CATEGORY, Dataset

INPUT_FILES = (
Path(__file__).parent.parent / "testdata" / "tiff" / "test.0000.tiff",
Expand Down
6 changes: 3 additions & 3 deletions webknossos/examples/remote_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def main() -> None:
# Remote datasets are read-only, but can be used similar to normal datasets:
l4_sample_dataset = wk.Dataset.open_remote("l4_sample")
l4_sample_dataset = wk.RemoteDataset.open("l4_sample")

# Print information of the public l4dense_motta_et_al_demo dataset:
print(l4_sample_dataset.url)
Expand All @@ -14,7 +14,7 @@ def main() -> None:
print("Tags:", ", ".join(l4_sample_dataset.tags))

# List all accessible remote datasets via get_remote_datasets():
own_remote_datasets = wk.Dataset.get_remote_datasets()
own_remote_datasets = wk.RemoteDataset.list()

# Print the first 10 dataset names from your organization:
print()
Expand All @@ -26,7 +26,7 @@ def main() -> None:
l4_sample_dataset.tags = ("demo",)

# List all accessible demo datasets:
remote_demo_datasets = wk.Dataset.get_remote_datasets(tags="demo")
remote_demo_datasets = wk.RemoteDataset.list(tags="demo")
print("Remote demo datasets:", list(remote_demo_datasets))
assert l4_sample_dataset in remote_demo_datasets.values()

Expand Down
4 changes: 2 additions & 2 deletions webknossos/examples/upload_image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from skimage import data

import webknossos as wk
from webknossos.dataset import COLOR_CATEGORY
from webknossos.dataset.properties import (
from webknossos import COLOR_CATEGORY
from webknossos.dataset_properties import (
DatasetViewConfiguration,
LayerViewConfiguration,
)
Expand Down
30 changes: 30 additions & 0 deletions webknossos/examples/upload_to_webknossos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import webknossos as wk
from webknossos import LayerToLink
from webknossos.dataset.remote_folder import RemoteFolder


def main() -> None:
# Get the folder id of the upload destination:
folder_id = RemoteFolder.get_by_path("Datasets/").id

# Open your unpublished dataset
dataset = wk.Dataset.open("my_dataset.wkw")

existing_dataset = wk.RemoteDataset.open(
"https://webknossos.org/datasets/liconn_expid82-678f98e3010000dd017f4449/#3825,4866,795,0,1.3"
)
# Publish the dataset to webknossos
# The data will be uploaded to the upload destination folder
dataset.upload(
new_dataset_name="my_new_dataset_name",
folder_id=folder_id,
layers_to_link=[
LayerToLink.from_remote_layer(
existing_dataset.get_layer("image_230130b"), new_layer_name="image"
),
],
)


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions webknossos/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies = [
"python-dateutil ~=2.8.0",
"python-dotenv ~=1.0.1",
"rich ~=13.8.0",
"s3fs>=2024.6.1",
"scipy >=1.13",
"tensorstore~=0.1.74",
"typer ~=0.12.5",
Expand Down
2 changes: 1 addition & 1 deletion webknossos/tests/administration/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_project_get_owner() -> None:
def test_project_get_tasks() -> None:
"""Test getting the task of a project."""
teams = wk.Team.get_list()
ds_id = wk.Dataset.open_remote("l4_sample")._dataset_id
ds_id = wk.RemoteDataset.open("l4_sample")._dataset_id

project = wk.Project.create(
name="test_get_task_project",
Expand Down
10 changes: 5 additions & 5 deletions webknossos/tests/administration/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_get_task() -> None:
needed_experience_domain="testing",
needed_experience_value=0,
starting_position=wk.Vec3Int(0, 0, 0),
dataset_id=wk.Dataset.open_remote("l4_sample")._dataset_id,
dataset_id=wk.RemoteDataset.open("l4_sample")._dataset_id,
)
task_by_id = wk.Task.get_by_id(tasks[0].task_id)
assert task_by_id == tasks[0]
Expand All @@ -61,7 +61,7 @@ def test_task_get_project() -> None:
needed_experience_domain="testing",
needed_experience_value=0,
starting_position=wk.Vec3Int(0, 0, 0),
dataset_id=wk.Dataset.open_remote("l4_sample")._dataset_id,
dataset_id=wk.RemoteDataset.open("l4_sample")._dataset_id,
)
project = tasks[0].get_project()
assert project.name == TEST_PROJECT_NAME
Expand All @@ -82,7 +82,7 @@ def test_update_task() -> None:
needed_experience_domain="testing",
needed_experience_value=0,
starting_position=wk.Vec3Int(0, 0, 0),
dataset_id=wk.Dataset.open_remote("l4_sample")._dataset_id,
dataset_id=wk.RemoteDataset.open("l4_sample")._dataset_id,
)
task = tasks[0]
updated = task.update(
Expand All @@ -98,7 +98,7 @@ def test_delete_task() -> None:
needed_experience_domain="testing",
needed_experience_value=0,
starting_position=wk.Vec3Int(0, 0, 0),
dataset_id=wk.Dataset.open_remote("l4_sample")._dataset_id,
dataset_id=wk.RemoteDataset.open("l4_sample")._dataset_id,
)
task = tasks[0]
task.delete()
Expand All @@ -115,7 +115,7 @@ def test_task_list() -> None:
needed_experience_domain="testing",
needed_experience_value=0,
starting_position=wk.Vec3Int(0, 0, 0),
dataset_id=wk.Dataset.open_remote("l4_sample")._dataset_id,
dataset_id=wk.RemoteDataset.open("l4_sample")._dataset_id,
)
task_list = wk.Task.get_list()
assert len(task_list) > 0
Expand Down

Large diffs are not rendered by default.

Loading
Loading