Skip to content

Commit

Permalink
[Python API][Docs] Remove excess info (#10672)
Browse files Browse the repository at this point in the history
* [Python API][Docs] Remove excess info

* autodoc: add skip methods (#68)

* remove utils from docs

* undo changes

Co-authored-by: Nikolay Tyukaev <[email protected]>
  • Loading branch information
akuporos and ntyukaev authored Mar 2, 2022
1 parent c54926e commit cd52cc6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
12 changes: 0 additions & 12 deletions docs/api/ie_python_api/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ OpenVINO Python API

openvino.runtime.passes

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst

openvino.runtime.utils

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
Expand All @@ -85,12 +79,6 @@ OpenVINO Python API

openvino.frontend

.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst

openvino.offline_transformations

.. toctree::
:maxdepth: 2
:hidden:
Expand Down
23 changes: 20 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'openvino/inference-engine']
exclude_patterns = ['_build', 'Thumbs.db',
'.DS_Store', 'openvino/inference-engine']


panels_add_bootstrap_css = False
Expand Down Expand Up @@ -134,6 +135,7 @@
# monkeypatch sphinx api doc to prevent showing inheritance from object and enum.Enum
add_line = ClassDocumenter.add_line


def add_line_no_base_object(self, line, *args, **kwargs):
if line.strip() in ['Bases: :class:`object`', 'Bases: :class:`enum.Enum`']:
return
Expand All @@ -143,15 +145,30 @@ def add_line_no_base_object(self, line, *args, **kwargs):

ClassDocumenter.add_line = add_line_no_base_object

# OpenVINO Python API Reference Configuration
exclude_pyapi_methods = ('__weakref__',
'__doc__',
'__module__',
'__dict__',
'add_openvino_libs_to_path'
)


def autodoc_skip_member(app, what, name, obj, skip, options):
return name in exclude_pyapi_methods


def setup(app):
logger = logging.getLogger(__name__)
app.add_config_value('doxygen_mapping_file', doxygen_mapping_file, rebuild=True)
app.add_config_value('doxygen_mapping_file',
doxygen_mapping_file, rebuild=True)
app.add_config_value('repositories', repositories, rebuild=True)
app.connect('autodoc-skip-member', autodoc_skip_member)
app.add_js_file('js/custom.js')
app.add_js_file('js/graphs.js')
app.add_js_file('js/graphs_ov_tf.js')
try:
shutil.copytree(os.path.join(app.srcdir, 'csv'), os.path.join(app.outdir, 'csv'), dirs_exist_ok=True)
shutil.copytree(os.path.join(app.srcdir, 'csv'), os.path.join(
app.outdir, 'csv'), dirs_exist_ok=True)
except FileNotFoundError:
logger.warning('csv directory not found.')

0 comments on commit cd52cc6

Please sign in to comment.