Repository navigation
refactor(wcs)!: Drop the WCS keyword table, invalidate the cached WCS on any header write - #126
Merged
Merged
Conversation
… on any header write
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #126 +/- ##
==========================================
+ Coverage 61.13% 61.95% +0.82%
==========================================
Files 9 9
Lines 1078 1062 -16
==========================================
- Hits 659 658 -1
+ Misses 419 404 -15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setindex!on anAstroImageheader key previously consulted a ~250-lineWCS_HEADERS_TEMPLATEStable (expanded into an exact-matchSet) to decide whether to mark the cachedWCSTransformstale. Such a filter can't be complete. WCS keywords span Papers I–IV plus legacy conventions, with unbounded axis indices andA–Zalternate-system suffixes, and the table had real holes: the expansion only covered axis indices 1–4 and lowercase alternate suffixes, so e.g.img["CRPIX5"] = 3.0orimg["CRPIX1A"] = 3.0silently left a stale transform in use.Now any header write marks the cached WCS stale, and it is lazily re-parsed on the next
wcs()access. Re-parsing is cheap and header writes are rare, so the extra invalidations cost effectively nothing, while false negatives are gone by construction. The staleness regression test now covers the previously-missed key classes.Breaking only in the internal sense: the unexported
WCS_HEADERS_TEMPLATES/WCS_HEADERSconstants are gone, and cache invalidation is now unconditional rather than keyword-filtered.Split out from #119