Skip to content

Include units in Table column descriptions #756

Closed

Description

@eteq

This was discussed briefly in #683 - it would be nice if the basic 'ascii' output from Table also included units information, when present. E.g., writing a table with t.write('filename', format='ascii') where the columns have units should give something like:

#distance time
#meter second
1.2 3.4
5.6 7.8

Activity

  1. eteq commented on Feb 11, 2013

    @eteq
    MemberAuthor

    I tentatuively assigned this to @taldcroft as our table master, but if someone else wants to take it on (or @taldcroft has other priorities), I can un-assign

  2. modified the milestones: v0.3.2, v0.3.1 on Feb 25, 2014
  3. embray commented on May 2, 2014

    @embray
    Member

    This is sort of subsumed by astropy/astropy-APEs#7--if/when something like that happens this will be resolved.

  4. modified the milestones: Future, v0.3.2 on May 2, 2014
  5. taldcroft commented on May 2, 2014

    @taldcroft
    Member

    @eteq - are you OK closing this? As written this issue basically requests inventing a new ASCII table format and (admittedly simple) serialization of table / column meta. I agree with @embray that APE6 will supercede this and produce files that are (more-or-less) human readable and also machine readable.

  6. eteq commented on May 7, 2014

    @eteq
    MemberAuthor

    Hmm... @taldcroft, I guess the question is what happens if APE6 does not go through? Then this is still an issue if I want to round-trip units (which is much more important if we can get Table/Quantity interaction working).

    So I'm perfectly happy to close it when/if APE6 gets merged as it is indeed superceded completely in that case. But perhaps it should be left until then?

  7. taldcroft commented on May 7, 2014

    @taldcroft
    Member

    @eteq - we can leave this open if you want at the conceptual level of wanting unit values to be serialized in some ASCII format. As far as the actual format that was proposed, I would argue strongly against implementing that exact format, so that was the sense in which I thought it should be closed. Either way.

    Even though I've taken a break from APE6 for the 0.4 stuff, it is still a very high priority and I am pretty confident that something will get done which supercedes this.

  8. astrofrog commented on Aug 19, 2014

    @astrofrog
    Member

    @taldcroft - I'd like to request that we still try and have something in addition to APE6. What would be nice is if each reader/writer had an extra option that gave it the ability to add a row with units. We're not talking about adding a new format here, just an option for e.g. the basic reader.

  9. astrofrog commented on Aug 19, 2014

    @astrofrog
    Member

    Basically, given a table with units, it should really be possible to write out a table like @eteq is suggesting.

  10. taldcroft commented on Aug 19, 2014

    @taldcroft
    Member

    @astrofrog - are you talking about an extra data row with units or a list of commented lines as in the example from @eteq?

  11. astrofrog commented on Aug 19, 2014

    @astrofrog
    Member

    Basically an extra header line with the units. If the header is using # as a starting value, then sure.

  12. astrofrog commented on Aug 19, 2014

    @astrofrog
    Member

    See #2869 for an example for fixed width tables

  13. eteq commented on Sep 11, 2014

    @eteq
    MemberAuthor

    @taldcroft @astrofrog - thinking about this a bit more, I would also consider this closed if we implement something like what's discussed in #2869 for fixed with tables. I.e., a format where the units are encoded in the name (in a way that astropy can then read back in correctly). Practically, that's just as good as the example I gave in the original post for this issue.

  14. taldcroft commented on Nov 25, 2019

    @taldcroft
    Member

    From @eteq:

    So I'm perfectly happy to close it when/if APE6 gets merged as it is indeed superceded completely in that case. But perhaps it should be left until then?

    APE6 and ECSV are merged and well-established now. Do you think there is a still a need to create a new ASCII table format that puts units in the second line of a fixed-width table?

  15. taldcroft commented on Nov 25, 2019

    @taldcroft
    Member

    Well, I realized that I just closed #4743 as a dup of this one, so maybe it needs to stay open? Or reopen that one and close this?

  16. removed this from the Future milestone on Apr 8, 2021
  17. adrn commented on Apr 12, 2021

    @adrn
    Member

    IMO, trying to impose a standard for writing/reading units from plain ascii tables is not worth it and will be violated by free-floating ASCII tables more often than it is supported. So, given that ECSV is an option now, I would vote to close this issue.

  18. added
    Close?Tell stale bot that this issue/PR is stale
    on Apr 12, 2021
  19. eteq commented on Apr 12, 2021

    @eteq
    MemberAuthor

    I think I agree with @adrn here, so I'm going to close this. Note there's a more focused version of this issue I'm still interested in, but I'll make a separate issue and link to here since it's more actionable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions