Commit 9fa1a413 authored by Manuel Günther's avatar Manuel Günther

New README and documentation strategy.

parent 870cedf9
......@@ -2,8 +2,7 @@
*.swp
*.pyc
*.so
*.so.*
CMakeLists.txt
*.dylib
bin
eggs
parts
......@@ -18,4 +17,3 @@ dist
build
*.egg
src/
opsnr.stt
......@@ -6,6 +6,7 @@ matrix:
env:
- secure: DCsVw4Y5hFxTH8iYFb80gJyBu4IEOJzRNuA7YGXsh6Sx4hsLXJ5D2e7t7pUUSjE5fv5SfBj+J5zS3wyZfNtLx/yi3Le1WjBYxv4WPbaUcRgEdH5NUSamJKrf0eGuoIYvus8fPLeLcKyfj05sQYKhMiVlACtKkfBzUzoSVDEg7RE=
- secure: YLwf/svdpy6rI3YvfYb/1t4EzvBtoaluBMvr+tCOKwB/kWu5/UuDr/lujbCyMNAvRi1LQutAaqiNnKlbFMNOQD47n/yy5yHlC6cBm45ptWs1XV4hb5oqE2EAkNEfh7LIFus60RnlI1bq4D+jkBNLiFJ+0jj59h9WNqzLcpQxTKI=
- BOB_DOCUMENTATION_SERVER=https://www.idiap.ch/software/bob/docs/latest/bioidiap/%s/master
- python: 3.2
env:
- NUMPYSPEC===1.7.1
......@@ -15,7 +16,7 @@ matrix:
before_install:
- sudo add-apt-repository -y ppa:biometrics/bob
- sudo apt-get update -qq
- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libatlas-dev libatlas-base-dev liblapack-dev
- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libatlas-dev libatlas-base-dev liblapack-dev texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- if [ -n "${NUMPYSPEC}" ]; then sudo apt-get install -qq gfortran; fi
- if [ -n "${NUMPYSPEC}" ]; then pip install --upgrade pip setuptools; fi
- if [ -n "${NUMPYSPEC}" ]; then pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel numpy$NUMPYSPEC; fi
......
......@@ -2,79 +2,34 @@
.. Andre Anjos <andre.anjos@idiap.ch>
.. Thu 29 Aug 2013 16:07:57 CEST
.. image:: https://travis-ci.org/bioidiap/bob.math.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.math
.. image:: http://img.shields.io/badge/docs-stable-yellow.png
:target: http://pythonhosted.org/bob.math/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png
:target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.math/master/index.html
.. image:: https://travis-ci.org/bioidiap/bob.math.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.math
.. image:: https://coveralls.io/repos/bioidiap/bob.math/badge.png
:target: https://coveralls.io/r/bioidiap/bob.math
.. image:: http://img.shields.io/github/tag/bioidiap/bob.math.png
:target: https://github.com/bioidiap/bob.math
.. image:: http://img.shields.io/pypi/v/bob.math.png
:target: https://pypi.python.org/pypi/bob.math
.. image:: http://img.shields.io/pypi/dm/bob.math.png
:target: https://pypi.python.org/pypi/bob.math
=================================
Python bindings for bob.math
=================================
===============================
Mathematical Functions of Bob
===============================
This package contains a set of Pythonic bindings for Bob's math packages and
functionality.
This package contains Bob's math functionality.
Installation
------------
Install it through normal means, via PyPI or use ``zc.buildout`` to bootstrap
the package and run test units.
To install this package -- alone or together with other `Packages of Bob <https://github.com/idiap/bob/wiki/Packages>`_ -- please read the `Installation Instructions <https://github.com/idiap/bob/wiki/Installation>`_.
For Bob_ to be able to work properly, some dependent packages are required to be installed.
Please make sure that you have read the `Dependencies <https://github.com/idiap/bob/wiki/Dependencies>`_ for your operating system.
Documentation
-------------
For further documentation on this package, please read the `Stable Version <http://pythonhosted.org/bob.math/index.html>`_ or the `Latest Version <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.math/master/index.html>`_ of the documentation.
For a list of tutorials on this or the other packages ob Bob_, or information on submitting issues, asking questions and starting discussions, please visit its website.
The latest version of the documentation can be found `here <https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.math/master/index.html>`_.
Otherwise, you can generate the documentation for this package yourself, after installation, using Sphinx::
$ sphinx-build -b html doc sphinx
This shall place in the directory ``sphinx``, the current version for the
documentation of the package.
Testing
-------
You can run a set of tests using the nose test runner::
$ nosetests -sv
.. warning::
If Bob <= 1.2.1 is installed on your python path, nose will automatically
load the old version of the insulate plugin available in Bob, which will
trigger the loading of incompatible shared libraries (from Bob itself), in
to your working binary. This will cause a stack corruption. Either remove
the centrally installed version of Bob, or build your own version of Python
in which Bob <= 1.2.1 is not installed.
You can run our documentation tests using sphinx itself::
$ sphinx-build -b doctest doc sphinx
You can test overall test coverage with::
$ nosetests --with-coverage --cover-package=bob.math
The ``coverage`` egg must be installed for this to work properly.
Development
-----------
To develop this package, install using ``zc.buildout``, using the buildout
configuration found on the root of the package::
$ python bootstrap.py
...
$ ./bin/buildout
Tweak the options in ``buildout.cfg`` to disable/enable verbosity and debug
builds.
.. _bob: https://www.idiap.ch/software/bob
......@@ -99,7 +99,7 @@ static bob::extension::FunctionDoc s_linsolve = bob::extension::FunctionDoc(
static bob::extension::FunctionDoc s_linsolve_nocheck = bob::extension::FunctionDoc(
"linsolve_",
"Solves the linear system :math:`Ax=b` and returns the result in :math:`x`.",
".. warning:: This variant does not perform any checks on the input matrices and is faster then :func:`linsolve`. "
".. warning:: This variant does not perform any checks on the input matrices and is faster then :py:func:`linsolve`. "
"Use it when you are sure your input matrices sizes match.\n\n"
"This method uses LAPACK's ``dgesv`` generic solver. "
"You can use this method in two different formats. "
......@@ -133,7 +133,7 @@ static bob::extension::FunctionDoc s_linsolve_sympos = bob::extension::FunctionD
static bob::extension::FunctionDoc s_linsolve_sympos_nocheck = bob::extension::FunctionDoc(
"linsolve_sympos_",
"Solves the linear system :math:`Ax=b` and returns the result in :math:`x` for symmetric :math:`A` matrix.",
".. warning:: This variant does not perform any checks on the input matrices and is faster then :func:`linsolve_sympos`. "
".. warning:: This variant does not perform any checks on the input matrices and is faster then :py:func:`linsolve_sympos`. "
"Use it when you are sure your input matrices sizes match.\n\n"
"This method uses LAPACK's ``dposv`` solver, assuming :math:`A` is a symmetric positive definite matrix. "
"You can use this method in two different formats. "
......@@ -167,7 +167,7 @@ static bob::extension::FunctionDoc s_linsolve_cg_sympos = bob::extension::Functi
static bob::extension::FunctionDoc s_linsolve_cg_sympos_nocheck = bob::extension::FunctionDoc(
"linsolve_cg_sympos_",
"Solves the linear system :math:`Ax=b` using conjugate gradients and returns the result in :math:`x` for symmetric :math:`A` matrix.",
".. warning:: This variant does not perform any checks on the input matrices and is faster then :func:`linsolve_cg_sympos`. "
".. warning:: This variant does not perform any checks on the input matrices and is faster then :py:func:`linsolve_cg_sympos`. "
"Use it when you are sure your input matrices sizes match.\n\n"
"This method uses the conjugate gradient solver, assuming :math:`A` is a symmetric positive definite matrix. "
"You can use this method in two different formats. "
......@@ -201,7 +201,7 @@ static bob::extension::FunctionDoc s_pavx = bob::extension::FunctionDoc(
static bob::extension::FunctionDoc s_pavx_nocheck = bob::extension::FunctionDoc(
"pavx_",
"Applies the Pool-Adjacent-Violators Algorithm",
".. warning:: This variant does not perform any checks on the input matrices and is faster then :func:`pavx`. "
".. warning:: This variant does not perform any checks on the input matrices and is faster then :py:func:`pavx`. "
"Use it when you are sure your input matrices sizes match.\n\n"
"Applies the Pool-Adjacent-Violators Algorithm to ``input``. "
"This is a simplified C++ port of the isotonic regression code made available at the `University of Bern website <http://www.imsv.unibe.ch/content/staff/personalhomepages/duembgen/software/isotonicregression/index_eng.html>`_.\n\n"
......@@ -258,7 +258,7 @@ static bob::extension::FunctionDoc s_normsinv = bob::extension::FunctionDoc(
"normsinv",
"Computes the inverse normal cumulative distribution",
"Computes the inverse normal cumulative distribution for a probability :math:`p`, given a distribution with mean :math:`\\mu=0` and standard deviation :math:`\\sigma=1`. "
"It is equivalent as calling ``norminv(p, 0, 1)`` (see :func:`norminv`). "
"It is equivalent as calling ``norminv(p, 0, 1)`` (see :py:func:`norminv`). "
"Reference: http://home.online.no/~pjacklam/notes/invnorm/"
)
.add_prototype("p", "inv")
......@@ -289,7 +289,7 @@ static bob::extension::FunctionDoc s_scatter = bob::extension::FunctionDoc(
static bob::extension::FunctionDoc s_scatter_nocheck = bob::extension::FunctionDoc(
"scatter_",
"Computes scatter matrix of a 2D array.",
".. warning:: This variant does not perform any checks on the input matrices and is faster then :func:`scatter`."
".. warning:: This variant does not perform any checks on the input matrices and is faster then :py:func:`scatter`."
"Use it when you are sure your input matrices sizes match.\n\n"
"Computes the scatter matrix of a 2D array *considering data is organized row-wise* (each sample is a row, each feature is a column). "
"The resulting array ``s`` is squared with extents equal to the number of columns in ``a``. "
......@@ -338,7 +338,7 @@ static bob::extension::FunctionDoc s_scatters = bob::extension::FunctionDoc(
static bob::extension::FunctionDoc s_scatters_nocheck = bob::extension::FunctionDoc(
"scatters_",
"Computes :math:`S_w` and :math:`S_b` scatter matrices of a set of 2D arrays.",
".. warning:: This variant does not perform any checks on the input matrices and is faster then :func:`scatters`. "
".. warning:: This variant does not perform any checks on the input matrices and is faster then :py:func:`scatters`. "
"Use it when you are sure your input matrices sizes match.\n\n"
"For a detailed description of the function, please see :func:`scatters`."
)
......
......@@ -16,6 +16,7 @@ develop = src/bob.extension
; options for bob.buildout extension
debug = true
verbose = true
newest = false
[sources]
bob.extension = git https://github.com/bioidiap/bob.extension
......
......@@ -255,36 +255,10 @@ autodoc_default_flags = [
'show-inheritance',
]
def smaller_than(v1, v2):
"""Compares scipy/numpy version numbers"""
c1 = v1.split('.')
c2 = v2.split('.')[:len(c1)] #clip to the compared version
for i, k in enumerate(c2):
n1 = c1[i]
n2 = c2[i]
try:
n1 = int(n1)
n2 = int(n2)
except ValueError:
n1 = str(n1)
n2 = str(n2)
if n1 > n2: return False
return True
# Some name mangling to find the correct sphinx manuals for some packages
numpy_version = __import__('numpy').version.version
if smaller_than(numpy_version, '1.5.z'):
numpy_version = '.'.join(numpy_version.split('.')[:-1]) + '.x'
else:
numpy_version = '.'.join(numpy_version.split('.')[:-1]) + '.0'
numpy_manual = 'http://docs.scipy.org/doc/numpy-%s/' % numpy_version
# For inter-documentation mapping:
intersphinx_mapping = {
'http://docs.python.org/%d.%d/' % sys.version_info[:2]: None,
numpy_manual: None,
}
from bob.extension.utils import link_documentation
intersphinx_mapping = link_documentation()
def setup(app):
pass
......@@ -133,7 +133,7 @@ setup(
name='bob.math',
version=version,
description='Bindings for bob.math',
description='Mathematical functions of Bob',
url='http://github.com/bioidiap/bob.math',
license='BSD',
author='Andre Anjos',
......@@ -216,7 +216,8 @@ setup(
},
classifiers = [
'Development Status :: 3 - Alpha',
'Framework :: Bob',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
......
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