You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read (and write) Notes from Machine-Readable Tables (MRT) in ascii.io #16787
Currently, when reading MRT tables, the Notes section seems to be ignored. It would be nice to make it accessible, even only as a string, so that users can interact with Notes without re-reading the table.
Writing is probably more complex, but would also be nice.
Describe the desired outcome
The desired outcome would be for MRT table notes to be accessible through the table object, either as formatted metadata or as a single string.
Additional context
Some work on this seems to have been done in PR #12039.
Hi @vandalt ! This is absolutely a feature we'd like to have and thanks for offering to work on this! That's why a student worked on it in summer 2021. Unfortunately, he didn't manage to finish it before his GoogleSummerOfCode was over, so the PR was never finished and eventually closed. I think looking back at that PR and the discussion there is a good start - however keep in mind that the PR was not finished and the implementation started that might not be the best possible (if it was, the PR would have been merged!).
I'm looking forward to hear from you in a PR or in discussion in this issue.
My current plan is to store everything in the meta attribute of the table, with entries for Title, Author and Table pointing to their respective values, and a notes entry pointing to a list of notes. MrtHeader.update_meta() seems like the best place to implement this, so I will start with that in a draft PR (hopefully later today or in the next week).
@dhomeier the link you shared points to the "round trip" test that is currently merged in astropy I think, which does not handle notes. The current implementation only adds and empty "Notes:" field after the byte-by-byte description when writing and ignores notes when reading. But that would indeed be my starting point and ultimately the round trip test should handle notes properly
Activity
hamogu commentedon Jul 31, 2024
Hi @vandalt ! This is absolutely a feature we'd like to have and thanks for offering to work on this! That's why a student worked on it in summer 2021. Unfortunately, he didn't manage to finish it before his GoogleSummerOfCode was over, so the PR was never finished and eventually closed. I think looking back at that PR and the discussion there is a good start - however keep in mind that the PR was not finished and the implementation started that might not be the best possible (if it was, the PR would have been merged!).
I'm looking forward to hear from you in a PR or in discussion in this issue.
dhomeier commentedon Aug 22, 2024
As a start, would the functionality tested in
https://github.com/Suyog7130/astropy/blob/b985efc9cad13073e7f173567480b6d3567f1530/astropy/io/ascii/tests/test_cds.py#L23
ff. address some or all of your needs?
vandalt commentedon Oct 27, 2024
I had some time to look into this recently. Some notes:
metaattribute of the table, with entries forTitle,AuthorandTablepointing to their respective values, and anotesentry pointing to a list of notes.MrtHeader.update_meta()seems like the best place to implement this, so I will start with that in a draft PR (hopefully later today or in the next week).