Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Team.get_by_name & Dataset.get_remote_dataset_registry (#763)
* update client, add Team.get_by_name(), add Dataset.get_remote_dataset_registry() * rm unused imports * add tests and docs * update docs and example * add changelog entry * export RemoteDataset (mostly for annotations) * incorporate PR feedback * Update remote_dataset_registry.py
- Loading branch information
Showing
47 changed files
with
17,030 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Remote Dataset Access | ||
|
||
This example shows how to access [remote datasets](../../api/webknossos/dataset/dataset.md#RemoteDataset). This can be done directly using [wk.Dataset.open_remote()](../../api/webknossos/dataset/dataset.md#Dataset.open_remote), or listing all available datasets via [wk.Dataset.get_remote_datasets()](../../api/webknossos/dataset/dataset.md#Dataset.get_remote_datasets). | ||
|
||
```python | ||
--8<-- | ||
webknossos/examples/remote_datasets.py | ||
--8<-- | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from textwrap import wrap | ||
|
||
import webknossos as wk | ||
|
||
|
||
def main() -> None: | ||
# Remote datasets are read-only, but can be used similar to normal datasets: | ||
l4_sample_dataset = wk.Dataset.open_remote( | ||
"https://webknossos.org/datasets/scalable_minds/l4dense_motta_et_al_demo" | ||
) | ||
|
||
# Print information of the public l4dense_motta_et_al_demo dataset: | ||
print(l4_sample_dataset.url) | ||
print("\n ".join(["Description:"] + wrap(l4_sample_dataset.description or ""))) | ||
print("Layers:", ", ".join(l4_sample_dataset.layers)) | ||
print("Tags:", ", ".join(l4_sample_dataset.tags)) | ||
|
||
# List all accessible remote datasets via get_remote_datasets(): | ||
own_remote_datasets = wk.Dataset.get_remote_datasets() | ||
|
||
# Print the first 10 dataset names from your organization: | ||
print() | ||
print("First 10 datasets for own organization:") | ||
for dataset_name in sorted(own_remote_datasets)[:10]: | ||
print("*", dataset_name) | ||
|
||
# List all accessible demo datasets of the scalable minds organization: | ||
remote_demo_datasets = wk.Dataset.get_remote_datasets( | ||
organization_id="scalable_minds", tags="demo" | ||
) | ||
print("Remote demo datasets:", list(remote_demo_datasets)) | ||
assert l4_sample_dataset in remote_demo_datasets.values() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.