Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support renameable datasets and WK API v9 #1231

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

markbader
Copy link
Contributor

@markbader markbader commented Dec 18, 2024

Description:

  • Adds support for renameable datasets and the webknossos API version 9.

Issues:

Todos:

Make sure to delete unnecessary points or to check all before merging:

  • Updated Changelog
  • Added / Updated Tests

@markbader markbader self-assigned this Dec 18, 2024
@philippotto philippotto changed the title wk API v9 Support renameable datasets and WK API v9 Jan 8, 2025
@philippotto philippotto mentioned this pull request Jan 8, 2025
4 tasks
@markbader markbader marked this pull request as ready for review January 9, 2025 15:09
@markbader markbader requested a review from normanrz January 9, 2025 15:14
@@ -13,10 +13,15 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
[Commits](https://github.com/scalableminds/webknossos-libs/compare/v0.16.2...HEAD)

### Breaking Changes
- Remote datasets don't have a display_name property anymore. To change the name of a dataset use the `name` property.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make that more graceful, i.e. put in a display_name property that just proxies the name property and issues a deprecation warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@@ -119,7 +119,7 @@ def create(
cls,
task_type_id: str,
project_name: str,
dataset_name: Union[str, RemoteDataset],
dataset_id: Union[str, RemoteDataset],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a breaking change, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I missed that, I will add it in the changelog.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also still accept dataset_name with disambiguation and deprecation warning?

@@ -639,7 +679,31 @@ def _parse_remote(

context_manager = nullcontext()

return context_manager, dataset_name, organization_id, sharing_token
if dataset_id is None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the same code in lines 611-627. Does it make sense to extract in a function?

@@ -2675,10 +2744,12 @@ def _initialize_layer_from_properties(self, properties: LayerProperties) -> Laye
def get_remote_datasets(
organization_id: Optional[str] = None,
tags: Optional[Union[str, Sequence[str]]] = None,
name: Optional[str] = None,
folder_id: Optional[str] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a Folder object would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for renamable datasets, API Version 9
2 participants