Skip to content

Comments

swev-id: astropy__astropy-14365 accept lowercase QDP commands#121

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

swev-id: astropy__astropy-14365 accept lowercase QDP commands#121
casey-brooks wants to merge 1 commit intoastropy__astropy-14365from
fix/qdp-case-insensitive

Conversation

@casey-brooks
Copy link

Summary

  • make QDP command detection case-insensitive and reject unknown directives
  • strip inline comments before parsing READ SERR/TERR arguments
  • document the behavior and add regression tests for command variations

Observed Failure

  • Steps to reproduce:
    cat > test.qdp <<'QDP'
    read serr 1 2
    1 0.5 1 0.5
    QDP
    python - <<'PY'
    from astropy.table import Table
    Table.read('test.qdp', format='ascii.qdp')
    PY
    
  • Stack trace excerpt:
    ValueError: Unrecognized QDP line: read serr 1 2
    

Testing

  • 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 SETUPTOOLS_USE_DISTUTILS=stdlib PYTHONPATH=. .venv/bin/pytest astropy/io/ascii/tests/test_qdp.py -k qdp
  • SETUPTOOLS_USE_DISTUTILS=stdlib .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,E222,E711'

Resolves #119.

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

Local validation

  • 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 SETUPTOOLS_USE_DISTUTILS=stdlib PYTHONPATH=. .venv/bin/pytest astropy/io/ascii/tests/test_qdp.py -k qdp (14 passed)
  • SETUPTOOLS_USE_DISTUTILS=stdlib .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,E222,E711' (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.

Looks good. Case-insensitive command detection, inline comment trimming, and regression coverage all check out.

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