Skip to content
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

Remove --doc-filter option from CLI. #795

Merged
merged 4 commits into from
Aug 30, 2022
Merged

Remove --doc-filter option from CLI. #795

merged 4 commits into from
Aug 30, 2022

Conversation

bdice
Copy link
Member

@bdice bdice commented Aug 1, 2022

Description

This PR resolves #613 by removing the --doc-filter argument from the signac CLI. Users who wish to search by a document filter should replace syntax as shown below:

Before (simple syntax):
$ signac find --doc-filter a 0
After (simple syntax):
$ signac find doc.a 0

Before (JSON syntax):
$ signac find --doc-filter '{"a": 0}'
After (JSON syntax):
$ signac find '{"doc.a": 0}'

Motivation and Context

The general feature of searching by document filters has been replaced by a generalized filter syntax that prefixes state point keys with sp. and document keys with doc.. This applies that change from #586 to the CLI.

Checklist:

@codecov
Copy link

codecov bot commented Aug 1, 2022

Codecov Report

Merging #795 (bda219a) into next (52ff017) will decrease coverage by 1.32%.
The diff coverage is 78.53%.

@@            Coverage Diff             @@
##             next     #795      +/-   ##
==========================================
- Coverage   86.32%   84.99%   -1.33%     
==========================================
  Files          51       54       +3     
  Lines        4687     4672      -15     
  Branches     1022     1011      -11     
==========================================
- Hits         4046     3971      -75     
- Misses        456      522      +66     
+ Partials      185      179       -6     
Impacted Files Coverage Δ
signac/common/deprecation/__init__.py 0.00% <0.00%> (ø)
signac/common/errors.py 100.00% <ø> (ø)
signac/contrib/__init__.py 100.00% <ø> (ø)
signac/contrib/errors.py 94.11% <ø> (ø)
signac/synced_collections/_caching.py 0.00% <0.00%> (ø)
..._collections/buffers/memory_buffered_collection.py 100.00% <ø> (ø)
...ignac/synced_collections/data_types/synced_list.py 85.98% <ø> (ø)
signac/synced_collections/validators.py 91.48% <ø> (ø)
signac/testing.py 100.00% <ø> (ø)
signac/contrib/import_export.py 77.24% <71.42%> (-0.18%) ⬇️
... and 47 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

@bdice bdice marked this pull request as ready for review August 1, 2022 04:30
@bdice bdice requested review from a team as code owners August 1, 2022 04:30
@bdice bdice requested review from kidrahahjo and lyrivera and removed request for a team August 1, 2022 04:30
Copy link
Collaborator

@kidrahahjo kidrahahjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding tests for these changes? I am not sure if we already have them or not. Also, I see a lot of lines not covered by us. Although not in scope for this PR, should we worry about this?

The changes looks good to me, if we decide to add tests, happy to re-review :)

@bdice
Copy link
Member Author

bdice commented Aug 1, 2022

@kidrahahjo Thanks for the questions! The new unified filter syntax is already testing document filters, just below where I deleted the tests for the old --doc-filter flag.

Codecov is extra noisy on this PR but I don’t think we are really missing anything new. The baseline coverage measurement for the next branch may be wrong because I just force-pushed some changes. I think this PR’s coverage is fine because we’re just removing a feature.

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we don't have to worry about the Codecov diff for now. Otherwise these changes LGTM.

@@ -32,7 +32,7 @@
from . import get_project, init_project
from .common import config
from .common.configobj import Section, flatten_errors
from .contrib.filterparse import _add_prefix, parse_filter_arg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that _add_prefix can be removed entirely at this point. I can verify that and create a separate issue for that though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdice bdice merged commit e4c75d3 into next Aug 30, 2022
@bdice bdice deleted the remove-doc-filter-cli branch August 30, 2022 22:28
bdice added a commit that referenced this pull request Oct 7, 2022
* Remove --doc-filter from CLI.

* Minor docstring improvements.

* Remove --doc-filter tests.

* Update changelog.
bdice added a commit that referenced this pull request Oct 27, 2022
* Remove --doc-filter from CLI.

* Minor docstring improvements.

* Remove --doc-filter tests.

* Update changelog.
vyasr pushed a commit that referenced this pull request Oct 30, 2022
* Remove --doc-filter from CLI.

* Minor docstring improvements.

* Remove --doc-filter tests.

* Update changelog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants