Skip to content

Refactor Table readers and writers to use classes rather than free functions... #962

Closed

Description

@mdboom

...and generally make them more like the readers/writers in io.ascii.

Activity

  1. embray commented on Apr 10, 2013

    @embray
    Member

    👍

  2. astrofrog commented on Apr 16, 2013

    @astrofrog
    Member

    I agree this is a good idea - I won't have time to do this in the next couple of weeks, so if someone else wants to take a stab at it, feel free to!

  3. astrofrog commented on May 31, 2013

    @astrofrog
    Member

    In terms of documentation, I'm starting to try and think how this could work, and I'm a bit worried we could end up with a monster docstring for Table.read. I wonder whether we could have a docstring like:

    Read a Table
    
    If possible, the input format will be determined automatically, but the format
    can also be specified explicitly with the ``format`` argument. Additional
    arguments can be passed depending on the format.
    
    The available formats are:
    
    * ``fits`` - FITS files
    * ``votable`` - VO Table files
    etc.
    
    To find out more about what arguments are available for a specific format, do
    X.
    

    but I have trouble figuring out what X would be (it could be something like t.read_<format>? which would be an auto-generated method but that could be confusing. Also not clear to me is the best way to present this on the website. Ultimately, we want people to be able to easily figure out the arguments needed for a specific format.

  4. taldcroft commented on May 31, 2013

    @taldcroft
    Member

    @astrofrog - I've thought about this a bit previously and the best I came up with was getting help programmatically via something like Table.read(format='ascii', help=True). Even that requires that each connector instance (yes, we really need these to be classes now) has a custom help method that knows about the underlying reader/writer and can fill in the right docstring on request.

    I just had another idea which is a little out there. What about making read and write actually be callable class instances (where they do the usual thing when called), but with methods corresponding to the registered readers. Then Table.read(format='fits', ...) would be the same as Table.read.fits(...), and from there you can have format-specific documentation in the docstring for Table.read.fits.

  5. astrofrog commented on May 31, 2013

    @astrofrog
    Member

    @taldcroft - these are good ideas. One could also have Table.read_help('fits') for the first since it's not clear otherwise whether you mean it should read it anyway, or if it will just show the docstring.

    For the second case, you could consider Table.fits.read in which case fits is the class we are talking about.

  6. taldcroft commented on May 31, 2013

    @taldcroft
    Member

    For the second case, you could consider Table.fits.read in which case fits is the class we are talking about.

    I don't think I would want to clutter the Table attribute space with all the readers, which will include obscure ones like fixed_width_two_line.

  7. astrofrog commented on May 3, 2014

    @astrofrog
    Member

    I'm re-scheduling this and #2063 to 1.0 since I think it will require some more thought/work.

  8. modified the milestones: , v0.4.0, v1.0.0 on May 3, 2014
  9. taldcroft commented on May 3, 2014

    @taldcroft
    Member

    Should we put in #1888 in the meantime then?

  10. astrofrog commented on May 3, 2014

    @astrofrog
    Member

    @taldcroft - yes, that would probably be reasonable. Is #1888 ready for final review in that case?

  11. taldcroft commented on May 3, 2014

    @taldcroft
    Member

    Yes, ready for final review.

  12. 2 remaining items

  13. self-assigned this
    on Jan 13, 2015
  14. modified the milestones: v1.0.0, on Jan 13, 2015
  15. removed this from the v1.1.0 milestone on Sep 29, 2015
  16. astrofrog commented on Sep 29, 2015

    @astrofrog
    Member

    Removing milestone since not 1.1-critical

  17. bsipocz commented on Jun 19, 2019

    @bsipocz
    Member

    Can we close this now?

  18. added
    Close?Tell stale bot that this issue/PR is stale
    on Jun 19, 2019
  19. astropy-bot commented on Jun 26, 2019

    @astropy-bot

    Hi humans 👋 - this issue was labeled as Close? approximately 7 days ago. If you think this issue should not be closed, a maintainer should remove the Close? label - otherwise, I will close this issue in a month.

    If you believe I commented on this issue incorrectly, please report this here

  20. astropy-bot commented on Jul 29, 2019

    @astropy-bot

    I'm going to close this issue as per my previous message, but if you feel that this issue should stay open, then feel free to re-open and remove the Close? label.

    If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions