diff --git a/develop.cfg b/develop.cfg index 9dfb1fc18d046900342dde443306fe3577a6bf7e..5a70757dd206f81ded6f9c5375da5bc8a4d2bb66 100644 --- a/develop.cfg +++ b/develop.cfg @@ -20,10 +20,10 @@ verbose = true newest = false [sources] -bob.extension = git git@gitlab.idiap.ch:bob/bob.extension -bob.blitz = git git@gitlab.idiap.ch:bob/bob.blitz -bob.core = git git@gitlab.idiap.ch:bob/bob.core -bob.io.base = git git@gitlab.idiap.ch:bob/bob.io.base +bob.extension = git https://gitlab.idiap.ch/bob/bob.extension +bob.blitz = git https://gitlab.idiap.ch/bob/bob.blitz +bob.core = git https://gitlab.idiap.ch/bob/bob.core +bob.io.base = git https://gitlab.idiap.ch/bob/bob.io.base [scripts] recipe = bob.buildout:scripts diff --git a/doc/c_cpp_api.rst b/doc/c_cpp_api.rst index e652d9f65b30ee3ec72e4a2fcf9b5a6e68c6d2a0..904388ca5f9556ab5a4ec0d015ac9f396a3cb41a 100644 --- a/doc/c_cpp_api.rst +++ b/doc/c_cpp_api.rst @@ -1,5 +1,4 @@ .. vim: set fileencoding=utf-8 : -.. Andre Anjos <andre.dos.anjos@gmail.com> .. Tue 15 Oct 14:59:05 2013 ========= @@ -90,7 +89,8 @@ Machine Interface .. cpp:function:: PyObject* PyBobLearnLibsvmMachine_NewFromMachine(bob::learn::libsvm::Machine* m) - Builds a new Python object from an existing :cpp:class:`Machine`. The + Builds a new Python object from an existing + :cpp:class:`bob::learn::libsvm::Machine`. The machine object ``m`` is **stolen** from the user, which should not delete it anymore. @@ -126,7 +126,7 @@ Other Utilities .. cpp:function:: PyObject* PyBobLearnLibsvm_MachineTypeAsString(bob::learn::libsvm::machine_t s) Returns a Python string representing given a machine type. Returns ``NULL`` - and sets an :py:class:`RuntimeError` if the enumeration provided is not + and sets an :py:exc:`RuntimeError` if the enumeration provided is not supported. This function will return a proper :c:type:`PyStringObject` on Python 2.x @@ -135,7 +135,7 @@ Other Utilities .. cpp:function:: bob::learn::libsvm::machine_t PyBobLearnLibsvm_StringAsMachineType(PyObject* o) Decodes the machine type enumeration from a pythonic string. Works with any - string type or subtype. A :py:class:`RuntimeError` is set if the string + string type or subtype. A :py:exc:`RuntimeError` is set if the string cannot be encoded as one of the available enumerations. You must check for :c:func:`PyErr_Occurred` after a call to this function to make sure that the conversion was correctly performed. @@ -144,7 +144,7 @@ Other Utilities This function works the same as :cpp:func:`PyBobLearnLibsvm_StringAsMachineType`, but accepts a C-style - string instead of a Python object as input. A :py:class:`RuntimeError` is + string instead of a Python object as input. A :py:exc:`RuntimeError` is set if the string cannot be encoded as one of the available enumerations. You must check for :c:func:`PyErr_Occurred` after a call to this function to make sure that the conversion was correctly performed. @@ -152,7 +152,7 @@ Other Utilities .. cpp:function:: PyObject* PyBobLearnLibsvm_KernelTypeAsString(bob::learn::libsvm::kernel_t s) Returns a Python string representing given a kernel type. Returns ``NULL`` - and sets an :py:class:`RuntimeError` if the enumeration provided is not + and sets an :py:exc:`RuntimeError` if the enumeration provided is not supported. This function will return a proper :c:type:`PyStringObject` on Python 2.x @@ -161,7 +161,7 @@ Other Utilities .. cpp:function:: bob::learn::libsvm::kernel_t PyBobLearnLibsvm_StringAsKernelType(PyObject* o) Decodes the kernel type enumeration from a pythonic string. Works with any - string type or subtype. A :py:class:`RuntimeError` is set if the string + string type or subtype. A :py:exc:`RuntimeError` is set if the string cannot be encoded as one of the available enumerations. You must check for :c:func:`PyErr_Occurred` after a call to this function to make sure that the conversion was correctly performed. @@ -170,7 +170,7 @@ Other Utilities This function works the same as :cpp:func:`PyBobLearnLibsvm_StringAsKernelType`, but accepts a C-style - string instead of a Python object as input. A :py:class:`RuntimeError` is + string instead of a Python object as input. A :py:exc:`RuntimeError` is set if the string cannot be encoded as one of the available enumerations. You must check for :c:func:`PyErr_Occurred` after a call to this function to make sure that the conversion was correctly performed. @@ -277,7 +277,7 @@ objects is described in this section. 1.0). If you need scaling to be applied, set it individually using the appropriate methods bellow. - .. cpp:function:: Machine(bob::io::HDF5File& config) + .. cpp:function:: Machine(bob::io::base::HDF5File& config) Builds a new Support Vector *Machine* from an HDF5 file containing the configuration for this machine. Scaling @@ -421,7 +421,7 @@ objects is described in this section. saved on simpler libsvm model file that does not include the scaling parameters set on this machine. - .. cpp:function:: void save(bob::io::HDF5File& config) + .. cpp:function:: void save(bob::io::base::HDF5File& config) Saves the whole machine into a configuration file. This allows for a single instruction parameter loading, which diff --git a/doc/conf.py b/doc/conf.py index 47844f2ffaa9256087c2c9989fede8282c3e4052..ee42549673c2ae1acd9cb7de3ee8b3db544a3f6f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -30,9 +30,29 @@ extensions = [ import sphinx if sphinx.__version__ >= "1.4.1": extensions.append('sphinx.ext.imgmath') + imgmath_image_format = 'svg' else: extensions.append('sphinx.ext.pngmath') +# Be picky about warnings +nitpicky = True + +# Ignores stuff we can't easily resolve on other project's sphinx manuals +nitpick_ignore = [] + +# Allows the user to override warnings from a separate file +if os.path.exists('nitpick-exceptions.txt'): + for line in open('nitpick-exceptions.txt'): + if line.strip() == "" or line.startswith("#"): + continue + dtype, target = line.split(None, 1) + target = target.strip() + try: # python 2.x + target = unicode(target) + except NameError: + pass + nitpick_ignore.append((dtype, target)) + # Always includes todos todo_include_todos = True @@ -216,8 +236,13 @@ autodoc_default_flags = [ ] # For inter-documentation mapping: -from bob.extension.utils import link_documentation -intersphinx_mapping = link_documentation() +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)) +else: + intersphinx_mapping = link_documentation() + # We want to remove all private (i.e. _. or __.__) members # that are not in the list of accepted functions diff --git a/doc/nitpick-exceptions.txt b/doc/nitpick-exceptions.txt new file mode 100644 index 0000000000000000000000000000000000000000..cce9c89f0c7cd8e4b81562e4e27941c77d3ca9b3 --- /dev/null +++ b/doc/nitpick-exceptions.txt @@ -0,0 +1,26 @@ +# These are not documented anywhere +cpp:type size_t +cpp:type std +cpp:type std::vector +cpp:type std::string +cpp:type boost +cpp:type boost::shared_ptr +cpp:type blitz +cpp:type blitz::Array +cpp:type bob +cpp:type bob::learn +cpp:type bob::learn::libsvm +cpp:type bob::learn::libsvm::Machine +cpp:type bob::io +cpp:type bob::io::base +cpp:type bob::io::base::HDF5File +cpp:type svm_model + +# This is a C type that Sphinx confuses as a C++ type +cpp:type PyObject + +# Not available in Python 3.x +c:type PyStringObject + +# This is not properly documented in Python 2.7, but works in Python 3.x +py:exc RuntimeError