zooniverse / panoptes-cli

A command-line interface for Panoptes
Apache License 2.0
18 stars 5 forks source link

Delete selected subjects from a subject set? #219

Closed denslowm closed 2 years ago

denslowm commented 2 years ago

I am trying to delete several subjects from a subject set (~280). I have a list of the Zooniverse subject IDs in question. First, I wasn't sure if this was possible, but it seems that it is (https://github.com/zooniverse/panoptes-cli/issues/113). Second, can someone provide me with an example command for something like this?

[This isn't really an issue, but a request for help. Let me know if there is a better place to ask this question]

mcbouslog commented 2 years ago

As of Panoptes CLI 1.1.3, we can remove subjects from a subject set by passing a filename of subject IDs with the remove-subjects command. It's not technically deleting the subjects, but I think accomplishes what hoping for?

One recommended way of removing multiple Subjects from a Subject Set is to first move them to a temporary Subject Set, so they can be reviewed before deletion, but this is optional.

To do so, run:

panoptes subject-set create 1111 "Bad Subjects" panoptes subject-set add-subjects -f subject_ids.txt 4444 panoptes subject-set remove-subjects -f subject_ids.txt 2222 <-- this is the key command that I think will help, previous two commands are optional

In this example: subject_ids.txt is a file containing the "bad subjects" to be removed; 1111 is the project ID; 2222 is the ID of the original subject set that contains the "bad subjects"; and 4444 is the ID of the "Bad Subjects" set created in the first step.

Once you've reviewed Subject Set 4444, you can delete it using the CLI, within the Project Builder, or however preferred.

The -f forces the command without prompt for confirmation.

denslowm commented 2 years ago

Yes, this worked perfectly. Good to know that they are removed and not deleted. This is our main goal so that is fine.

Thank you!