Support fixed width ASCII table with header rows for dtype, unit, format, description#13734
Merged
hamogu merged 6 commits intoSep 23, 2022
Merged
Conversation
Member
Author
|
@astrofrog - 8 years later and now practicality beats purity - #2869 is now revived in a more general form. |
hamogu
reviewed
Sep 22, 2022
hamogu
left a comment
Member
There was a problem hiding this comment.
I'm amazed every time how little code change is required to add functionality like this. Long live asciitable!
| EXAMPLE START | ||
| Custom Header Rows with Fixed Width Two Line | ||
|
|
||
| The same idea can be used with the ``fixed_width_two_line`` format:: |
Member
There was a problem hiding this comment.
Suggested change
| The same idea can be used with the ``fixed_width_two_line`` format:: | |
| The same idea can be used with the ``fixed_width_two_line`` format. While more than two lines | |
| in the header are expected when using the ``"header_rows"`` keyword, this format has its name from the fact | |
| that the last line in the header (which is line two if no ``"header_rows"`` are given) marks the width of each column:: |
Member
There was a problem hiding this comment.
I wanted to suggest an explanation of what "two_line" means in this context, because it's not too lines. Maybe my text suggestion is not the best, but I think something along those lines should go in there.
hamogu
approved these changes
Sep 23, 2022
This was referenced Sep 27, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds the ability to read and write a fixed width ASCII table that includes additional header rows specifying any or all of the column
dtype,unit,format, anddescription. This is available in thefixed_widthandfixed_width_two_lineformats via the newheader_rowskeyword argument.Fixes #386
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel. Codestyle issues can be fixed by the bot.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.