-
Notifications
You must be signed in to change notification settings - Fork 25
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 bulk annotation helper on sample #333
Add bulk annotation helper on sample #333
Conversation
0750904
to
d847661
Compare
@@ -222,6 +222,9 @@ def _fetch(self): | |||
if isinstance(items, dict) and "results" in items: | |||
self._count = items["count"] | |||
items = items["results"] | |||
# Store count when list of objects is received. | |||
if isinstance(items, list): | |||
self._count = len(items) |
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.
👌🏼
Works well. Feature request:
Bugs:
|
8d95cb1
to
1f22257
Compare
|
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.
Well done! Works as expected.
I noticed that set_annotation
(note the singular form) requires explicit confirmation when deleting a field. That's fine, but note that bioinformaticians typically annotate all samples in a collection, so this may require them to press "y" several hundred times. A force
argument would be nice to control the confirmation prompt. This issue doesn't need to be addressed immediately because set_annotations
doesn't prompt for confirmation, so we can use that instead.
src/resdk/resources/sample.py
Outdated
def set_annotation(self, full_path: str, value) -> Optional["AnnotationValue"]: | ||
"""Create/update annotation value. | ||
|
||
If value is None the annotatioe is deleted and None is returned. |
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.
Typo: annotation
ff2e69d
to
3e8291a
Compare
3e8291a
to
b52797e
Compare
No description provided.