HeaderDiff doesn't recognize ignore_keywords for keyword_count
See original GitHub issueAstropy 4.2.1
Consider the following:
>>> h1 = fits.Header()
>>> h2 = fits.Header()
>>> h1['foo'] = 'bar'
>>> h2['foo'] = 'bar'
>>> h1['foo2'] = 'baz'
>>> diff = fits.HeaderDiff(h1, h2, ignore_keywords=['foo2'])
>>> diff.identical
False
>>> diff..diff_keyword_count
(2, 1)
Based on the documentation for HeaderDiff I would have expect these to be found to be identical. As shown above they are not identical because they have a different number of keywords, even though I’m trying to ignore one of them.
I did a quick check of some of the other *Diff
methods and they seem to all suffer from the same issue.
Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Source code for astropy.io.fits.diff
Wildcard strings may also be included in the list. ignore_keywords : sequence, optional Header keywords to ignore when comparing two headers; the presence ......
Read more >Google Explains How to Use Headings for SEO
That's it. Mueller explains that keywords in headings are not required for ranking: So it's not so much that suddenly your page ranks...
Read more >diff-options Documentation - Git
Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination. This ignores the...
Read more >Reading between keywords in file, skipping lines, using Python
Stop reading at the END keyword. My issue is that I also need to skip out 'header lines' in the file when I...
Read more >How Links in Headers, Footers, Content, and Navigation Can ...
Is it doesn't count the same multiple links for the same keyword in a post or for all different anchor texts for the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could go digging deeper, but my suspicion is that
ignore_keywords
just isn’t taken into account in all cases. I think it’s probably used more when comparing just the values of individual keywords, but not the presence, or lack thereof, of some keyword.I think your interpretation of how the option should work is valid, and patches would be welcome (though it might lead to breaking some things in some pipelines that have relied somehow on the existing behavior, but I’m open to only worrying about that if the case arises…)
Referencing here #5757 and #7763 for useful discussions.