refactor: drop sip_tpv, rely on astropy for TPV WCS (closes #713)#716
Open
cailmdaley wants to merge 1 commit intodevelopfrom
Open
refactor: drop sip_tpv, rely on astropy for TPV WCS (closes #713)#716cailmdaley wants to merge 1 commit intodevelopfrom
cailmdaley wants to merge 1 commit intodevelopfrom
Conversation
Closes #713. The only functional use of sip_tpv in shapepipe was `split_exp.create_hdus` calling `stp.pv_to_sip(h)` to rewrite each per-CCD header's TPV distortion keywords as SIP before saving. Modern astropy (>=5) parses TPV natively via WCSLIB, as do SExtractor, PSFEx, and every other downstream WCS consumer in the pipeline, so the keyword-level conversion was no longer buying us anything. Removing the conversion lets us drop sip_tpv entirely — an unmaintained 2017 package whose v1.1 imports `pkg_resources` at module load and is incompatible with setuptools>=81 (the underlying cause of the ModuleNotFoundError in #713; PR #714's setuptools<81 pin is a symptom workaround). Changes: - split_exp: remove sip_tpv import + pv_to_sip call; drop the now-dead `transf_coord` plumbing through `process` / `create_hdus`; update module docstring accordingly. - Remove sip_tpv from `depends=[...]` in split_exp_runner, python_example_runner, and find_exposures_runner (the last was a spurious declaration — find_exposures_package never imported it). - Drop sip_tpv from environment.yml, environment-dev.yml, Dockerfile, install_shapepipe, docs/source/dependencies.md, and the orphan shupe:12 BibTeX entry. - New: `src/shapepipe/tests/test_split_exp.py` — three unittests that build a synthetic multi-CCD FITS with TPV distortion, run SplitExposures, and verify (1) per-CCD header WCS matches the source for several pixel samples, (2) the saved headers .npy round-trips pixel→world→pixel, (3) flag output uses int16. `scripts/jupyter/wcs.ipynb` still imports sip_tpv; it's an exploratory notebook last touched ~2.5 years ago and left alone.
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.
Summary
Removes the
sip_tpvdependency from shapepipe entirely. Modern astropy (≥5) parses TPV distortion natively via WCSLIB, as do SExtractor, PSFEx, and every other downstream WCS consumer in the pipeline, so the keyword-levelpv_to_sipconversion thatsplit_expused to run was no longer buying us anything.Dropping the conversion lets us drop
sip_tpvitself — an unmaintained 2017 package whose v1.1 importspkg_resourcesat module load and is therefore incompatible withsetuptools>=81. That's the actual root cause of #713 (rewritten to reflect this). PR #714'ssetuptools<81pin is a symptom workaround that becomes unnecessary oncesip_tpvis gone.What changed
Code
split_exp_package/split_exp.py: dropimport sip_tpv as stpand thestp.pv_to_sip(h)call; remove the now-deadtransf_coordparameter fromprocess/create_hdus; fix the module docstring.split_exp_runner.py,python_example_runner.py: removesip_tpvfromdepends=[…].find_exposures_runner.py: removesip_tpvfromdepends=[…]— spurious declaration,find_exposures_packagenever imported it.Environment
environment.yml,environment-dev.yml,Dockerfile,install_shapepipe: dropsip_tpv.docs/source/dependencies.md: drop thesip_tpvrow.docs/source/refs.bib: drop the orphanshupe:12entry.Tests (new)
src/shapepipe/tests/test_split_exp.py: three unittests that build a synthetic multi-CCD FITS with TPV distortion, runSplitExposures, and verify:headers*.npyside-output round-tripspixel → world → pixel.flagoutput files are stored asint16.All four modules in
src/shapepipe/tests/still pass locally (7/7).Not touched
scripts/jupyter/wcs.ipynbstill importssip_tpv— it's an exploratory notebook last edited ~2.5 years ago. Left alone to keep the diff scoped.Interaction with open PRs
setuptools<81as a workaround. Once this PR merges, that pin can come out. If fix: small develop bugs (#709, #711, #712, #713) #714 merges first the pin becomes dead code; happy to follow up with a cleanup commit in either direction.tests/unit/and includes an xfailed import test forshapepipe.modules.split_exp_package.split_exp. That test should xpass once either this PR or thesetuptools<81pin lands.Reviewer Checklist
developbranch