Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Commit 6d63a29

Browse files
committed
Improvements in API documentation
1 parent 143f437 commit 6d63a29

File tree

14 files changed

+475
-192
lines changed

14 files changed

+475
-192
lines changed

docs/api.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/conf.py

Lines changed: 170 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,187 @@
1+
# -*- coding: utf-8 -*-
2+
#
13
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
215
import os
316
import sys
417
sys.path.insert(0, os.path.abspath('../'))
518
sys.setrecursionlimit(1500)
619

720
# -- Project information -----------------------------------------------------
21+
822
project = 'zenoh-python'
923
copyright = '2019, ATOLabs'
1024
author = 'ATOLabs'
11-
release = '0.3.0'
25+
26+
# The short X.Y version
27+
version = ''
28+
# The full version, including alpha/beta/rc tags
29+
release = '0.4.0'
30+
1231

1332
# -- General configuration ---------------------------------------------------
33+
34+
# If your documentation needs a minimal Sphinx version, state it here.
35+
#
36+
# needs_sphinx = '1.0'
37+
38+
# Add any Sphinx extension module names here, as strings. They can be
39+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40+
# ones.
41+
extensions = [
42+
'sphinx.ext.autodoc',
43+
'sphinx.ext.intersphinx',
44+
'rinoh.frontend.sphinx',
45+
'numpydoc',
46+
'sphinx_rtd_theme'
47+
]
48+
49+
# Add any paths that contain templates here, relative to this directory.
50+
templates_path = ['_templates']
51+
52+
# The suffix(es) of source filenames.
53+
# You can specify multiple suffix as a list of string:
54+
#
55+
# source_suffix = ['.rst', '.md']
56+
source_suffix = '.rst'
57+
58+
# The master toctree document.
1459
master_doc = 'index'
15-
extensions = ['sphinx.ext.autodoc']
60+
61+
# The language for content autogenerated by Sphinx. Refer to documentation
62+
# for a list of supported languages.
63+
#
64+
# This is also used if you do content translation via gettext catalogs.
65+
# Usually you set "language" from the command line for these cases.
1666
language = 'python'
1767

68+
# List of patterns, relative to source directory, that match files and
69+
# directories to ignore when looking for source files.
70+
# This pattern also affects html_static_path and html_extra_path.
71+
exclude_patterns = []
72+
73+
# The name of the Pygments (syntax highlighting) style to use.
74+
pygments_style = None
75+
76+
autodoc_mock_imports = ['fog05_sdk','yaks']
77+
1878
# -- Options for HTML output -------------------------------------------------
79+
80+
# The theme to use for HTML and HTML Help pages. See the documentation for
81+
# a list of builtin themes.
82+
#
1983
html_theme = 'sphinx_rtd_theme'
84+
85+
# Theme options are theme-specific and customize the look and feel of a theme
86+
# further. For a list of options available for each theme, see the
87+
# documentation.
88+
#
89+
# html_theme_options = {}
90+
91+
# Add any paths that contain custom static files (such as style sheets) here,
92+
# relative to this directory. They are copied after the builtin static files,
93+
# so a file named "default.css" will overwrite the builtin "default.css".
94+
html_static_path = ['_static']
95+
96+
# Custom sidebar templates, must be a dictionary that maps document names
97+
# to template names.
98+
#
99+
# The default sidebars (for documents that don't match any pattern) are
100+
# defined by theme itself. Builtin themes are using these templates by
101+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
102+
# 'searchbox.html']``.
103+
#
104+
# html_sidebars = {}
105+
106+
107+
# -- Options for HTMLHelp output ---------------------------------------------
108+
109+
# Output file base name for HTML help builder.
110+
htmlhelp_basename = 'Eclipsefog05doc'
111+
112+
113+
# -- Options for LaTeX output ------------------------------------------------
114+
115+
latex_elements = {
116+
# The paper size ('letterpaper' or 'a4paper').
117+
118+
'papersize': 'letterpaper',
119+
120+
# The font size ('10pt', '11pt' or '12pt').
121+
122+
'pointsize': '10pt',
123+
124+
# Additional stuff for the LaTeX preamble.
125+
126+
'preamble': '',
127+
128+
# Latex figure (float) alignment
129+
130+
'figure_align': 'htbp',
131+
}
132+
133+
# Grouping the document tree into LaTeX files. List of tuples
134+
# (source start file, target name, title,
135+
# author, documentclass [howto, manual, or own class]).
136+
latex_documents = [
137+
(master_doc, 'Eclipsefog05.tex', 'Eclipse fog05 Documentation',
138+
'Eclipse Foundation', 'manual'),
139+
]
140+
141+
142+
# -- Options for manual page output ------------------------------------------
143+
144+
# One entry per manual page. List of tuples
145+
# (source start file, name, description, authors, manual section).
146+
man_pages = [
147+
(master_doc, 'eclipsefog05', 'Eclipse fog05 Documentation',
148+
[author], 1)
149+
]
150+
151+
152+
# -- Options for Texinfo output ----------------------------------------------
153+
154+
# Grouping the document tree into Texinfo files. List of tuples
155+
# (source start file, target name, title, author,
156+
# dir menu entry, description, category)
157+
texinfo_documents = [
158+
(master_doc, 'Eclipsefog05', 'Eclipse fog05 Documentation',
159+
author, 'Eclipsefog05', 'One line description of project.',
160+
'Miscellaneous'),
161+
]
162+
163+
164+
# -- Options for Epub output -------------------------------------------------
165+
166+
# Bibliographic Dublin Core info.
167+
epub_title = project
168+
169+
# The unique identifier of the text. This can be a ISBN number
170+
# or the project homepage.
171+
#
172+
# epub_identifier = ''
173+
174+
# A unique identification for the text.
175+
#
176+
# epub_uid = ''
177+
178+
# A list of files that should not be packed into the epub file.
179+
epub_exclude_files = ['search.html']
180+
181+
182+
# -- Extension configuration -------------------------------------------------
183+
184+
# -- Options for intersphinx extension ---------------------------------------
185+
186+
# Example configuration for intersphinx: refer to the Python standard library.
187+
intersphinx_mapping = {'https://docs.python.org/': None}

docs/index.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
************
1+
============
22
zenoh-python
3-
************
3+
============
44

5-
The *zenoh-python* library provides a zenoh client API for the zenoh protocol.
5+
The *zenoh-python* library provides a Python `zenoh client API <zenoh-api.html>`_ for zenoh.
6+
7+
Note that this library also provides a low-level API (`zenoh-net <zenoh-net-api.html>`_)
8+
that gives access to the zenoh protocol primitives and allow some
9+
advanced use cases where a fine tuning of the protocol is required.
610

711
.. toctree::
8-
:maxdepth: 10
12+
:maxdepth: 1
913

10-
api
14+
zenoh API <zenoh-api>
15+
zenoh-net API <zenoh-net-api>

docs/zenoh-api.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
===================
2+
Zenoh API Reference
3+
===================
4+
5+
Zenoh
6+
-----
7+
.. autoclass:: zenoh.Zenoh
8+
:members:
9+
10+
Workspace
11+
---------
12+
.. autoclass:: zenoh.Workspace
13+
:members:
14+
15+
Admin
16+
-----
17+
.. autoclass:: zenoh.Admin
18+
:members:
19+
20+
Value
21+
-----
22+
.. autoclass:: zenoh.Value
23+
:members: get_value, get_encoding
24+
25+
Encoding
26+
--------
27+
.. autoclass:: zenoh.Encoding
28+
:members:
29+
30+
Change
31+
------
32+
.. autoclass:: zenoh.Change
33+
:members:
34+
35+
ChangeKind
36+
----------
37+
.. autoclass:: zenoh.ChangeKind
38+
:members:
39+
40+
Data
41+
----
42+
.. autoclass:: zenoh.Data
43+
:members:
44+
45+
Timestamp
46+
---------
47+
.. autoclass:: zenoh.core.Timestamp
48+
:members:
49+

docs/zenoh-net-api.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
=======================
2+
Zenoh-net API Reference
3+
=======================
4+
5+
Session
6+
-------
7+
.. autoclass:: zenoh.net.Session
8+
:members:
9+
10+
SubscriberMode
11+
--------------
12+
.. autoclass:: zenoh.net.SubscriberMode
13+
:members:
14+
15+
DataInfo
16+
--------
17+
.. autoclass:: zenoh.net.DataInfo
18+
:members:
19+
20+
QueryDest
21+
---------
22+
.. autoclass:: zenoh.net.QueryDest
23+
:members:
24+
25+
QueryReply
26+
----------
27+
.. autoclass:: zenoh.net.QueryReply
28+
:members:

zenoh/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@
1818
from .encoding import *
1919
from . import exceptions
2020
from .selector import Selector
21-
from .value import Value, Change, ChangeKind
21+
from .value import Value
22+
from .change import Change, ChangeKind
23+
from .data import Data
2224
from .path import Path

zenoh/admin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def add_backend(self, beid, properties, zid=None):
4040
zid = self.local
4141
path = '/@/router/{}/plugin/storages/backend/{}'.format(
4242
zid, beid)
43-
value = Value(properties, encoding=Encoding.PROPERTY)
43+
value = Value(properties, encoding=Encoding.PROPERTIES)
4444
return self.ws.put(path, value)
4545

4646
def get_backends(self, zid=None):
@@ -49,6 +49,7 @@ def get_backends(self, zid=None):
4949
5050
:param zid: the UUID of the Zenoh router. If ``None``, the local
5151
Zenoh router.
52+
:returns: a list of (backend_id, properties) tuples.
5253
'''
5354
if(zid is None):
5455
zid = self.local
@@ -66,6 +67,7 @@ def get_backend(self, beid, zid=None):
6667
:param beid: the Id of the backend.
6768
:param zid: the UUID of the Zenoh router. If ``None``, the local
6869
Zenoh router.
70+
:returns: the backend properties.
6971
'''
7072
if(zid is None):
7173
zid = self.local
@@ -108,7 +110,7 @@ def add_storage(self, stid, properties, beid=None, zid=None):
108110
beid = 'auto'
109111
p = '/@/router/{}/plugin/storages/backend/{}/storage/{}'.format(
110112
zid, beid, stid)
111-
v = Value(properties, encoding=Encoding.PROPERTY)
113+
v = Value(properties, encoding=Encoding.PROPERTIES)
112114
return self.ws.put(p, v)
113115

114116
def get_storages(self, beid=None, zid=None):
@@ -118,6 +120,7 @@ def get_storages(self, beid=None, zid=None):
118120
:param beid: the Id of the backend. If ``None``, all backends.
119121
:param zid: the UUID of the Zenoh router. If ``None``, the local
120122
Zenoh router.
123+
:returns: a list of (storage_id, properties) tuples.
121124
'''
122125
if(zid is None):
123126
zid = self.local
@@ -137,6 +140,7 @@ def get_storage(self, stid, zid=None):
137140
:param stid: the Id of the storage.
138141
:param zid: the UUID of the Zenoh router. If ``None``, the local
139142
Zenoh router.
143+
:returns: the storage properties.
140144
'''
141145
if(zid is None):
142146
zid = self.local

0 commit comments

Comments
 (0)