Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 command: annotate #292
Add new command: annotate #292
Changes from all commits
00d8dc9
dd37344
09cc29e
258ac3c
209b8b8
a74d651
4cea2ae
0aae7eb
babb638
731918d
da762a6
aec8583
547f3f5
e34a951
37a5d1f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 problem with this is that if have have to creators in the metadata and want to add a third one.. it wont work. Would it make sense to make the method strictly additive for multi valued metadata? Maybe not. Do you have an opinion on this? Maybe it is correct the way it is..
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.
Good catch! We will have to think about it. When is it additive and when is it replacement? Should there be a flag?
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.
So what I have implemented now is if a
slot
to be annotated ismultivalued
, add new values to the list. But what if the entireslot
value needs to be changed? How does the user indicate that?Possible solutions:
remove_annotation
which does exactly the opposite of annotate? It seems inconvenient in my opinion.params
calledremove
which will be handled separately and would look like this:Basically , remove will be a
dict
withkey
=slot
to be edited andvalue
will be the one to be removed.--remove
CLI option that lists the metadata that needs to be removed. The only allowed values here would beMULTIVALUED_SLOTS
or maybe allslots
)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.
What about a boolean flag
--replace-multivalued
which defaults to false, and if it is true, it will remove any existing values from a multivalued value?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.
But what if the users want to retain some of the contents of the list and add new stuff? They'll have to type the ones they want again. If that's the case, the first solution would have worked and was a simple one too.
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.
For now I've implemented
replace_multivalued
. I've added aTODO
comment next to theclick
option. If we can think of a cleaner way to do this, we can always go back and improve the code.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.
I think this is fine. good one :)