Skip to content

Commit

Permalink
xbob -> bob
Browse files Browse the repository at this point in the history
  • Loading branch information
anjos committed May 26, 2014
1 parent 1cd1d25 commit e660cfe
Show file tree
Hide file tree
Showing 38 changed files with 156 additions and 156 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ install:
- "python bootstrap.py"
- "CFLAGS=-coverage ./bin/buildout"
script:
- "./bin/python -c 'from xbob.measure import get_config; print(get_config())'"
- "./bin/coverage run --source=xbob.measure ./bin/nosetests -sv"
- "./bin/python -c 'from bob.measure import get_config; print(get_config())'"
- "./bin/coverage run --source=bob.measure ./bin/nosetests -sv"
- "./bin/sphinx-build -b doctest doc sphinx"
- "./bin/sphinx-build -b html doc sphinx"
after_success:
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE README.rst bootstrap.py buildout.cfg
recursive-include doc conf.py *.rst
recursive-include xbob *.cpp
recursive-include xbob/measure/data *.*
recursive-include bob *.cpp
recursive-include bob/measure/data *.*
24 changes: 12 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
.. Andre Anjos <andre.anjos@idiap.ch>
.. Thu 29 Aug 2013 16:07:57 CEST
.. image:: https://travis-ci.org/bioidiap/xbob.measure.svg?branch=master
:target: https://travis-ci.org/bioidiap/xbob.measure
.. image:: https://coveralls.io/repos/bioidiap/xbob.measure/badge.png
:target: https://coveralls.io/r/bioidiap/xbob.measure
.. image:: http://img.shields.io/github/tag/bioidiap/xbob.measure.png
:target: https://github.com/bioidiap/xbob.measure
.. image:: http://img.shields.io/pypi/v/xbob.measure.png
:target: https://pypi.python.org/pypi/xbob.measure
.. image:: http://img.shields.io/pypi/dm/xbob.measure.png
:target: https://pypi.python.org/pypi/xbob.measure
.. image:: https://travis-ci.org/bioidiap/bob.measure.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.measure
.. image:: https://coveralls.io/repos/bioidiap/bob.measure/badge.png
:target: https://coveralls.io/r/bioidiap/bob.measure
.. image:: http://img.shields.io/github/tag/bioidiap/bob.measure.png
:target: https://github.com/bioidiap/bob.measure
.. image:: http://img.shields.io/pypi/v/bob.measure.png
:target: https://pypi.python.org/pypi/bob.measure
.. image:: http://img.shields.io/pypi/dm/bob.measure.png
:target: https://pypi.python.org/pypi/bob.measure

=================================
Python bindings for bob.measure
Expand Down Expand Up @@ -42,7 +42,7 @@ Testing

You can run a set of tests using the nose test runner::

$ nosetests -sv xbob.measure
$ nosetests -sv bob.measure

.. warning::

Expand All @@ -59,7 +59,7 @@ You can run our documentation tests using sphinx itself::

You can test overall test coverage with::

$ nosetests --with-coverage --cover-package=xbob.measure
$ nosetests --with-coverage --cover-package=bob.measure

The ``coverage`` egg must be installed for this to work properly.

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions xbob/measure/__init__.py → bob/measure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def recognition_rate(cmc_scores):
The input has a specific format, which is a list of two-element tuples. Each
of the tuples contains the negative and the positive scores for one test
item. To read the lists from score files in 4 or 5 column format, please use
the :py:func:`xbob.measure.load.cmc_four_column` or
the :py:func:`bob.measure.load.cmc_four_column` or
:py:func:`bob.measure.load.cmc_five_column` function.
The recognition rate is defined as the number of test items, for which the
Expand All @@ -100,7 +100,7 @@ def cmc(cmc_scores):
The input has a specific format, which is a list of two-element tuples. Each
of the tuples contains the negative and the positive scores for one test
item. To read the lists from score files in 4 or 5 column format, please use
the :py:func:`xbob.measure.load.cmc_four_column` or
the :py:func:`bob.measure.load.cmc_four_column` or
:py:func:`bob.measure.load.cmc_five_column` function.
For each test item the probability that the rank r of the positive score is
Expand Down
2 changes: 1 addition & 1 deletion xbob/measure/calibration.py → bob/measure/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def cllr(negatives, positives):
def min_cllr(negatives, positives):
"""Computes the 'minimum cost of log likelihood ratio' measure as given in the bosaris toolkit"""

from xbob.math import pavx
from bob.math import pavx

# first, sort both scores
neg = sorted(negatives)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
For separability information, please consult: http://en.wikipedia.org/wiki/File:Anderson%27s_Iris_data_set.png
"""

import xbob.io
import bob.io

iris_columns = {
'sepal.length': 0,
Expand Down Expand Up @@ -45,8 +45,8 @@ def example1():
Separation threshold is about 3.
"""
data = loaddata('iris.data', 'petal.length')
xbob.io.save(data['setosa'], 'linsep-negatives.hdf5')
xbob.io.save(data['virginica'],'linsep-positives.hdf5')
bob.io.save(data['setosa'], 'linsep-negatives.hdf5')
bob.io.save(data['virginica'],'linsep-positives.hdf5')

def example2():
"""In the second example we will get a non-linearly separable set of scores:
Expand All @@ -58,8 +58,8 @@ def example2():
Separation threshold is about 5 (min. HTER).
"""
data = loaddata('iris.data', 'sepal.length')
xbob.io.save(data['setosa'], 'nonsep-negatives.hdf5')
xbob.io.save(data['versicolor'], 'nonsep-positives.hdf5')
bob.io.save(data['setosa'], 'nonsep-negatives.hdf5')
bob.io.save(data['versicolor'], 'nonsep-positives.hdf5')

def main():
"""Generates data for all examples."""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions xbob/measure/load.py → bob/measure/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def cmc_four_column(filename):
more are allowed.
The result of this function can directly be passed to, e.g., the
:py:func:`xbob.measure.cmc` function.
:py:func:`bob.measure.cmc` function.
"""

# read four column list
Expand Down Expand Up @@ -204,7 +204,7 @@ def cmc_five_column(filename):
more are allowed.
The result of this function can directly be passed to, e.g., the
:py:func:`xbob.measure.cmc` function.
:py:func:`bob.measure.cmc` function.
"""

# read four column list
Expand Down
18 changes: 9 additions & 9 deletions xbob/measure/main.cpp → bob/measure/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob/measure/error.h>

static int double1d_converter(PyObject* o, PyBlitzArrayObject** a) {
Expand Down Expand Up @@ -41,7 +41,7 @@ half-total error rate at that position.\n\
The EPC curve plots the HTER on the test set for various values of\n\
'cost'. For each value of 'cost', a threshold is found that provides\n\
the minimum weighted error (see\n\
:py:func:`xbob.measure.min_weighted_error_rate_threshold()`)\n\
:py:func:`bob.measure.min_weighted_error_rate_threshold()`)\n\
on the development set. Each threshold is consecutively applied to\n\
the test set and the resulting HTER values are plotted in the EPC.\n\
\n\
Expand Down Expand Up @@ -1077,7 +1077,7 @@ PyDoc_STRVAR(module_docstr, "Bob metrics and performance figures");
#if PY_VERSION_HEX >= 0x03000000
static PyModuleDef module_definition = {
PyModuleDef_HEAD_INIT,
XBOB_EXT_MODULE_NAME,
BOB_EXT_MODULE_NAME,
module_docstr,
-1,
module_methods,
Expand All @@ -1090,23 +1090,23 @@ static PyObject* create_module (void) {
# if PY_VERSION_HEX >= 0x03000000
PyObject* m = PyModule_Create(&module_definition);
# else
PyObject* m = Py_InitModule3(XBOB_EXT_MODULE_NAME, module_methods, module_docstr);
PyObject* m = Py_InitModule3(BOB_EXT_MODULE_NAME, module_methods, module_docstr);
# endif
if (!m) return 0;
auto m_ = make_safe(m); ///< protects against early returns

if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0)
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0)
return 0;

/* imports xbob.blitz C-API + dependencies */
if (import_xbob_blitz() < 0) return 0;
/* imports bob.blitz C-API + dependencies */
if (import_bob_blitz() < 0) return 0;

Py_INCREF(m);
return m;

}

PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
# if PY_VERSION_HEX >= 0x03000000
return
# endif
Expand Down
20 changes: 10 additions & 10 deletions xbob/measure/plot.py → bob/measure/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,26 +231,26 @@ def det(negatives, positives, npoints=100, axisfontsize='x-small', **kwargs):
If you wish to reset axis zooming, you must use the gaussian scale rather
than the visual marks showed at the plot, which are just there for
displaying purposes. The real axis scale is based on the
xbob.measure.ppndf() method. For example, if you wish to set the x and y
bob.measure.ppndf() method. For example, if you wish to set the x and y
axis to display data between 1% and 40% here is the recipe:
.. code-block:: python
import xbob.measure
import bob.measure
import matplotlib.pyplot as mpl
xbob.measure.plot.det(...) #call this as many times as you need
bob.measure.plot.det(...) #call this as many times as you need
#AFTER you plot the DET curve, just set the axis in this way:
mpl.axis([xbob.measure.ppndf(k/100.0) for k in (1, 40, 1, 40)])
mpl.axis([bob.measure.ppndf(k/100.0) for k in (1, 40, 1, 40)])
We provide a convenient way for you to do the above in this module. So,
optionally, you may use the xbob.measure.plot.det_axis() method like this:
optionally, you may use the bob.measure.plot.det_axis() method like this:
.. code-block:: python
import xbob.measure
xbob.measure.plot.det(...)
import bob.measure
bob.measure.plot.det(...)
# please note we convert percentage values in det_axis()
xbob.measure.plot.det_axis([1, 40, 1, 40])
bob.measure.plot.det_axis([1, 40, 1, 40])
Return value is the matplotlib line that was added as defined by the
matplotlib.pyplot.plot() command.
Expand Down Expand Up @@ -308,8 +308,8 @@ def det_axis(v, **kwargs):
"""Sets the axis in a DET plot.
This method wraps the matplotlib.pyplot.axis() by calling
xbob.measure.ppndf() on the values passed by the user so they are meaningful
in a DET plot as performed by xbob.measure.plot.det().
bob.measure.ppndf() on the values passed by the user so they are meaningful
in a DET plot as performed by bob.measure.plot.det().
Keyword parameters:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_options(user_input):
parser.add_argument('-t', '--threshold', dest='thres', default=None,
type=float, help="The threshold value to apply", metavar="FLOAT")
parser.add_argument('-p', '--parser', dest="parser", default="4column",
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of xbob.measure.load.split_four_column() for details", metavar="NAME.FUNCTION")
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of bob.measure.load.split_four_column() for details", metavar="NAME.FUNCTION")

# This option is not normally shown to the user...
parser.add_argument("--self-test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_options(user_input):
parser.add_argument('-x', '--no-plot', dest="doplot", default=True,
action='store_false', help="If set, then I'll execute no plotting")
parser.add_argument('-p', '--parser', dest="parser", default="4column",
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of xbob.measure.load.split_four_column() for details", metavar="NAME.FUNCTION")
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of bob.measure.load.split_four_column() for details", metavar="NAME.FUNCTION")

# This option is not normally shown to the user...
parser.add_argument("--self-test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_options(user_input):
parser.add_argument('-w', '--cost', dest='cost', default=0.5,
type=float, help="The value w of the cost when minimizing using the minimum weighter error rate (mwer) criterium. This value is ignored for eer or mhter criteria.", metavar="FLOAT")
parser.add_argument('-p', '--parser', dest="parser", default="4column",
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of xbob.measure.load.split_four_column() for details", metavar="NAME.FUNCTION")
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of bob.measure.load.split_four_column() for details", metavar="NAME.FUNCTION")

# This option is not normally shown to the user...
parser.add_argument("--self-test",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_args():
parser.add_argument('--self-test', action='store_true', help=argparse.SUPPRESS)

parser.add_argument('-p', '--parser', dest="parser", default="4column", metavar="NAME.FUNCTION",
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of xbob.measure.load.split_four_column() for details")
help="Name of a known parser or of a python-importable function that can parse your input files and return a tuple (negatives, positives) as blitz 1-D arrays of 64-bit floats. Consult the API of bob.measure.load.split_four_column() for details")

# parse arguments
args = parser.parse_args()
Expand Down

0 comments on commit e660cfe

Please sign in to comment.