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
Escape regex special characters in FITS keyword values used for IFC filtering #770
Changes from 4 commits
e02e168
5a0527c
9da07c1
5ee135e
42c1135
1956129
7917a5c
f92ab50
fe10eea
a147fbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1100,3 +1100,8 @@ def test_filtered_collection_with_no_files(self, triage_setup): | |
ifc = ImageFileCollection(triage_setup.test_dir) | ||
|
||
ifc_no_files = ifc.filter(object='really fake object') | ||
|
||
def test_filter_with_parenthetical_keyword_values(self, triage_setup): | ||
# Would need test data containing FITS keywords whose values have () | ||
# e.g.: FILTREAR= 'Clear (C)' / Rear Filter | ||
pass | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the short example that @mkelley provided in #769 could be used as the body of the test here, or at least as the start of a test. It generates a FITS file with a special character in it then tries to filter by a value with the special character. I can add a credit to @mkelley for the commit with the test body if you end up using a lot of his sample code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I will add this test this week. Change to use re.escape() already committed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent, thanks! |
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 would fix #769 it were this instead, so that all special characters were escaped: