Skip to content

graphics missing plots in documentation #834

Closed

Description

@josef-pkt

several graphics functions don't have examples that create plots

Activity

  1. jtweeder commented on Sep 21, 2018

    @jtweeder
    Contributor

    Seems like an easy enough task to start working on, and would be useful to users. Also looks like good examples already exist to learn from. Below is a task list of the ones I have found at first glance. If there are any others let me know and I can add them.

    Looking through the Graphics module
    I can see the following do not have any examples:

    These have examples that would produce a plot (minor tweaking may be needed), but do not display the plot in the example:

  2. josef-pkt commented on Sep 21, 2018

    @josef-pkt
    MemberAuthor

    @thequackdaddy @bashtage
    Is it possible to link from docstrings to notebooks as reference?

    In cases where we have a more extensive notebook it would be useful to be able to link to them for further examples.

  3. bashtage commented on Sep 21, 2018

    @bashtage
    Member

    I don't know an easy way. It is possible to link from rst files to notebooks using nbsphinx and standard ref tags, but this would be big change in the doc build process since this has sphinx run the notebooks as part of the build and the notebooks are located inside the docs (this can be worked around by copying them into the docs early in conf.py)

  4. bashtage commented on Sep 21, 2018

    @bashtage
    Member

    Of course, one could add a note and say see examples\NBNAME

  5. thequackdaddy commented on Sep 21, 2018

    @thequackdaddy
    Member

    I think the docs do it just by showing a relative link... e.g., in RLM...
    https://raw.githubusercontent.com/statsmodels/statsmodels/ec28d8939f14fa90fea0663ddc466f0832a27249/docs/source/rlm.rst

    * `Robust Models 1 <examples/notebooks/generated/robust_models_0.html>`__
    * `Robust Models 2 <examples/notebooks/generated/robust_models_1.html>`__
    
  6. bashtage commented on Sep 21, 2018

    @bashtage
    Member

    External URLs work from rst but wouldn't work from a docstring in practice.

    If one was really desperate, I think it would be possible to have a page with a list of the notebooks where each has an annotation, and then the docstring could have a ref to the annotation. I think this would be pretty clunky, and it would be far simpler to just tell the user to look at the example notebooks for more complete examples of the use of a model.

  7. jtweeder commented on Sep 22, 2018

    @jtweeder
    Contributor

    I will work through the list with all of that in mind and post a PR when I get them completed. I will see what looks clean with trying to integrate some links or 'see...' comments as needed.

  8. jtweeder commented on Sep 23, 2018

    @jtweeder
    Contributor

    I have gotten what I think should be working into my branch of the partial regression docstring. I ran make clean and make html but nothing changed in my local version of the documents. I wanted to make sure I was not missing something before moving on to prevent having to rework.

    Also is there a way to only rebuild the particular doc page I would expect changes on. Not totally comfortable with sphinx yet so I wanted to make sure everything was showing up like I wanted, but did not want to wait for an entire rebuild every time.

  9. josef-pkt commented on Sep 23, 2018

    @josef-pkt
    MemberAuthor

    sphinx normally figures out what changed and only rebuilds those pages.
    What I sometimes do, is to delete some of the generated rst files so sphinx is forced to rebuild them.

  10. bashtage commented on Sep 23, 2018

    @bashtage
    Member
  11. josef-pkt commented on Sep 23, 2018

    @josef-pkt
    MemberAuthor

    @jtweeder Is your branch installed and on the python path?
    I haven't checked in a while, but AFAIR, sphinx uses the installed statsmodels for the docstring and not the one in a local checkout

  12. jtweeder commented on Sep 23, 2018

    @jtweeder
    Contributor

    Thanks @josef-pkt that appears to be the issue! I knew it had to be something I was doing and assumed it was looking in my local checkout, which was a silly assumption.

  13. josef-pkt commented on Sep 23, 2018

    @josef-pkt
    MemberAuthor

    It's not a silly assumption, I ran into this a few times (that's why it finally sounded familiar).
    But sphinx has to import the code and doesn't just parse the source tree, which allows us to use programmatically created docstrings.

  14. bashtage commented on May 8, 2019

    @bashtage
    Member

    Fixed in #5309 and #5607

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