Skip to content

changed paths in kwdocs#11443

Merged
NelleV merged 1 commit into
matplotlib:masterfrom
fredrik-1:kwdoc_bug
Jul 13, 2018
Merged

changed paths in kwdocs#11443
NelleV merged 1 commit into
matplotlib:masterfrom
fredrik-1:kwdoc_bug

Conversation

@fredrik-1

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

Copy link
Copy Markdown
Contributor

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

jklymak commented Jun 15, 2018

Copy link
Copy Markdown
Member

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

fredrik-1 commented Jun 16, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

I added some docstrings

@fredrik-1

Copy link
Copy Markdown
Contributor Author

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

@fredrik-1

fredrik-1 commented Jun 19, 2018

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

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

@timhoffm

timhoffm commented Jul 2, 2018

Copy link
Copy Markdown
Member

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

@fredrik-1

fredrik-1 commented Jul 2, 2018

Copy link
Copy Markdown
Contributor Author

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

timhoffm commented Jul 2, 2018

Copy link
Copy Markdown
Member

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

NelleV commented Jul 13, 2018

Copy link
Copy Markdown
Member

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

jklymak commented Jul 13, 2018

Copy link
Copy Markdown
Member

@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

NelleV commented Jul 13, 2018

Copy link
Copy Markdown
Member

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