Skip to content
Merged
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
9 changes: 9 additions & 0 deletions doc/_templates/autosummary/attribute.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:orphan:

{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

attribute

.. auto{{ objtype }}:: {{ objname }}
13 changes: 13 additions & 0 deletions doc/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% if objtype == 'property' %}
:orphan:
{% endif %}

{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

{% if objtype == 'property' %}
property
{% endif %}

.. auto{{ objtype }}:: {{ objname }}
68 changes: 21 additions & 47 deletions doc/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -1,53 +1,27 @@
{{ fullname }}
{{ underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

..
Methods
{% extends "!autosummary/class.rst" %}

{% block methods %}

.. rubric:: Methods

..
Special methods
{% for item in ('__getitem__', '__setitem__', '__len__', '__next__', '__iter__') %}
{% if item in all_methods or item in all_attributes %}
.. automethod:: {{ item }}
{% if methods %}
.. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages.
.. autosummary::
:toctree:
{% for item in all_methods %}
{%- if not item.startswith('_') or item in ['__call__'] %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{%- endfor %}

..
Ordinary methods
{% for item in methods %}
{% if item not in ('__init__',) %}
.. automethod:: {{ item }}
{% endif %}
{%- endfor %}

..
Special methods
{% endblock %}

{% for item in ('__eq__', '__ne__', '__lt__', '__le__', '__gt__', '__ge__') %}
{% if item in all_methods %}
.. automethod:: {{ item }}
{% block attributes %}
{% if attributes %}
.. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages.
.. autosummary::
:toctree:
{% for item in all_attributes %}
{%- if not item.startswith('_') %}
{{ name }}.{{ item }}
{%- endif -%}
{%- endfor %}
{% endif %}
{%- endfor %}
{% endblock %}

..
Attributes
{% block attributes %} {% if attributes %}

.. rubric:: Attributes

{% for item in attributes %}
.. autoattribute:: {{ item }}
{%- endfor %}
{% endif %} {% endblock %}
9 changes: 9 additions & 0 deletions doc/_templates/autosummary/member.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:orphan:

{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

member

.. auto{{ objtype }}:: {{ objname }}
9 changes: 9 additions & 0 deletions doc/_templates/autosummary/method.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:orphan:

{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

method

.. auto{{ objtype }}:: {{ objname }}
6 changes: 6 additions & 0 deletions doc/_templates/autosummary/minimal_module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block docstring %}
{% endblock %}
41 changes: 41 additions & 0 deletions doc/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends "!autosummary/module.rst" %}

{# This file is almost the same as the default, but adds :toctree: to the
autosummary directives. The original can be found at
``sphinx/ext/autosummary/templates/autosummary/module.rst``. #}

{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: Functions

.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: Classes

.. autosummary::
:toctree:
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
5 changes: 4 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

from datetime import datetime

from sphinx.ext.autodoc import FunctionDocumenter

from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc
Expand All @@ -32,7 +34,8 @@
# -- Project information -----------------------------------------------------

project = "Data Parallel Extension for NumPy"
copyright = "2020-2024, Intel Corporation"
year = datetime.now().year
copyright = f"2020-{year}, Intel Corporation"
author = "Intel"

version = dpnp.__version__.strip(".dirty")
Expand Down
Loading