-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add new API design doc #447
Changes from 1 commit
ee800d4
1702bb2
6340c9b
ffd6ac1
9e2d414
58500c1
6d731db
6661c28
20cc7dc
3f62f3d
21f361a
7d3266f
201b081
af512df
6f84091
2b32d56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
set_metadata()
modify objects in-place
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ Designs for an improved Python API | |
* TO DO: Add an argument for controlling whether to create a directory under `target_dir` with the same name as the Dandiset ID? | ||
|
||
* Methods of the `DraftDandiset` class (a subclass of `RemoteDandiset` used only for mutable draft versions): | ||
* `set_metadata(metadata: DandisetMeta) -> DraftDandiset` — returns the new, modified object | ||
* `set_metadata(metadata: DandisetMeta) -> None` — modifies instance in-place | ||
* Methods for uploading an individual asset: | ||
* `upload_file(filepath: Union[str, Path], metadata: BareAssetMeta, show_progress=True, existing="refesh", validation="require") -> RemoteAsset` | ||
* `iter_upload_file(filepath: Union[str, Path], metadata: BareAssetMeta, existing="refesh", validation="require") -> Iterator[UploadProgressDict]` | ||
|
@@ -105,7 +105,7 @@ Designs for an improved Python API | |
* `version_id: str` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. like dandiset version? also would not bother... may be if we are to establish relationship to a specific dandiset, could be via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, Dandiset version. Same response as above. |
||
* `get_metadata() -> RemoteAssetMeta` | ||
* `get_raw_metadata() -> dict` — useful when the metadata is invalid | ||
* `set_metadata(metadata: BareAssetMeta) -> RemoteAsset` — returns the new, modified object | ||
* `set_metadata(metadata: BareAssetMeta) -> None` — Assuming assets keep their identifier on metadata change, this modifies the instance in-place; otherwise, it should return the new, modified instance | ||
* `delete() -> None` | ||
* `download(filepath: str, show_progress=True, chunk_size=...) -> ???` | ||
* `iter_download(filepath: str, chunk_size=...) -> Iterator[DownloadProgressDict]` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metadata
should not be provided but extracted as part of the*upload_file*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of this method is to support generic file uploads where the user crafts the metadata themselves. If we only want to support upload of files that can be represented with
LocalAsset
instances, we can get rid of it.