You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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)
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.
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.
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.
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.
@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
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.
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.
Activity
jtweeder commentedon Sep 21, 2018
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:
josef-pkt commentedon Sep 21, 2018
@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.
bashtage commentedon Sep 21, 2018
I don't know an easy way. It is possible to link from rst files to notebooks using nbsphinx and standard
reftags, 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)bashtage commentedon Sep 21, 2018
Of course, one could add a note and say see examples\NBNAME
thequackdaddy commentedon Sep 21, 2018
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
bashtage commentedon Sep 21, 2018
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.
jtweeder commentedon Sep 22, 2018
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.
jtweeder commentedon Sep 23, 2018
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.
josef-pkt commentedon Sep 23, 2018
sphinx normally figures out what changed and only rebuilds those pages.
What I sometimes do, is to delete some of the
generatedrst files so sphinx is forced to rebuild them.bashtage commentedon Sep 23, 2018
josef-pkt commentedon Sep 23, 2018
@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
jtweeder commentedon Sep 23, 2018
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.
josef-pkt commentedon Sep 23, 2018
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.
bashtage commentedon May 8, 2019
Fixed in #5309 and #5607