Skip to content

changed paths in kwdocs #11443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2018
Merged

changed paths in kwdocs #11443

merged 1 commit into from
Jul 13, 2018

Conversation

fredrik-1
Copy link
Contributor

@fredrik-1 fredrik-1 commented Jun 15, 2018

The links to the axes properties where not rendered correctly in the kwdoc table because axes._base and axes._axes are not included in the documentation. This is a simple solution that change the paths.

edit: So the changes is in the rendered docstrings when docstring.dedent_interpd is used with %(Axes)s (and maybe in some other docstrings)

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@fredrik-1 fredrik-1 force-pushed the kwdoc_bug branch 2 times, most recently from ba841c3 to fd8622c Compare June 15, 2018 20:57
@jklymak
Copy link
Member

jklymak commented Jun 15, 2018

I'm having trouble telling where and what the change is supposed to be. Can you give more detail, pref with a link to https://circleci.com/gh/matplotlib/matplotlib/10434/artifacts/0//home/circleci/project/doc/build/html/index.html

@fredrik-1
Copy link
Contributor Author

fredrik-1 commented Jun 16, 2018

I don't think that it is rendered in the docs at the moment but it probably should be in for example axes._base._AxesBase.__init__. (which will be the docstring in axes.Axes with my other PR) or in for example Figure.add_subplot.

The difference is that artist.kwdoc(matplotlib.axes.Axes) with rcParams['docstring.hardcopy]=True now renders to lines like
':meth:`yticklabels <matplotlib.axes.Axes.set_yticklabels>` List[str]'
which results in correct links to the documentation compared to the lines before:
':meth:`yticklabels <matplotlib.axes._base._AxesBase.set_yticklabels>` List[str]'
which don't link to a place in the documentation.

Some test code

import matplotlib
import matplotlib.artist as artist
import matplotlib.axes as axes

matplotlib.rcParams['docstring.hardcopy']=True
st=artist.kwdoc(axes.Axes)
print(st)

matplotlib.rcParams['docstring.hardcopy']=False             

@fredrik-1
Copy link
Contributor Author

I added some docstrings

@fredrik-1
Copy link
Contributor Author

Many links in the kwargs list in don't work. This PR fix those links.

@fredrik-1
Copy link
Contributor Author

fredrik-1 commented Jun 19, 2018

I see now that the kwarg list was actually included in Figure.gca, new, old.

@fredrik-1 fredrik-1 force-pushed the kwdoc_bug branch 2 times, most recently from daf64d9 to c6c6cf7 Compare June 23, 2018 14:08
@fredrik-1
Copy link
Contributor Author

Could someone review this? This pr make the links in the kwarg lists in for example work.

@timhoffm
Copy link
Member

timhoffm commented Jul 2, 2018

I've checked against master and did not see any change in the links. Which ones exactly do not work on master?

@fredrik-1
Copy link
Contributor Author

fredrik-1 commented Jul 2, 2018

axes

For example adjustable in the kwarglist should be a link and this pr fix that.

The same kwarglist with this pr
axes

But what has happend with the rendering of the types in the parameter list? Why are they bold?

@timhoffm
Copy link
Member

timhoffm commented Jul 2, 2018

The bold parameter list is a regression from #11495. I'll detail what's going on and fix it in a separate PR. You don't have to worry about that here.

@NelleV
Copy link
Member

NelleV commented Jul 13, 2018

Thanks @fredrik-1 !

(quick note--@timhoffm I don't know if you are aware that for documentation pull request, only one core dev is required to approve the PR before merging)

@NelleV NelleV merged commit 2486f89 into matplotlib:master Jul 13, 2018
@jklymak
Copy link
Member

jklymak commented Jul 13, 2018

@NelleV I think that’s true for bare edits of the docs. This was an actual code change for how the docs are handled.

@NelleV
Copy link
Member

NelleV commented Jul 13, 2018

Yeah, good point.

@QuLogic QuLogic added this to the v3.0 milestone Jul 13, 2018
@fredrik-1 fredrik-1 deleted the kwdoc_bug branch July 18, 2018 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants