Skip to content

Comments

fix: swev-id: astropy__astropy-14539 handle FITSDiff Q VLAs#128

Open
casey-brooks wants to merge 1 commit intoastropy__astropy-14539from
fix/fitsdiff-q-vla
Open

fix: swev-id: astropy__astropy-14539 handle FITSDiff Q VLAs#128
casey-brooks wants to merge 1 commit intoastropy__astropy-14539from
fix/fitsdiff-q-vla

Conversation

@casey-brooks
Copy link

Issue

Closes #127.

Observed failure

  • FITSDiff skipped Q-format variable-length array (VLA) columns because the comparison logic only treated P descriptors as VLA data, so row-wise differences went unreported.

Reproduction

  1. Create two binary tables that include a format="QE" column.
  2. Modify the VLA payload in one row of the second table.
  3. Run FITSDiff(file_a, file_b, rtol=0, atol=0).identical incorrectly returns True and the report omits the column.

Changes

  • Update TableDataDiff to treat Q-format descriptors as VLA columns alongside P descriptors.
  • Add regression tests covering Q-format VLAs (identical self-compare, differing payload, mixed fixed-width columns) plus a parity check for the existing P-format path.

Testing

  • PYTHONPATH=. LD_LIBRARY_PATH='/nix/store/sbfrl6127w424l34lsq0lzryibq1226j-gcc-15.2.0/lib:/nix/store/h4qhxh7vwmxgy6w05g0xsf6r1bfi9vga-gcc-15.2.0-lib/lib:/nix/store/dvb9i3s69j29md1hpx3gpaqqds6530df-gcc-15.2.0-libgcc/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib' SETUPTOOLS_USE_DISTUTILS=stdlib .venv/bin/python -m pytest astropy/io/fits/tests/test_diff.py -k vla_q (3 passed)
  • PYTHONPATH=. LD_LIBRARY_PATH='/nix/store/sbfrl6127w424l34lsq0lzryibq1226j-gcc-15.2.0/lib:/nix/store/h4qhxh7vwmxgy6w05g0xsf6r1bfi9vga-gcc-15.2.0-lib/lib:/nix/store/dvb9i3s69j29md1hpx3gpaqqds6530df-gcc-15.2.0-libgcc/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib' SETUPTOOLS_USE_DISTUTILS=stdlib .venv/bin/python -m pytest astropy/io/fits/tests/test_diff.py (52 passed)
  • SETUPTOOLS_USE_DISTUTILS=stdlib .venv/bin/tox -e codestyle -- --files astropy/io/fits/diff.py astropy/io/fits/tests/test_diff.py (pass)

@casey-brooks casey-brooks requested a review from a team January 6, 2026 13:45
@casey-brooks
Copy link
Author

Local test & lint results:

  • PYTHONPATH=. LD_LIBRARY_PATH='/nix/store/sbfrl6127w424l34lsq0lzryibq1226j-gcc-15.2.0/lib:/nix/store/h4qhxh7vwmxgy6w05g0xsf6r1bfi9vga-gcc-15.2.0-lib/lib:/nix/store/dvb9i3s69j29md1hpx3gpaqqds6530df-gcc-15.2.0-libgcc/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib' SETUPTOOLS_USE_DISTUTILS=stdlib .venv/bin/python -m pytest astropy/io/fits/tests/test_diff.py -k vla_q → 3 passed
  • PYTHONPATH=. LD_LIBRARY_PATH='/nix/store/sbfrl6127w424l34lsq0lzryibq1226j-gcc-15.2.0/lib:/nix/store/h4qhxh7vwmxgy6w05g0xsf6r1bfi9vga-gcc-15.2.0-lib/lib:/nix/store/dvb9i3s69j29md1hpx3gpaqqds6530df-gcc-15.2.0-libgcc/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib' SETUPTOOLS_USE_DISTUTILS=stdlib .venv/bin/python -m pytest astropy/io/fits/tests/test_diff.py → 52 passed
  • SETUPTOOLS_USE_DISTUTILS=stdlib .venv/bin/tox -e codestyle -- --files astropy/io/fits/diff.py astropy/io/fits/tests/test_diff.py → lint passed

Copy link

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Treating Q-format descriptors as VLAs in TableDataDiff resolves the false positives, and the new tests cover self-compare, delta-detect, mixed columns, and parity with P formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants