Include space between fields when writing ASCII tables
- Dominant language
- Python
- Stars
- 5.3k
- Forks
- 2.2k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 74
Description
In FITS ASCII tables it is permissible that each field is exactly adjacent to the previous one with no space between them. The widths of the fields are known and fixed, so this is perfectly readable for software. However, according to the FITS standard: "A common convention is to include a space character between each field for added legibility if the table row is displayed verbatim."
PyFITS/Astropy does not do this--it takes the most compact option by default. But for ASCII tables compactness should be less of a concern than verbatim readability. Users can already work around this by adjusting the `TBCOL` keywords (via the `.start` attribute on `Column` objects). But it would be nice if the default were to insert one space between each field to improve readability.
Related, the FITS standard also contains:
> It is also permissible to add control characters,
> such as a carriage return or line feed character, following the last
> field in each row as a way of formatting the table if it is printed
> or displayed by a text editing program.
This would be nice too.
Contributor guide
Research direction
Start by locating the FITS ASCII table writer and its existing tests, then read how Column.start and TBCOL currently determine field positions. Done means the default output has one space between adjacent fields while preserving fixed-width validity; clarify separately whether trailing control characters are in scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100