Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-6718

afw table and record should have useful str() and repr()

    Details

    • Templates:
    • Story Points:
      2
    • Sprint:
      Alert Production S17 - 5, Alert Production S17 - 6, Alert Production F17 - 7
    • Team:
      Alert Production

      Description

      To see the contents of an afw table in python, you have to do something like

      catalog[0].extract("*")

      which is totally not discoverable and returns a dict which doesn't print well. Much more useful would be for str() on a record to produce a pretty-printed list of the contents, and str() on a table to produce some nicely formatted summary (like a numpy recarray does, only printing a few things separated "..." for large tables).

      I'm not sure what the best repr() output would be (certainly for a Record it should be a full dump of the contents), but currently table.repr()==table.str(), which is equally unhelpful.

      Maybe this will come "for free" when we get astropy.table views, but it makes exploring the contents of a table a pain right now.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  Parejkoj John Parejko
                  Reporter:
                  Parejkoj John Parejko
                  Reviewers:
                  Nate Lust
                  Watchers:
                  Colin Slater, Jim Bosch, John Parejko, John Swinbank, Nate Lust, Russell Owen, Simon Krughoff
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel