Skip to content

Cleanup uses of prihdr and header in the FITS docs #6643

Closed

Description

@astrofrog

@MSeifert04 fixed an instance of variable names changing half way through the io.fits docs in one place - however there are other places where this happens, e.g. in the headers.rst file:

https://github.com/astropy/astropy/blame/master/docs/io/fits/usage/headers.rst#L138

Fundamentally the issue is that we are skipping the doctests in all these files, which is bad! We really should fix the examples so they actually run (and with data we can put on data.astropy.org, no excuse really)

I also think header makes more sense than prihdr as a variable name. It would be great to fix this soon since there have been some complaints/confusion.

Activity

  1. MSeifert04 commented on Oct 2, 2017

    @MSeifert04
    Contributor

    @astrofrog You're right. I actually opened astropy/pytest-remotedata#5 because that would allow to conditionally run the doctests when remote data is given.

    I would actually hate to riddle the code with doctest: +REMOTE_DATA comments.

  2. bsipocz commented on Oct 2, 2017

    @bsipocz
    Member

    This seems to be the duplicate of #6010

  3. saimn commented on Oct 2, 2017

    @saimn
    Contributor

    This seems to be the duplicate of #6010

    Yep (I was looking for the issue number).

  4. self-assigned this
    on Oct 2, 2017
  5. astrofrog commented on Oct 2, 2017

    @astrofrog
    MemberAuthor

    @bsipocz - ah yes, though not quite a duplicate, here I mean specifically we need to improve consistency of the variable names, i.e. we could enable doctests and keep inconsistent variable names between pages. This issue is first and foremost about fixing the current names, which we could do before the pytest plugin has what @MSeifert04 needs.

  6. saimn commented on Oct 2, 2017

    @saimn
    Contributor

    I also think header makes more sense than prihdr as a variable name.

    For the specific case addressed by #6628, I'm not sure: sometimes header is too generic, difficult to search for in a page. prihdr is easier to spot, and there is less chance that it is already defined for another unrelated example. So just to say that using header everywhere is maybe not the solution.

  7. astrofrog commented on Oct 2, 2017

    @astrofrog
    MemberAuthor

    @saimn - right, I see your point. Maybe hdr is a solution too (just because it might not be clear what the pri stands for). As long as a beginner can follow the examples easily then I don't mind :)

  8. bsipocz commented on Oct 2, 2017

    @bsipocz
    Member

    (also, to be honest I feel that @embray had a valid point, and while stuff is still needed to be cleaned up, should complaints like that always trigger the highest priority?)

  9. pllim commented on Oct 2, 2017

    @pllim
    Member

    @drdavella was working on making those FITS tests run.

  10. MSeifert04 commented on Oct 2, 2017

    @MSeifert04
    Contributor

    @pllim Thanks for the info, I was just about to start working on this. 😄

  11. pllim commented on Oct 2, 2017

    @pllim
    Member

    Not sure if he's still working on it, given ASDF and pytest work. But if he's not, at least grab what he has already done first before duplicating work. FYI.

  12. astrofrog commented on Oct 2, 2017

    @astrofrog
    MemberAuthor

    (also, to be honest I feel that @embray had a valid point, and while stuff is still needed to be cleaned up, should complaints like that always trigger the highest priority?)

    The priority high label is a bit too much I agree, but to me cleaning up the docs should actually take precedence on internal code cleanup. I just wanted to make sure this didn't get ignored (it worked!).

  13. drdavella commented on Oct 2, 2017

    @drdavella
    Contributor

    @pllim, @MSeifert04, unfortunately this is near the bottom of my to-do list at the moment. I pushed some work to https://github.com/drdavella/astropy/tree/enable-fits-doctest. I didn't get too far with it, but maybe it's a good starting point.

  14. MSeifert04 commented on Oct 2, 2017

    @MSeifert04
    Contributor

    thanks for the fast reply @drdavella , I'll have a look at your PR and see how far I can get 😄

  15. saimn commented on Oct 7, 2017

    @saimn
    Contributor

    Closing since #6664 addressed this (using hdr instead of prihdr).

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