Skip to content

Read (and write) Notes from Machine-Readable Tables (MRT) in ascii.io #16787

Open

Description

@vandalt

What is the problem this feature will solve?

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.

I also saw this briefly mentioned in another issue about MRT tables.

If no one is currently working or was planning to work on this, I'd be interested to contribute, but I would have two questions:

Cc-ing @Suyog7130 and @hamogu re PR #12039.

Activity

  1. hamogu commented on Jul 31, 2024

    @hamogu
    Member

    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.

  2. dhomeier commented on Aug 22, 2024

    @dhomeier
    Contributor
  3. vandalt commented on Oct 27, 2024

    @vandalt
    ContributorAuthor

    I had some time to look into this recently. Some notes:

    • PR MRT metadata input and subsequent writing [GSoC21c] #12039 implements writing MRT metadata, but not reading. I feel like reading is simpler to implement so I am planning to start with that, but noted down some ideas from MRT metadata input and subsequent writing [GSoC21c] #12039 for when it will be time to implement writing
    • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions