Skip to content

reprojax 0.3.0

Latest

Choose a tag to compare

@leejjoon leejjoon released this 16 Nov 10:38
· 9 commits to main since this release

0.3.0 — 2026-11-16

Host-side WCS handling now goes through
mapprojax.from_astropy, which fixes three latent defects and changes what
is refused.

Fixed

  • Frames at different FK5 equinoxes were treated as identical. Frame
    equivalence was decided by comparing frame names, so two FK5 headers with
    EQUINOX=2000 and EQUINOX=1950 returned the identity rotation and dropped
    a 50-year precession: 2234.6 px at 1"/px over a 512" field. The rotation is
    now computed whenever the frames are not is_equivalent_frame, and checked
    to be orthonormal with determinant +1. ICRS<->FK5(J2000) already rotated and
    still does; that pair is now covered by a regression test.
  • A preserve_units=True header was read as if its units were degrees.
    With CUNIT='arcsec' and CRVAL=(10, 20), the old extractor fed arcsec
    straight into the kernel, so the reference pixel landed 22.2687 deg from
    the origin on the sky where astropy puts it 0.006211 deg away -- a
    22.2625 deg disagreement, ≈80,145 px at 1"/px. Celestial units are now
    converted per axis; the arcsec and degree encodings of the same header
    agree to better than 1e-4 px, and to the astropy pixel oracle.
  • TPV headers were silently flattened to TAN. Astropy reports
    ctype == 'RA---TAN', has_distortion == False and no PV cards for a TPV
    header while still applying the distortion, and the transform cache keyed on
    those raw attributes, so a TPV WCS shared a cache entry with a plain TAN
    WCS. TPV is now refused.
  • A cube reported mapprojax's internal error. A 3-D output_projection
    now refuses with pass a two-axis celestial WCS, e.g. wcs.celestial, for a
    Header and a WCS, before any output grid is allocated. (reprojax's own
    guard; the message is not from_astropy's.)

Changed

  • Refusals raise ValueError, not NotImplementedError. Projection and
    FITS-convention refusals come from mapprojax.from_astropy and carry its
    message. reprojax raises its own ValueError for the frame allow-list, a
    non-rigid rotation, a non-2-D WCS, an unsupported order or kernel, an
    uninferable shape_out, and a bad matrix_precision. A caller catching
    NotImplementedError must catch ValueError instead. A malformed header can
    still fail earlier, inside astropy.wcs.WCS, before reprojax runs.
  • New refusals: inputs 0.2.0 returned a result for.
    • any PV card on TAN, including the identity PV1_1 = 0.0 — 0.2.0
      ignored PV entirely;
    • TAN at CRVAL2 = +90, because wcslib's default there is
      LONPOLE = 0. Note the asymmetry: CRVAL2 = -90 is still accepted,
      since its default is 180;
    • lookup tables (cpdis1/cpdis2, det2im1/det2im2);
    • TPV, and TPD carried as CQDIS/DQ cards. Astropy reports both as
      plain RA---TAN with has_distortion == False and no PV cards, so 0.2.0
      accepted them and silently dropped the distortion;
    • FK4 and FK4-NO-E headers. FK4's E-terms are not a rotation, so it is
      refused rather than approximated; FK4-NO-E is a rigid rotation and could
      be allow-listed later. The ecliptic axes (ELON/ELAT) are refused
      too: astropy resolves them to ICRS, which would be silently wrong.
  • Already refused by 0.2.0, now as ValueError with from_astropy's
    message.
    Unsupported projection codes astropy can still construct — AZP, ZEA
    and the like. 0.2.0 raised NotImplementedError for these; the type changed,
    nothing else did.
  • Unreachable in both versions. A literal RA---TPD CTYPE fails inside
    astropy.wcs.WCS (InconsistentAxisTypesError), and -TAB without its
    WCS-TAB HDU raises MemoryError there. Both die at WCS(header), before
    reprojax runs.
  • Dependency floor: mapprojax[astropy]>=0.4.0,<0.5. Both CI
    constraint files move to mapprojax==0.4.0, and the extra's
    astropy>=7.2.0 floor is already satisfied on both stacks.

Internal

  • _astropy_wcs now owns one validated conversion seam
    (validated_wcs), an explicit frame allow-list (frame_descriptor) and a
    validated rotation (_rotation_from_descriptors); projection_code,
    _wcs_fingerprint and _PROVIDERS are gone.
  • The transform cache key is built from the validated leaves plus a frame
    descriptor, after validation rather than before, so an unsupported input
    cannot be served a cached transform. Warm build_transform costs one
    eager conversion per WCS (~0.4 ms without SIP, ~1.5 ms with order-3 SIP).

Install

pip install reprojax==0.3.0
File SHA-256
reprojax-0.3.0-py3-none-any.whl d6c4e02e1b1708584e6c3ebe4012c4f2e02bb5283d86c15f5ff8c114c193eec3
reprojax-0.3.0.tar.gz 59b537297f18343b7c73e9fb423adadc4631ccd25cafabce48f6f4f45c45a92a