From 8708342148ea10b50dfab3ae5280d45c3813fa93 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Thu, 13 Oct 2016 13:37:26 +0200 Subject: [PATCH] Fix documentation issues (and closes #10) --- bob/db/base/annotations.py | 47 +++--- bob/db/base/database.py | 263 ++++++++++++++++++++-------------- bob/db/base/driver.py | 20 ++- bob/db/base/file.py | 16 --- bob/db/base/tests/test_sql.py | 16 --- doc/conf.py | 8 +- doc/extend.rst | 40 ++++-- doc/extra-intersphinx.txt | 1 + doc/index.rst | 27 +--- doc/nitpick-exceptions.txt | 5 + doc/py_api.rst | 19 ++- requirements.txt | 1 + 12 files changed, 244 insertions(+), 219 deletions(-) create mode 100644 doc/extra-intersphinx.txt create mode 100644 doc/nitpick-exceptions.txt diff --git a/bob/db/base/annotations.py b/bob/db/base/annotations.py index d86ce78..827819a 100644 --- a/bob/db/base/annotations.py +++ b/bob/db/base/annotations.py @@ -1,21 +1,5 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -# @author: Manuel Guenther <Manuel.Guenther@idiap.ch> -# @date: Wed Nov 13 11:56:53 CET 2013 -# -# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. import os import bob.core @@ -50,20 +34,31 @@ _idiap_annotations = { def read_annotation_file(file_name, annotation_type): """This function provides default functionality to read annotation files. - It returns a dictionary with the keypoint name as key and the position (y,x) as value, and maybe some additional annotations. - Keyword Parameters: - file_name : str - The full path of the annotation file to read + Parameters: - annotation_type : str - The type of the annotation file that should be read. - The following annotation_types are supported: + file_name : str + The full path of the annotation file to read + + annotation_type : str + The type of the annotation file that should be read. The following + annotation_types are supported: + + * ``eyecenter``: The file contains a single row with four entries: + ``re_x re_y le_x le_y`` + * ``named``: The file contains named annotations, one per line, e.g.: + ``reye re_x re_y`` or ``pose 25.7`` + * ``idiap``: The file contains enumerated annotations, one per line, + e.g.: ``1 key1_x key1_y``, and maybe some additional annotations like + gender, age, ... + + + Returns: + + dict: A python dictionary with the keypoint name as key and the + position ``(y,x)`` as value, and maybe some additional annotations. - * 'eyecenter': The file contains a single row with four entries: 're_x re_y le_x le_y' - * 'named': The file contains named annotations, one per line, e.g.: 'reye re_x re_y' or 'pose 25.7' - * 'idiap': The file contains enumerated annotations, one per line, e.g.: '1 key1_x key1_y', and maybe some additional annotations like gender, age, ... """ if not file_name: diff --git a/bob/db/base/database.py b/bob/db/base/database.py index 764be84..4ff3f03 100644 --- a/bob/db/base/database.py +++ b/bob/db/base/database.py @@ -1,21 +1,6 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -# @author: Manuel Guenther <Manuel.Guenther@idiap.ch> -# @date: Thu Dec 6 12:28:25 CET 2012 -# -# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. + import os from . import utils @@ -26,30 +11,40 @@ from .file import File class Database(object): """Low-level Database API to be used within bob.""" - def check_parameters_for_validity(self, parameters, parameter_description, valid_parameters, default_parameters=None): - """Checks the given parameters for validity, i.e., if they are contained in the set of valid parameters. - It also assures that the parameters form a tuple or a list. - If parameters is 'None' or empty, the default_parameters will be returned (if default_parameters is omitted, all valid_parameters are returned). - This function will return a tuple or list of parameters, or raise a ValueError. + def check_parameters_for_validity(self, parameters, parameter_description, + valid_parameters, default_parameters=None): + """Checks the given parameters for validity. + + Checks a given parameter is in the set of valid parameters. It also + assures that the parameters form a tuple or a list. If parameters is + 'None' or empty, the default_parameters will be returned (if + default_parameters is omitted, all valid_parameters are returned). + + This function will return a tuple or list of parameters, or raise a + ValueError. + - Keyword parameters: + Parameters: - parameters : str, [str] or None - The parameters to be checked. - Might be a string, a list/tuple of strings, or None. + parameters : str, [str] or None + The parameters to be checked. Might be a string, a list/tuple of + strings, or None. - parameter_description : str - A short description of the parameter. - This will be used to raise an exception in case the parameter is not valid. + parameter_description : str + A short description of the parameter. This will be used to raise an + exception in case the parameter is not valid. - valid_parameters : [str] - A list/tuple of valid values for the parameters. + valid_parameters : [str] + A list/tuple of valid values for the parameters. + + default_parameters : [str] or None + The list/tuple of default parameters that will be returned in case + parameters is None or empty. If omitted, all valid_parameters are + used. - default_parameters : [str] or None - The list/tuple of default parameters that will be returned in case parameters is None or empty. - If omitted, all valid_parameters are used. """ + if parameters is None: # parameters are not specified, i.e., 'None' or empty lists parameters = default_parameters if default_parameters is not None else valid_parameters @@ -66,29 +61,39 @@ class Database(object): # check passed, now return the list/tuple of parameters return parameters - def check_parameter_for_validity(self, parameter, parameter_description, valid_parameters, default_parameter=None): - """Checks the given parameter for validity, i.e., if it is contained in the set of valid parameters. - If the parameter is 'None' or empty, the default_parameter will be returned, in case it is specified, otherwise a ValueError will be raised. - This function will return the parameter after the check tuple or list of parameters, or raise a ValueError. + def check_parameter_for_validity(self, parameter, parameter_description, + valid_parameters, default_parameter=None): + """Checks the given parameter for validity + + Ensures a given parameter is in the set of valid parameters. If the + parameter is ``None`` or empty, the value in ``default_parameter`` will + be returned, in case it is specified, otherwise a :py:exc:`ValueError` + will be raised. - Keyword parameters: + This function will return the parameter after the check tuple or list + of parameters, or raise a :py:exc:`ValueError`. - parameter : str - The single parameter to be checked. - Might be a string or None. - parameter_description : str - A short description of the parameter. - This will be used to raise an exception in case the parameter is not valid. + Parameters: - valid_parameters : [str] - A list/tuple of valid values for the parameters. + parameter : str + The single parameter to be checked. Might be a string or None. + + parameter_description : str + A short description of the parameter. This will be used to raise an + exception in case the parameter is not valid. + + valid_parameters : [str] + A list/tuple of valid values for the parameters. + + default_parameters : [str] or None + The default parameter that will be returned in case parameter is + None or empty. If omitted and parameter is empty, a ValueError is + raised. - default_parameters : [str] or None - The default parameter that will be returned in case parameter is None or empty. - If omitted and parameter is empty, a ValueError is raised. """ + if parameter is None: # parameter not specified ... if default_parameter is not None: @@ -112,13 +117,18 @@ class Database(object): # tests passed -> return the parameter return parameter - def convert_names_to_highlevel(self, names, low_level_names, high_level_names): + + def convert_names_to_highlevel(self, names, low_level_names, + high_level_names): """ Converts group names from a low level to high level API - This is useful for example when you want to return db.groups() - for the bob.bio.base. Your instance of the database should already have - self.low_level_names and self.high_level_names initialized. + + This is useful for example when you want to return ``db.groups()`` for + the :py:mod:`bob.bio.base`. Your instance of the database should + already have ``low_level_names`` and ``high_level_names`` initialized. + """ + if names is None: return None mapping = dict(zip(low_level_names, high_level_names)) @@ -126,8 +136,11 @@ class Database(object): return mapping.get(names) return [mapping[g] for g in names] - def convert_names_to_lowlevel(self, names, low_level_names, high_level_names): + + def convert_names_to_lowlevel(self, names, low_level_names, + high_level_names): """ Same as convert_names_to_highlevel but on reverse """ + if names is None: return None mapping = dict(zip(high_level_names, low_level_names)) @@ -138,23 +151,26 @@ class Database(object): class SQLiteDatabase(Database): """This class can be used for handling SQL databases. - It opens an SQL database in a read-only mode and keeps it opened during the whole session.""" - def __init__(self, sqlite_file, file_class): - """**Contructor Documentation** + It opens an SQL database in a read-only mode and keeps it opened during the + whole session. - Opens a connection to the given SQLite file and keeps it open through the whole session. - Keyword parameters: + Parameters: - sqlite_file : str - The file name (including full path) of the SQLite file to read or generate. + sqlite_file : str + The file name (including full path) of the SQLite file to read or + generate. - file_class : a class instance - The ``File`` class, which needs to be derived from :py:class:`bob.db.base.File`. - This is required to be able to :py:meth:`query` the databases later on. + file_class : a class instance + The ``File`` class, which needs to be derived from + :py:class:`bob.db.base.File`. This is required to be able to + :py:meth:`query` the databases later on. - """ + """ + + + def __init__(self, sqlite_file, file_class): self.m_sqlite_file = sqlite_file if not os.path.exists(sqlite_file): self.m_session = None @@ -165,8 +181,10 @@ class SQLiteDatabase(Database): assert issubclass(file_class, File) self.m_file_class = file_class + def __del__(self): - """Closes the connection to the database when it is not needed any more.""" + """Closes the connection to the database.""" + if self.is_valid(): # do some magic to close the connection to the database file try: @@ -178,35 +196,48 @@ class SQLiteDatabase(Database): # ... I can just ignore the according exception... pass + def is_valid(self): - """Returns if a valid session has been opened for reading the database.""" + """Returns if a valid session has been opened for reading the database. + """ + return self.m_session is not None + def assert_validity(self): """Raise a RuntimeError if the database back-end is not available.""" + if not self.is_valid(): raise IOError("Database of type 'sqlite' cannot be found at expected location '%s'." % self.m_sqlite_file) + def query(self, *args): """Creates a query to the database using the given arguments.""" + self.assert_validity() return self.m_session.query(*args) + def files(self, ids, preserve_order=True): """Returns a list of ``File`` objects with the given file ids - Keyword Parameters: + Parameters: + + ids : list, tuple + The ids of the object in the database table "file". This object + should be a python iterable (such as a tuple or list). + + preserve_order : bool + If True (the default) the order of elements is preserved, but the + execution time increases. + - ids : [various type] - The ids of the object in the database table "file". - This object should be a python iterable (such as a tuple or list). + Returns: - preserve_order : bool - If True (the default) the order of elements is preserved, but the - execution time increases. + list: a list (that may be empty) of ``File`` objects. - Returns a list (that may be empty) of ``File`` objects. """ + file_objects = self.query(self.m_file_class).filter(self.m_file_class.id.in_(ids)) if not preserve_order: return list(file_objects) @@ -216,49 +247,58 @@ class SQLiteDatabase(Database): path_dict[f.id] = f return [path_dict[id] for id in ids] + def paths(self, ids, prefix=None, suffix=None, preserve_order=True): - """Returns a full file paths considering particular file ids, a given - directory and an extension + """Returns a full file paths considering particular file ids + + + Parameters: + + ids : list, tuple + The ids of the object in the database table "file". This object + should be a python iterable (such as a tuple or list). + + prefix : str or None + The bit of path to be prepended to the filename stem - Keyword Parameters: + suffix : str or None + The extension determines the suffix that will be appended to the + filename stem. - ids : [various type] - The ids of the object in the database table "file". This object should be - a python iterable (such as a tuple or list). + preserve_order : bool + If True (the default) the order of elements is preserved, but the + execution time increases. - prefix : str or None - The bit of path to be prepended to the filename stem - suffix : str or None - The extension determines the suffix that will be appended to the filename - stem. + Returns: - preserve_order : bool - If True (the default) the order of elements is preserved, but the - execution time increases. + list: A list (that may be empty) of the fully constructed paths given + the file ids. - Returns a list (that may be empty) of the fully constructed paths given the - file ids. """ file_objects = self.files(ids, preserve_order) return [f.make_path(prefix, suffix) for f in file_objects] + def reverse(self, paths, preserve_order=True): - """Reverses the lookup: from certain paths, return a list of - File objects + """Reverses the lookup from certain paths, returns a list of + :py:class:`File`'s - Keyword Parameters: + Parameters: - paths : [str] - The filename stems to query for. This object should be a python - iterable (such as a tuple or list) + paths : [str] + The filename stems to query for. This object should be a python + iterable (such as a tuple or list) - preserve_order : True - If True (the default) the order of elements is preserved, but the - execution time increases. + preserve_order : True + If True (the default) the order of elements is preserved, but the + execution time increases. + + Returns: + + list: A list (that may be empty). - Returns a list (that may be empty). """ file_objects = self.query(self.m_file_class).filter(self.m_file_class.path.in_(paths)) @@ -271,19 +311,32 @@ class SQLiteDatabase(Database): path_dict[f.path] = f return [path_dict[path] for path in paths] + def uniquify(self, file_list): """Sorts the given list of File objects and removes duplicates from it. - Args: - file_list: [:py:class:`File`] A list of File objects to be handled. Also other objects can be handled, as long as they are sortable. + + Parameters: + + file_list: [:py:class:`File`] + A list of File objects to be handled. Also other objects can be + handled, as long as they are sortable. Returns: - A sorted copy of the given ``file_list`` with the duplicates removed. + + list: A sorted copy of the given ``file_list`` with the duplicates + removed. """ + return sorted(set(file_list)) + def all_files(self, **kwargs): """Returns the list of all File objects that satisfy your query. - For possible keyword arguments, please check the :py:meth:`objects` function.""" + + For possible keyword arguments, please check the implemention's + ``objects()`` method. + """ + return self.uniquify(self.objects(**kwargs)) diff --git a/bob/db/base/driver.py b/bob/db/base/driver.py index d2d699c..8842aa1 100644 --- a/bob/db/base/driver.py +++ b/bob/db/base/driver.py @@ -1,6 +1,5 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -# Andre Anjos <andre.anjos@idiap.ch> # Mon 13 Aug 2012 16:19:18 CEST """This module defines, among other less important constructions, a management @@ -10,6 +9,8 @@ manage installed files. import os import abc +import six + def dbshell(arguments): """Drops you into a database shell""" @@ -48,6 +49,7 @@ def dbshell(arguments): return p.returncode + def dbshell_command(subparsers): """Adds a new dbshell subcommand to your subparser""" @@ -118,6 +120,7 @@ def download(arguments): print ("Error while downloading: '%s'" % e) return True + def download_command(subparsers): """Adds a new 'download' subcommand to your parser""" @@ -143,6 +146,7 @@ def print_files(arguments): return 0 + def files_command(subparsers): """Adds a new 'files' subcommand to your parser""" @@ -159,6 +163,7 @@ def version(arguments): return 0 + def version_command(subparsers): parser = subparsers.add_parser('version', help=version.__doc__) @@ -166,19 +171,18 @@ def version_command(subparsers): return parser -def with_metaclass(meta, *bases): - """Create a base class with a metaclass (works with Python2 and Python3).""" - - return meta("NewBase", bases, {}) -class Interface(with_metaclass(abc.ABCMeta, object)): +@six.add_metaclass(abc.ABCMeta) +class Interface(object): """Base manager for Bob databases""" + @abc.abstractmethod def name(self): '''Returns a simple name for this database, w/o funny characters, spaces''' return + @abc.abstractmethod def files(self): '''Returns a python iterable with all auxiliary files needed. @@ -188,11 +192,13 @@ class Interface(with_metaclass(abc.ABCMeta, object)): ''' return + @abc.abstractmethod def version(self): '''Returns the current version number defined in setup.py''' return + @abc.abstractmethod def type(self): '''Returns the type of auxiliary files you have for this database @@ -207,6 +213,7 @@ class Interface(with_metaclass(abc.ABCMeta, object)): ''' return + def setup_parser(self, parser, short_description, long_description): '''Sets up the base parser for this database. @@ -251,6 +258,7 @@ class Interface(with_metaclass(abc.ABCMeta, object)): return subparsers + @abc.abstractmethod def add_commands(self, parser): '''Adds commands to a given (:py:mod:`argparse`) parser. diff --git a/bob/db/base/file.py b/bob/db/base/file.py index a01a5e6..d335843 100644 --- a/bob/db/base/file.py +++ b/bob/db/base/file.py @@ -1,21 +1,5 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -# @author: Manuel Guenther <Manuel.Guenther@idiap.ch> -# @date: Thu Dec 6 12:28:25 CET 2012 -# -# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. import os diff --git a/bob/db/base/tests/test_sql.py b/bob/db/base/tests/test_sql.py index a4343f5..a1b1423 100644 --- a/bob/db/base/tests/test_sql.py +++ b/bob/db/base/tests/test_sql.py @@ -1,21 +1,5 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -# @author: Manuel Guenther <Manuel.Guenther@idiap.ch> -# @date: Wed Nov 13 12:46:06 CET 2013 -# -# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. import os import shutil diff --git a/doc/conf.py b/doc/conf.py index f155b79..ccda862 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -25,6 +25,7 @@ extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', + #'matplotlib.sphinxext.plot_directive' ] import sphinx @@ -239,9 +240,12 @@ autodoc_default_flags = [ from bob.extension.utils import link_documentation, load_requirements sphinx_requirements = "extra-intersphinx.txt" if os.path.exists(sphinx_requirements): - intersphinx_mapping = link_documentation(additional_packages=load_requirements(sphinx_requirements)) + intersphinx_mapping = link_documentation( + additional_packages=['python','numpy'] + \ + load_requirements(sphinx_requirements) + ) else: - intersphinx_mapping = link_documentation() + intersphinx_mapping = link_documentation() # We want to remove all private (i.e. _. or __.__) members diff --git a/doc/extend.rst b/doc/extend.rst index 45253de..cd26441 100644 --- a/doc/extend.rst +++ b/doc/extend.rst @@ -1,20 +1,34 @@ +.. vim: set fileencoding=utf-8 : +.. Thu 13 Oct 2016 10:34:35 CEST + +.. _annotations: + Annotations ----------- -Many databases come with additional information about their data. -For image databases, e.g., the locations of hand-labeled facial landmarks are provided. -Usually, these data is stored in additional text files. -For most of the available ``bob.db`` databases, there is exactly one text file for each data file. +Many databases come with additional information about their data. For image +databases, e.g., the locations of hand-labeled facial landmarks are provided. +Usually, these data is stored in additional text files. For most of the +available ``bob.db`` databases, there is exactly one text file for each data +file. -The function :py:func:`bob.db.base.read_annotation_file` can be used to read annotation files of different types. -It will output the data as a dictionary, containing a ``key`` and the interpreted read data. -For landmark locations, the data is returned in **the common way** for bob, which is ``(y, x)``! -The following formats are currently accepted: +The function :py:func:`bob.db.base.read_annotation_file` can be used to read +annotation files of different types. It will output the data as a dictionary, +containing a ``key`` and the interpreted read data. For landmark locations, +the data is returned in **the common way** for bob, which is ``(y, x)``! The +following formats are currently accepted: -* ``'eyecenter'`` (for face images): Each file contains **only** the locations of the two eyes, in one row, as follows: ``re_x re_y le_x le_y``. The keys will be ``'reye'`` and ``'leye'``. -* ``'named'`` (for face images): Each file contains lines with the landmark name and the two landmark locations, e.g. ``reye re_x re_y``. -* ``'idiap'`` (for face images): The file format to read Idiap specific annotation files. It will return up to 24 key points. 22 of these are read from the file, and the ``'reye'`` and ``'leye'`` are estimated from the inner and outer corners of the eyes (if available). +* ``'eyecenter'`` (for face images): Each file contains **only** the locations + of the two eyes, in one row, as follows: ``re_x re_y le_x le_y``. The keys + will be ``'reye'`` and ``'leye'``. * ``'named'`` (for face images): Each + file contains lines with the landmark name and the two landmark locations, + e.g. ``reye re_x re_y``. * ``'idiap'`` (for face images): The file format to + read Idiap specific annotation files. It will return up to 24 key points. 22 + of these are read from the file, and the ``'reye'`` and ``'leye'`` are + estimated from the inner and outer corners of the eyes (if available). .. note:: - 'Left' and 'Right' positions are always expected to be from the subject perspective. - This means that, e.g., the ``'leye'`` landmark usually has a **higher** x-coordinate than the ``'reye'``. + + ``Left`` and ``Right`` positions are always expected to be from the subject + perspective. This means that, e.g., the ``'leye'`` landmark usually has a + **higher** x-coordinate than the ``'reye'``. diff --git a/doc/extra-intersphinx.txt b/doc/extra-intersphinx.txt new file mode 100644 index 0000000..676c4b7 --- /dev/null +++ b/doc/extra-intersphinx.txt @@ -0,0 +1 @@ +bob.bio.base diff --git a/doc/index.rst b/doc/index.rst index 0a19f3e..f423efc 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,6 +1,5 @@ .. vim: set fileencoding=utf-8 : -.. Andre Anjos <andre.anjos@idiap.ch> -.. Mon 4 Nov 20:58:04 2013 CET +.. Thu 13 Oct 2016 10:34:35 CEST .. _bob.db.base: @@ -26,6 +25,7 @@ often require to store information about pairs of files, the size of such databases can become very large. For this reason, we have decided to externalize many of them in Satellite Packages. + Documentation ------------- @@ -35,29 +35,6 @@ Documentation extend py_api -General functions -+++++++++++++++++ - -The :py:meth:`bob.db.base.read_annotation_file` method will return a dictionary of annotations of any kind for the given :py:class:`bob.db.base.File`, see :ref:`annotations`. -In case, no annotation is available for the given file, or the database does not define any annotations, ``None`` is returned. - - -Reference ---------- - -This section contains the reference guide for :py:mod:`bob.db.base`. - -.. automodule:: bob.db.base - -Database Handling Utilities -=========================== - -.. automodule:: bob.db.base.utils - -Driver API -========== - -.. automodule:: bob.db.base.driver Indices and tables ------------------ diff --git a/doc/nitpick-exceptions.txt b/doc/nitpick-exceptions.txt new file mode 100644 index 0000000..69fda14 --- /dev/null +++ b/doc/nitpick-exceptions.txt @@ -0,0 +1,5 @@ +# Not available in Python 2.7 +py:exc ValueError + +# Sphinx bug! See: https://github.com/sphinx-doc/sphinx/issues/3048 +py:class bob.db.base.database.Database diff --git a/doc/py_api.rst b/doc/py_api.rst index 0eec16c..4b9af12 100644 --- a/doc/py_api.rst +++ b/doc/py_api.rst @@ -1,6 +1,5 @@ .. vim: set fileencoding=utf-8 : -.. Andre Anjos <andre.dos.anjos@gmail.com> -.. Tue 15 Oct 17:41:52 2013 +.. Thu 13 Oct 2016 10:35:57 CEST ============ Python API @@ -9,19 +8,19 @@ This section includes information for using the Python API of ``bob.db.base``. -Classes -------- +This section contains the reference guide for :py:mod:`bob.db.base`. -.. autoclass:: bob.db.base.File +.. automodule:: bob.db.base -.. autoclass:: bob.db.base.Database -.. autoclass:: bob.db.base.SQLiteDatabase +Database Handling Utilities +--------------------------- -Functions ---------- +.. automodule:: bob.db.base.utils -.. autofunction:: bob.db.base.read_annotation_file +Driver API +---------- +.. automodule:: bob.db.base.driver diff --git a/requirements.txt b/requirements.txt index 69336a8..67b77ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +six bob.extension bob.io.base sqlalchemy -- GitLab