Added kwarg to convert_hdf5_to_fits to consistently trim too-long column names
Discovered convert_hdf5_to_fits fails if the column names in .phot.hdf5 file are too long. These column names are typically set by the names of the files from MAST on which the photometry was done.
This fix adds an autotrim kwarg to the function (default to False).
This option, if column names are too long, finds the largest contiguous substring common to the column names that are too long for FITS key names. It then makes a shorter version of those column names. it first attempts to just remove - and _ characters from the column names; and after that, it lops off the beginning characters of the largest contiguous common substring (as these are most likely to be generic fluff). The shortened column name substring is then propagated to all column names that contain the original string.
Codecov Report
:x: Patch coverage is 7.69231% with 36 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 40.42%. Comparing base (b799489) to head (0c88ea7).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| beast/tools/convert_hdf5_to_fits.py | 7.69% | 36 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #842 +/- ##
==========================================
- Coverage 40.55% 40.42% -0.13%
==========================================
Files 107 107
Lines 10320 10358 +38
==========================================
+ Hits 4185 4187 +2
- Misses 6135 6171 +36
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Doc test fail from ACCESS, as with prior PR, and some ADS timeouts? Anyways, not at our end.
Unsure what the coverage issue is... Is that just because the new kwarg isn't True by default, and isn't in the tests?
Unsure what the coverage issue is... Is that just because the new kwarg isn't True by default, and isn't in the tests?
This means the test coverage has decreased. Maybe because there is no test for kwarg? Or even many no test for this entire script.
Doc test fail from ACCESS, as with prior PR, and some ADS timeouts? Anyways, not at our end.
Yep. Might have to give up on having that URL in the docs.