Skip to content

Comments

swev-id: astropy__astropy-14365 - ascii.qdp: accept lowercase/mixed-case QDP commands (READ SERR/TERR)#120

Closed
casey-brooks wants to merge 1 commit intoastropy__astropy-14365from
fix/qdp-case-insensitive-commands
Closed

swev-id: astropy__astropy-14365 - ascii.qdp: accept lowercase/mixed-case QDP commands (READ SERR/TERR)#120
casey-brooks wants to merge 1 commit intoastropy__astropy-14365from
fix/qdp-case-insensitive-commands

Conversation

@casey-brooks
Copy link

Summary

  • make the READ SERR/TERR command pattern case-insensitive with a scoped inline flag
  • add regression coverage reading lowercase directives to confirm error column parsing

Testing

  • SETUPTOOLS_USE_DISTUTILS=stdlib PYTHONPATH=. LD_LIBRARY_PATH=/nix/store/wffgswxkp55xi14jy63rjsnfvl2qvmxy-gcc-14.3.0-lib/lib:/nix/store/qipd93x9gjyiygqk673rd2ssnf8y7jj0-gcc-14.3.0-lib/lib:/nix/store/zmjqwzhgl9hwr8xnk8raj8d50lzkql66-gcc-14.3.0-lib/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib .venv/bin/python -m pytest astropy/io/ascii/tests/test_qdp.py
  • SETUPTOOLS_USE_DISTUTILS=stdlib PYTHONPATH=. LD_LIBRARY_PATH=/nix/store/wffgswxkp55xi14jy63rjsnfvl2qvmxy-gcc-14.3.0-lib/lib:/nix/store/qipd93x9gjyiygqk673rd2ssnf8y7jj0-gcc-14.3.0-lib/lib:/nix/store/zmjqwzhgl9hwr8xnk8raj8d50lzkql66-gcc-14.3.0-lib/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib .venv/bin/flake8 astropy/io/ascii/qdp.py astropy/io/ascii/tests/test_qdp.py --per-file-ignores='astropy/units/tests/test_units.py:F841,E501,E711,E222'

Reproduction

# Create test.qdp
read serr 1 2
1 0.5 1 0.5

Observed error

>>> from astropy.table import Table
>>> Table.read('test.qdp', format='ascii.qdp')
WARNING: table_id not specified. Reading the first available table [astropy.io.ascii.qdp]
Traceback (most recent call last):
...
ValueError: Unrecognized QDP line: read serr 1 2

Fixes #115

@casey-brooks casey-brooks requested a review from a team December 27, 2025 20:04
@casey-brooks
Copy link
Author

Test & Lint Summary

  • SETUPTOOLS_USE_DISTUTILS=stdlib PYTHONPATH=. LD_LIBRARY_PATH=/nix/store/wffgswxkp55xi14jy63rjsnfvl2qvmxy-gcc-14.3.0-lib/lib:/nix/store/qipd93x9gjyiygqk673rd2ssnf8y7jj0-gcc-14.3.0-lib/lib:/nix/store/zmjqwzhgl9hwr8xnk8raj8d50lzkql66-gcc-14.3.0-lib/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib .venv/bin/python -m pytest astropy/io/ascii/tests/test_qdp.py → 9 passed (with expected local-install warning about version detection)
  • SETUPTOOLS_USE_DISTUTILS=stdlib PYTHONPATH=. LD_LIBRARY_PATH=/nix/store/wffgswxkp55xi14jy63rjsnfvl2qvmxy-gcc-14.3.0-lib/lib:/nix/store/qipd93x9gjyiygqk673rd2ssnf8y7jj0-gcc-14.3.0-lib/lib:/nix/store/zmjqwzhgl9hwr8xnk8raj8d50lzkql66-gcc-14.3.0-lib/lib:/nix/store/n5lymg0y5x6i9wipkjrsi8aczv1nr4qc-zlib-1.3.1/lib .venv/bin/flake8 astropy/io/ascii/qdp.py astropy/io/ascii/tests/test_qdp.py --per-file-ignores='astropy/units/tests/test_units.py:F841,E501,E711,E222' → no issues

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.

Inline-scoping the ignorecase flag keeps the command matcher flexible without affecting other tokens, and the new regression test covers lowercase SERR/TERR directives end-to-end. This resolves #115 for me—thanks!

@rowan-stein
Copy link
Collaborator

Closing to enforce single open PR per task (ID: 10). Please refer to PR #121 for the active work.

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.

3 participants