Commit 6cc169c0 authored by André Anjos's avatar André Anjos 💬
Browse files

Merge branch 'p1' into 'master'

[Automatic] update links and the ci mostly



See merge request !5
parents be94f6be c2518991
Pipeline #4607 passed with stages
in 36 minutes and 8 seconds
......@@ -22,7 +22,7 @@ auto array_doc = bob::extension::ClassDoc(
"array",
"Constructs a new :py:class:`bob.blitz.array`",
"The implementation current supports a maximum of 4 dimensions. "
"Building an array with more dimensions will raise a :py:class:`TypeError`. "
"Building an array with more dimensions will raise a :py:exc:`TypeError`. "
"There are no explicit limits for the size in each dimension, except for the machine's maximum address size.\n\n"
"The following numpy data types are supported by this library:\n\n"
" * :py:class:`numpy.bool_`\n"
......
......@@ -20,7 +20,7 @@ auto as_blitz = bob::extension::FunctionDoc(
"Converts any compatible python object into a shallow :py:class:`" BOB_EXT_MODULE_PREFIX ".array`",
"This function works by first converting the input object ``x`` into a :py:class:`numpy.ndarray` and then shallow wrapping that ``ndarray`` into a new :py:class:`" BOB_EXT_MODULE_PREFIX ".array`. "
"You can access the converted ``ndarray`` using the returned value's :py:meth:`" BOB_EXT_MODULE_PREFIX ".array.base` attribute. "
"If the ``ndarray`` cannot be shallow-wrapped, a :py:class:`ValueError` is raised.\n\n"
"If the ``ndarray`` cannot be shallow-wrapped, a :py:exc:`ValueError` is raised.\n\n"
"In the case the input object ``x`` is already a behaved (C-style, memory-aligned, contiguous) :py:class:`numpy.ndarray`, then this function only shallow wrap's it into a :py:class:`" BOB_EXT_MODULE_PREFIX ".array` skin."
)
.add_prototype("x", "array")
......
......@@ -17,7 +17,7 @@ verbose = true
newest = false
[sources]
bob.extension = git git@gitlab.idiap.ch:bob/bob.extension
bob.extension = git https://gitlab.idiap.ch/bob/bob.extension
[scripts]
recipe = bob.buildout:scripts
......@@ -9,7 +9,7 @@
===============
This section includes information for using the pure C or C++ API for
manipulating :py:class:`bob.bob.blitz` objects in compiled code.
manipulating :py:mod:`bob.blitz` objects in compiled code.
C API
-----
......@@ -49,6 +49,7 @@ the import function:
Array Structure
===============
.. cpp:type:: PyBlitzArrayObject
.. c:type:: PyBlitzArrayObject
The basic array structure represents a ``bob.blitz.array`` instance from
......@@ -462,7 +463,8 @@ explained on the C-API section of this document.
Basic Properties and Checking
=============================
.. cpp:function:: template <typename T, int N> int PyBlitzArrayCxx_IsBehaved<T,N>(blitz::Array<T,N>& a)
.. cpp:function:: template <typename T, int N> \
int PyBlitzArrayCxx_IsBehaved<T,N>(blitz::Array<T,N>& a)
Tells if a ``blitz::Array<>`` is memory contiguous and C-style.
......@@ -470,36 +472,36 @@ Basic Properties and Checking
Construction and Destruction
============================
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_NewFromConstArray<T,N>(const blitz::Array<T,N>& a)
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_NewFromConstArray(const blitz::Array<T,N>& a)
Builds a new read-only ``PyBlitzArrayObject`` from an existing Blitz++
array, without copying the data. Returns a new reference.
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_NewFromArray<T,N>(blitz::Array<T,N>& a)
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_NewFromArray(blitz::Array<T,N>& a)
Builds a new writeable ``PyBlitzArrayObject`` from an existing Blitz++
array, without copying the data. Returns a new reference.
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_AsConstNumpy<T,N>(const blitz::Array<T,N>& a)
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_AsConstNumpy(const blitz::Array<T,N>& a)
Builds a new read-only :py:class:`numpy.ndarray` object from the given Blitz++ array
without copying the data. Returns a new reference.
In fact, it actually calls two of the above mentioned functions :cpp:func:`PyBlitzArrayCxx_NewFromConstArray` and :cpp:func:`PyBlitzArray_NUMPY_WRAP`:
In fact, it actually calls two of the above mentioned functions :cpp:func:`PyBlitzArrayCxx_NewFromConstArray` and :c:func:`PyBlitzArray_NUMPY_WRAP`:
.. code-block:: c++
PyBlitzArray_NUMPY_WRAP(PyBlitzArrayCxx_NewFromConstArray(a));
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_AsNumpy<T,N>(blitz::Array<T,N>& a)
.. cpp:function:: template <typename T, int N> PyObject* PyBlitzArrayCxx_AsNumpy(blitz::Array<T,N>& a)
Builds a new writeable :py:class:`numpy.ndarray` object from the given Blitz++ array
without copying the data. Returns a new reference.
In fact, it actually calls two of the above mentioned functions :cpp:func:`PyBlitzArrayCxx_NewFromArray` and :cpp:func:`PyBlitzArray_NUMPY_WRAP`:
In fact, it actually calls two of the above mentioned functions :cpp:func:`PyBlitzArrayCxx_NewFromArray` and :c:func:`PyBlitzArray_NUMPY_WRAP`:
.. code-block:: c++
......@@ -519,7 +521,7 @@ Other Utilities
.. cpp:function:: template <typename T, int N> blitz::Array<T,N>* PyBlitzArrayCxx_AsBlitz(PyBlitzArrayObject* o, const char* name)
Casts a ``PyBlitzArrayObject`` to a specific ``blitz::Array<>`` type after checking that the dimensions and the data type of the underlying :cpp:type:`PyBlitzArrayObject` fits to the template parameters.
Casts a ``PyBlitzArrayObject`` to a specific ``blitz::Array<>`` type after checking that the dimensions and the data type of the underlying :c:type:`PyBlitzArrayObject` fits to the template parameters.
If the check fails, an Python error is set, using the given ``name`` parameter as the name of the object that was passed to the python function, **and** ``NULL`` **is returned**.
Hence, please check the result of this function for ``NULL``:
......@@ -549,7 +551,7 @@ Other Utilities
.. note:: This version of the function might be slightly slower than the first version.
.. cpp:function:: template <typename T> int PyBlitzArrayCxx_CToTypenum<T>()
.. cpp:function:: template <typename T> int PyBlitzArrayCxx_CToTypenum()
Converts from C/C++ type to ndarray type_num.
......@@ -565,7 +567,7 @@ Other Utilities
if (PyErr_Occurred()) return 0; ///< propagate exception
.. cpp:function:: template <typename T> T PyBlitzArrayCxx_AsCScalar<T>(PyObject* o)
.. cpp:function:: template <typename T> T PyBlitzArrayCxx_AsCScalar(PyObject* o)
Extraction API for **simple** types.
......@@ -580,7 +582,7 @@ Other Utilities
auto z = extract<uint8_t>(obj);
if (PyErr_Occurred()) return 0; ///< propagate exception
.. cpp:function:: template <typename T> PyBlitzArrayCxx_FromCScalar<T>(T v)
.. cpp:function:: template <typename T> PyBlitzArrayCxx_FromCScalar(T v)
Converts **simple** C types into numpy scalars
......
......@@ -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
......@@ -195,6 +215,7 @@ html_favicon = 'img/favicon.ico'
# Output file base name for HTML help builder.
htmlhelp_basename = project_variable + u'_doc'
# -- Post configuration --------------------------------------------------------
# Included after all input documents
......@@ -215,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
......
# ignore c/c++ references
c:type Py_ssize_t
c:type PyArrayDescr
cpp:type blitz
cpp:type blitz::Array
cpp:type PyObject
cpp:type T
cpp:type N
# not really documented
py:meth bob.blitz.array.__array__
# not available in NumPy's manual, nor replacements
py:class numpy.bool_
py:class numpy.int8
py:class numpy.int16
py:class numpy.int32
py:class numpy.int64
py:class numpy.uint8
py:class numpy.uint16
py:class numpy.uint32
py:class numpy.uint64
py:class numpy.float32
py:class numpy.float64
py:class numpy.float128
py:class numpy.complex64
py:class numpy.complex128
py:class numpy.complex256
# not sure why these don't work
py:exc ValueError
py:exc TypeError
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment