question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HeaderDiff doesn't recognize ignore_keywords for keyword_count

See original GitHub issue

Astropy 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:open
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
embraycommented, May 31, 2021

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…)

0reactions
cmarmocommented, Sep 19, 2022

Referencing here #5757 and #7763 for useful discussions.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found