Skip to content

test doc rendering #11595

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ipywidgets
numpydoc>=0.4
pillow
sphinx-gallery>=0.1.13
sphinx-automodapi
27 changes: 27 additions & 0 deletions doc/_templates/autoclass.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:show-inheritance:

{% if '__init__' in methods %}
{% set caught_result = methods.remove('__init__') %}
{% endif %}

{% block methods %}
{% if methods %}

.. rubric:: Methods

.. autosummary::
:template: autosummary.rst
:toctree:
:nosignatures:
{% for item in methods %}
~{{ name }}.{{ item }}
{% endfor %}

{% endif %}
{% endblock %}
57 changes: 57 additions & 0 deletions doc/_templates/autoclass_onefile.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. contents:: Table of Contents
:depth: 2
:local:
:backlinks: entry
:class: multicol-toc

{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:no-members:
:show-inheritance:

{% if '__init__' in methods %}
{% set caught_result = methods.remove('__init__') %}
{% endif %}

{% block methods %}
{% if methods %}

Methods
^^^^^^^

.. autosummary::
:nosignatures:
{% for item in methods %}
~{{ name }}.{{ item }}
{% endfor %}

{% endif %}
{% endblock %}

Documentation
=============

.. autoclass:: {{ objname }}
:members:
:undoc-members:
:inherited-members:
:show-inheritance:

Examples
========

.. include:: {{module}}.{{name}}.examples
{% block examples %}
{% if methods %}
{% for item in methods %}
.. include:: {{module}}.{{name}}.{{item}}.examples
.. raw:: html

<div class="clearer"></div>
{% endfor %}
{% endif %}
{% endblock %}

23 changes: 19 additions & 4 deletions doc/api/collections_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,23 @@ collections
:mod:`matplotlib.collections`
=============================

.. currentmodule:: matplotlib.collections

.. automodule:: matplotlib.collections
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
:no-members:


Classes
-------

.. automodsumm:: matplotlib.transforms
:classes-only:
:toctree: _as_gen/
:template: autoclass_onefile.rst
:nosignatures:






2 changes: 1 addition & 1 deletion doc/api/colors_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Classes

.. autosummary::
:toctree: _as_gen/
:template: autosummary.rst
:template: autoclass_onefile.rst

BoundaryNorm
Colormap
Expand Down
2 changes: 1 addition & 1 deletion doc/api/figure_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Classes

.. autosummary::
:toctree: _as_gen/
:template: autosummary.rst
:template: autoclass.rst
:nosignatures:

AxesStack
Expand Down
22 changes: 10 additions & 12 deletions doc/api/transformations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
transformations
***************

.. inheritance-diagram:: matplotlib.transforms matplotlib.path
:parts: 1

:mod:`matplotlib.transforms`
=============================
============================

.. automodule:: matplotlib.transforms
:members: TransformNode, BboxBase, Bbox, TransformedBbox, Transform,
TransformWrapper, AffineBase, Affine2DBase, Affine2D, IdentityTransform,
BlendedGenericTransform, BlendedAffine2D, blended_transform_factory,
CompositeGenericTransform, CompositeAffine2D,
composite_transform_factory, BboxTransform, BboxTransformTo,
BboxTransformFrom, ScaledTranslation, TransformedPath, nonsingular,
interval_contains, interval_contains_open
:show-inheritance:
:no-members:
:no-undoc-members:

.. automodapi:: matplotlib.transforms
:no-main-docstr:
:skip: affine_transform
:skip: inv
:skip: Path
:skip: count_bboxes_overlapping_bbox
:skip: update_path_extents
3 changes: 3 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx_automodapi.automodapi',
'sphinx.ext.doctest',
'sphinx.ext.inheritance_diagram',
'sphinx.ext.intersphinx',
Expand All @@ -48,6 +49,8 @@

exclude_patterns = ['api/api_changes/*', 'users/whats_new/*']

automodapi_toctreedirnm = 'api/_as_gen'
automodsumm_inherited_members = True

def _check_deps():
names = {"colorspacious": 'colorspacious',
Expand Down
20 changes: 15 additions & 5 deletions lib/matplotlib/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,9 @@ def to_values(self):
def matrix_from_values(a, b, c, d, e, f):
"""
(staticmethod) Create a new transformation matrix as a 3x3
numpy array of the form::
numpy array of the form:

::

a c e
b d f
Expand Down Expand Up @@ -1869,7 +1871,9 @@ class Affine2D(Affine2DBase):

def __init__(self, matrix=None, **kwargs):
"""
Initialize an Affine transform from a 3x3 numpy float array::
Initialize an Affine transform from a 3x3 numpy float array:

::

a c e
b d f
Expand All @@ -1894,7 +1898,9 @@ def __str__(self):
def from_values(a, b, c, d, e, f):
"""
(staticmethod) Create a new Affine2D instance from the given
values::
values:

::

a c e
b d f
Expand All @@ -1907,7 +1913,9 @@ def from_values(a, b, c, d, e, f):

def get_matrix(self):
"""
Get the underlying transformation matrix as a 3x3 numpy array::
Get the underlying transformation matrix as a 3x3 numpy array:

::

a c e
b d f
Expand All @@ -1920,7 +1928,9 @@ def get_matrix(self):

def set_matrix(self, mtx):
"""
Set the underlying transformation matrix from a 3x3 numpy array::
Set the underlying transformation matrix from a 3x3 numpy array:

::

a c e
b d f
Expand Down