Conversation
|
since you've done both I dont know why we wouldn't implement both. this is going to be great! Thanks @bganglia |
b594237 to
8065281
Compare
|
@nfahlgren
Which style is more fitting for PlantCV - throwing more errors/warnings or making more assumptions? |
|
@bganglia , thanks for all your work on this so far! I think that the first example might make most sense to be handled as if no matching is needed for that type of metadata but also print a warning. For example if someone input The second case with handling special characters such as |
|
Yeah, I think if there are any errors we think would be common/likely it's worth putting some error handling around them, but I think it's okay to make some assumptions for everything else. Just comes down to the amount of effort in writing checks for lots of probably unlikely inputs, of which there could be just about anything. I think this is where the documentation helps, plus users posting issues when they have data that breaks our assumptions that we can then improve the code around. It is possible people will need to use characters like |
|
@HaleySchuhl @nfahlgren That makes sense. I will modify the checklist to include these ideas. Just to be clear, should the syntax |
|
In my thinking it's an error. The default behavior is to not filter on any metadata, so all |
|
@nfahlgren OK. I will raise an error on empty filters instead. |
|
@nfahlgren @HaleySchuhl This PR adds the following:
Internally, the code splits the input into basic units like If I am on the right track, I will wrap up the documentation and mark this PR as completed. If not, I can try to change things or work on something else instead. |
…tial assignments for clarity
|
I think that there is a better approach than the one that I was using here, so I will open a new pull request to replace this one. |
Describe your changes
This PR allows selecting more than one value within each metadata field. For example, this would make it possible to process images from only the first and last dates of an experiment, or some subset of the cameras used.
Type of update
Is this a:
Associated issues
This will close #461
Additional context
In this PR, meta_filters is a dictionary with keys that can be single values or lists. If they are lists, metadata_parser checks whether at least one matches. So this is a valid group of filters:
Two different syntax styles were mentioned in the issue:
a.
--match plantbarcode:A1,plantbarcode:B2,plantbarcode:C3This way is easier for writing CLI scripts that wrap plantcv-workflow.py and simpler to parse in Python.b.
--match plantbarcode:[A1,B2,C3]This way is much easier to read and probably better for experimentation, but harder to parse in Python.In this PR, metadata_parser accepts either/both. For example, the following would all be read in the same way:
--match id:[1,2,3]--match id:1,id:2,id:3--match id:[1,2],id:3If this is too much flexibility, the code could be limited to one style.
To Do
\and quoting