Commit 6cc01259 authored by André Anjos's avatar André Anjos 💬

xbob -> bob

parent b87776ef
......@@ -26,8 +26,8 @@ install:
- "python bootstrap.py"
- "CFLAGS=-coverage ./bin/buildout"
script:
- "./bin/python -c 'from xbob.learn.libsvm import get_config; print(get_config())'"
- "./bin/coverage run --source=xbob.learn.libsvm ./bin/nosetests -sv"
- "./bin/python -c 'from bob.learn.libsvm import get_config; print(get_config())'"
- "./bin/coverage run --source=bob.learn.libsvm ./bin/nosetests -sv"
- "./bin/sphinx-build -b doctest doc sphinx"
- "./bin/sphinx-build -b html doc sphinx"
after_success:
......
include LICENSE README.rst bootstrap.py buildout.cfg
recursive-include doc conf.py doxygen.rc *.rst
recursive-include xbob/learn/libsvm *.cpp *.h
recursive-include xbob/learn/libsvm/data *.*
recursive-include bob/learn/libsvm *.cpp *.h
recursive-include bob/learn/libsvm/data *.*
......@@ -2,16 +2,16 @@
.. Andre Anjos <andre.anjos@idiap.ch>
.. Fri 13 Dec 2013 12:35:22 CET
.. image:: https://travis-ci.org/bioidiap/xbob.learn.libsvm.svg?branch=master
:target: https://travis-ci.org/bioidiap/xbob.learn.libsvm
.. image:: https://coveralls.io/repos/bioidiap/xbob.learn.libsvm/badge.png
:target: https://coveralls.io/r/bioidiap/xbob.learn.libsvm
.. image:: http://img.shields.io/github/tag/bioidiap/xbob.learn.libsvm.png
:target: https://github.com/bioidiap/xbob.learn.libsvm
.. image:: http://img.shields.io/pypi/v/xbob.learn.libsvm.png
:target: https://pypi.python.org/pypi/xbob.learn.libsvm
.. image:: http://img.shields.io/pypi/dm/xbob.learn.libsvm.png
:target: https://pypi.python.org/pypi/xbob.learn.libsvm
.. image:: https://travis-ci.org/bioidiap/bob.learn.libsvm.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.learn.libsvm
.. image:: https://coveralls.io/repos/bioidiap/bob.learn.libsvm/badge.png
:target: https://coveralls.io/r/bioidiap/bob.learn.libsvm
.. image:: http://img.shields.io/github/tag/bioidiap/bob.learn.libsvm.png
:target: https://github.com/bioidiap/bob.learn.libsvm
.. image:: http://img.shields.io/pypi/v/bob.learn.libsvm.png
:target: https://pypi.python.org/pypi/bob.learn.libsvm
.. image:: http://img.shields.io/pypi/dm/bob.learn.libsvm.png
:target: https://pypi.python.org/pypi/bob.learn.libsvm
================================
Bob-Python bindings for LIBSVM
......@@ -28,8 +28,8 @@ automatically. You can just skip to the installation instructions.
In case you have installed ``LIBSVM`` on a non-standard location (e.g. your
home directory), then you can specify the path to the root of that installation
using the environment variable ``XBOB_PREFIX_PATH``, **before** building and
installing the package. For example, if ``XBOB_PREFIX_PATH`` is set to
using the environment variable ``BOB_PREFIX_PATH``, **before** building and
installing the package. For example, if ``BOB_PREFIX_PATH`` is set to
``/home/user/libsvm-3.12``, then we will search for the header file ``svm.h``
in ``/home/user/libsvm-3.12/include`` and expect that the library file file is
found under ``/home/user/libsvm-3.12/lib``.
......@@ -37,11 +37,11 @@ found under ``/home/user/libsvm-3.12/lib``.
If you are installing this package via ``pip`` for example, just set the
environment variable like this::
$ XBOB_PREFIX_PATH=/home/user/libsvm-3.12 pip install xbob.learn.libsvm
$ BOB_PREFIX_PATH=/home/user/libsvm-3.12 pip install bob.learn.libsvm
If you are installing this package via ``zc.buildout``, we recommend you use
our `xbob.buildout <http://pypi.python.org/pypi/xbob.buildout>`_ extension and
set the ``[environ]`` section to define ``XBOB_PREFIX_PATH``.
our `bob.buildout <http://pypi.python.org/pypi/bob.buildout>`_ extension and
set the ``[environ]`` section to define ``BOB_PREFIX_PATH``.
Installation
------------
......@@ -65,7 +65,7 @@ Testing
You can run a set of tests using the nose test runner::
$ nosetests -sv xbob.learn.libsvm
$ nosetests -sv bob.learn.libsvm
.. warning::
......@@ -82,7 +82,7 @@ You can run our documentation tests using sphinx itself::
You can test overall test coverage with::
$ nosetests --with-coverage --cover-package=xbob.learn.libsvm
$ nosetests --with-coverage --cover-package=bob.learn.libsvm
The ``coverage`` egg must be installed for this to work properly.
......
......@@ -7,7 +7,7 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#include <xbob.learn.libsvm/file.h>
#include <bob.learn.libsvm/file.h>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
......
......@@ -2,13 +2,13 @@
* @author Andre Anjos <andre.anjos@idiap.ch>
* @date Tue 25 Mar 2014 12:57:21 CET
*
* @brief General directives for all modules in xbob.learn.libsvm
* @brief General directives for all modules in bob.learn.libsvm
*/
#ifndef XBOB_LEARN_LIBSVM_CONFIG_H
#define XBOB_LEARN_LIBSVM_CONFIG_H
#ifndef BOB_LEARN_LIBSVM_CONFIG_H
#define BOB_LEARN_LIBSVM_CONFIG_H
/* Macros that define versions and important names */
#define XBOB_LEARN_LIBSVM_API_VERSION 0x0200
#define BOB_LEARN_LIBSVM_API_VERSION 0x0200
#endif /* XBOB_LEARN_LIBSVM_CONFIG_H */
#endif /* BOB_LEARN_LIBSVM_CONFIG_H */
......@@ -7,7 +7,7 @@
* Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
*/
#include <xbob.learn.libsvm/machine.h>
#include <bob.learn.libsvm/machine.h>
#include <sys/stat.h>
#include <boost/format.hpp>
......
......@@ -5,15 +5,15 @@
* @brief Bindings to bob::machine
*/
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.learn.libsvm/api.h>
#define BOB_LEARN_LIBSVM_MODULE
#include <bob.learn.libsvm/api.h>
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/api.h>
#include <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
static PyMethodDef module_methods[] = {
{0} /* Sentinel */
......@@ -21,12 +21,12 @@ static PyMethodDef module_methods[] = {
PyDoc_STRVAR(module_docstr, "bob::learn::libsvm's machine and trainers");
int PyXbobLearnLibsvm_APIVersion = XBOB_LEARN_LIBSVM_API_VERSION;
int PyBobLearnLibsvm_APIVersion = BOB_LEARN_LIBSVM_API_VERSION;
#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,
......@@ -48,14 +48,14 @@ 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);
/* register some constants */
if (PyModule_AddIntConstant(m, "__api_version__", XBOB_LEARN_LIBSVM_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0;
if (PyModule_AddIntConstant(m, "__api_version__", BOB_LEARN_LIBSVM_API_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 0) return 0;
/* register the types to python */
Py_INCREF(&PyBobLearnLibsvmFile_Type);
......@@ -67,7 +67,7 @@ static PyObject* create_module (void) {
Py_INCREF(&PyBobLearnLibsvmTrainer_Type);
if (PyModule_AddObject(m, "Trainer", (PyObject *)&PyBobLearnLibsvmTrainer_Type) < 0) return 0;
static void* PyXbobLearnLibsvm_API[PyXbobLearnLibsvm_API_pointers];
static void* PyBobLearnLibsvm_API[PyBobLearnLibsvm_API_pointers];
/* exhaustive list of C APIs */
......@@ -75,75 +75,75 @@ static PyObject* create_module (void) {
* Versioning *
**************/
PyXbobLearnLibsvm_API[PyXbobLearnLibsvm_APIVersion_NUM] = (void *)&PyXbobLearnLibsvm_APIVersion;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_APIVersion_NUM] = (void *)&PyBobLearnLibsvm_APIVersion;
/***************************************
* Bindings for xbob.learn.libsvm.File *
* Bindings for bob.learn.libsvm.File *
***************************************/
PyXbobLearnLibsvm_API[PyBobLearnLibsvmFile_Type_NUM] = (void *)&PyBobLearnLibsvmFile_Type;
PyBobLearnLibsvm_API[PyBobLearnLibsvmFile_Type_NUM] = (void *)&PyBobLearnLibsvmFile_Type;
PyXbobLearnLibsvm_API[PyBobLearnLibsvmFile_Check_NUM] = (void *)&PyBobLearnLibsvmFile_Check;
PyBobLearnLibsvm_API[PyBobLearnLibsvmFile_Check_NUM] = (void *)&PyBobLearnLibsvmFile_Check;
/******************************************
* Bindings for xbob.learn.libsvm.Machine *
* Bindings for bob.learn.libsvm.Machine *
******************************************/
PyXbobLearnLibsvm_API[PyBobLearnLibsvmMachine_Type_NUM] = (void *)&PyBobLearnLibsvmMachine_Type;
PyBobLearnLibsvm_API[PyBobLearnLibsvmMachine_Type_NUM] = (void *)&PyBobLearnLibsvmMachine_Type;
PyXbobLearnLibsvm_API[PyBobLearnLibsvmMachine_Check_NUM] = (void *)&PyBobLearnLibsvmMachine_Check;
PyBobLearnLibsvm_API[PyBobLearnLibsvmMachine_Check_NUM] = (void *)&PyBobLearnLibsvmMachine_Check;
PyXbobLearnLibsvm_API[PyBobLearnLibsvmMachine_NewFromMachine_NUM] = (void *)&PyBobLearnLibsvmMachine_NewFromMachine;
PyBobLearnLibsvm_API[PyBobLearnLibsvmMachine_NewFromMachine_NUM] = (void *)&PyBobLearnLibsvmMachine_NewFromMachine;
/******************************************
* Bindings for xbob.learn.libsvm.Trainer *
* Bindings for bob.learn.libsvm.Trainer *
******************************************/
PyXbobLearnLibsvm_API[PyBobLearnLibsvmTrainer_Type_NUM] = (void *)&PyBobLearnLibsvmTrainer_Type;
PyBobLearnLibsvm_API[PyBobLearnLibsvmTrainer_Type_NUM] = (void *)&PyBobLearnLibsvmTrainer_Type;
PyXbobLearnLibsvm_API[PyBobLearnLibsvmTrainer_Check_NUM] = (void *)&PyBobLearnLibsvmTrainer_Check;
PyBobLearnLibsvm_API[PyBobLearnLibsvmTrainer_Check_NUM] = (void *)&PyBobLearnLibsvmTrainer_Check;
/*********************************
* Bindings to general utilities *
*********************************/
PyXbobLearnLibsvm_API[PyBobLearnLibsvm_MachineTypeAsString_NUM] = (void *)&PyBobLearnLibsvm_MachineTypeAsString;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_MachineTypeAsString_NUM] = (void *)&PyBobLearnLibsvm_MachineTypeAsString;
PyXbobLearnLibsvm_API[PyBobLearnLibsvm_StringAsMachineType_NUM] = (void *)&PyBobLearnLibsvm_StringAsMachineType;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_StringAsMachineType_NUM] = (void *)&PyBobLearnLibsvm_StringAsMachineType;
PyXbobLearnLibsvm_API[PyBobLearnLibsvm_CStringAsMachineType_NUM] = (void *)&PyBobLearnLibsvm_CStringAsMachineType;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_CStringAsMachineType_NUM] = (void *)&PyBobLearnLibsvm_CStringAsMachineType;
PyXbobLearnLibsvm_API[PyBobLearnLibsvm_KernelTypeAsString_NUM] = (void *)&PyBobLearnLibsvm_KernelTypeAsString;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_KernelTypeAsString_NUM] = (void *)&PyBobLearnLibsvm_KernelTypeAsString;
PyXbobLearnLibsvm_API[PyBobLearnLibsvm_StringAsKernelType_NUM] = (void *)&PyBobLearnLibsvm_StringAsKernelType;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_StringAsKernelType_NUM] = (void *)&PyBobLearnLibsvm_StringAsKernelType;
PyXbobLearnLibsvm_API[PyBobLearnLibsvm_CStringAsKernelType_NUM] = (void *)&PyBobLearnLibsvm_CStringAsKernelType;
PyBobLearnLibsvm_API[PyBobLearnLibsvm_CStringAsKernelType_NUM] = (void *)&PyBobLearnLibsvm_CStringAsKernelType;
#if PY_VERSION_HEX >= 0x02070000
/* defines the PyCapsule */
PyObject* c_api_object = PyCapsule_New((void *)PyXbobLearnLibsvm_API,
XBOB_EXT_MODULE_PREFIX "." XBOB_EXT_MODULE_NAME "._C_API", 0);
PyObject* c_api_object = PyCapsule_New((void *)PyBobLearnLibsvm_API,
BOB_EXT_MODULE_PREFIX "." BOB_EXT_MODULE_NAME "._C_API", 0);
#else
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyXbobLearnLibsvm_API, 0);
PyObject* c_api_object = PyCObject_FromVoidPtr((void *)PyBobLearnLibsvm_API, 0);
#endif
if (c_api_object) PyModule_AddObject(m, "_C_API", c_api_object);
/* imports dependencies */
if (import_xbob_blitz() < 0) {
if (import_bob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
if (import_xbob_io_base() < 0) {
if (import_bob_io_base() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
......@@ -152,7 +152,7 @@ static PyObject* create_module (void) {
}
PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
# if PY_VERSION_HEX >= 0x03000000
return
# endif
......
......@@ -7,18 +7,18 @@
* Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.libsvm/api.h>
#define BOB_LEARN_LIBSVM_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
#include <bob.learn.libsvm/api.h>
#include <structmember.h>
/***********************************************
* Implementation of Support Vector File class *
***********************************************/
PyDoc_STRVAR(s_file_str, XBOB_EXT_MODULE_PREFIX ".File");
PyDoc_STRVAR(s_file_str, BOB_EXT_MODULE_PREFIX ".File");
PyDoc_STRVAR(s_file_doc,
"File(path)\n\
......@@ -159,7 +159,7 @@ PyObject* PyBobLearnLibsvmFile_Repr(PyBobLearnLibsvmFileObject* self) {
/**
* Expected output:
*
* xbob.learn.libsvm.File('filename')
* bob.learn.libsvm.File('filename')
*/
PyObject* retval = PyUnicode_FromFormat("%s('%s')",
......@@ -181,7 +181,7 @@ PyObject* PyBobLearnLibsvmFile_Str(PyBobLearnLibsvmFileObject* self) {
/**
* Expected output:
*
* xbob.learn.libsvm.File('filename') <float64@(3, 4)>
* bob.learn.libsvm.File('filename') <float64@(3, 4)>
*/
PyObject* retval = PyUnicode_FromFormat("%s('%s') <float64@(%" PY_FORMAT_SIZE_T "d, %" PY_FORMAT_SIZE_T "d)>",
......
......@@ -7,18 +7,18 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.libsvm/api.h>
#define BOB_LEARN_LIBSVM_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
#include <bob.learn.libsvm/api.h>
#include <structmember.h>
/*******************************************************
* Implementation of Support Vector Machine base class *
*******************************************************/
PyDoc_STRVAR(s_svm_str, XBOB_EXT_MODULE_PREFIX ".Machine");
PyDoc_STRVAR(s_svm_str, BOB_EXT_MODULE_PREFIX ".Machine");
PyDoc_STRVAR(s_svm_doc,
"Machine(path)\n\
......@@ -59,7 +59,7 @@ state recovery from previous sessions.\n\
");
/***********************************************
* Implementation of xbob.learn.libsvm.Machine *
* Implementation of bob.learn.libsvm.Machine *
***********************************************/
static int PyBobLearnLibsvmMachine_init_svmfile
......@@ -416,7 +416,7 @@ PyObject* PyBobLearnLibsvmMachine_Repr(PyBobLearnLibsvmMachineObject* self) {
/**
* Expected output:
*
* <xbob.learn.libsvm.Machine float64@(3, 2)>
* <bob.learn.libsvm.Machine float64@(3, 2)>
*/
auto shape = make_safe(PyObject_GetAttrString((PyObject*)self, "shape"));
......@@ -441,7 +441,7 @@ PyObject* PyBobLearnLibsvmMachine_Str(PyBobLearnLibsvmMachineObject* self) {
/**
* Expected output:
*
* xbob.learn.libsvm.Machine (float64) 3 inputs, 2 outputs
* bob.learn.libsvm.Machine (float64) 3 inputs, 2 outputs
* properties...
*
* TODO: Not fully implemented yet
......@@ -932,8 +932,8 @@ PyDoc_STRVAR(s_save_doc,
o.save(hdf5file) -> None\n\
\n\
Saves itself at a LIBSVM model file or into a\n\
:py:class:`xbob.io.HDF5File`. Saving the SVM into an\n\
:py:class:`xbob.io.HDF5File` object, has the advantage of saving\n\
:py:class:`bob.io.HDF5File`. Saving the SVM into an\n\
:py:class:`bob.io.HDF5File` object, has the advantage of saving\n\
input normalization options together with the machine, which are\n\
automatically reloaded when you re-initialize it from the same\n\
:py:class:`HDF5File`.\n\
......
......@@ -7,18 +7,18 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.libsvm/api.h>
#define BOB_LEARN_LIBSVM_MODULE
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/api.h>
#include <bob.learn.libsvm/api.h>
#include <structmember.h>
/*******************************************************
* Implementation of Support Vector Trainer base class *
*******************************************************/
PyDoc_STRVAR(s_svm_str, XBOB_EXT_MODULE_PREFIX ".Trainer");
PyDoc_STRVAR(s_svm_str, BOB_EXT_MODULE_PREFIX ".Trainer");
PyDoc_STRVAR(s_svm_doc,
"Trainer([machine_type='C_SVC', [kernel_type='RBF', [cache_size=100, [stop_epsilon=1e-3, [shrinking=True, [probability=False]]]]]]) -> new Trainer\n\
......@@ -81,7 +81,7 @@ probability, bool\n\
");
/***********************************************
* Implementation of xbob.learn.libsvm.Trainer *
* Implementation of bob.learn.libsvm.Trainer *
***********************************************/
static int PyBobLearnLibsvmTrainer_init
......@@ -508,7 +508,7 @@ PyObject* PyBobLearnLibsvmTrainer_Repr(PyBobLearnLibsvmTrainerObject* self) {
/**
* Expected output:
*
* <xbob.learn.libsvm.Trainer>
* <bob.learn.libsvm.Trainer>
*
* @TODO: Improve this output
*/
......@@ -531,7 +531,7 @@ PyObject* PyBobLearnLibsvmTrainer_Str(PyBobLearnLibsvmTrainerObject* self) {
/**
* Expected output:
*
* xbob.learn.libsvm.Trainer
* bob.learn.libsvm.Trainer
*
* TODO: Not fully implemented yet
*/
......
......@@ -7,9 +7,9 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#define XBOB_LEARN_LIBSVM_MODULE
#include <xbob.blitz/cleanup.h>
#include <xbob.learn.libsvm/api.h>
#define BOB_LEARN_LIBSVM_MODULE
#include <bob.blitz/cleanup.h>
#include <bob.learn.libsvm/api.h>
PyObject* PyBobLearnLibsvm_MachineTypeAsString(bob::learn::libsvm::machine_t s) {
switch(s) {
......
......@@ -13,7 +13,7 @@ import numpy
import tempfile
import pkg_resources
import nose.tools
import xbob.io.base
import bob.io.base
from . import File, Machine
......@@ -102,11 +102,11 @@ def test_can_save_hdf5():
machine = Machine(HEART_MACHINE)
tmp = tempname('.hdf5')
machine.save(xbob.io.base.HDF5File(tmp, 'w'))
machine.save(bob.io.base.HDF5File(tmp, 'w'))
del machine
# make sure that the save machine is the same as before
machine = Machine(xbob.io.base.HDF5File(tmp))
machine = Machine(bob.io.base.HDF5File(tmp))
nose.tools.eq_(machine.shape, (13,1))
nose.tools.eq_(machine.kernel_type, 'RBF')
nose.tools.eq_(machine.machine_type, 'C_SVC')
......
......@@ -7,7 +7,7 @@
* Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
*/
#include <xbob.learn.libsvm/trainer.h>
#include <bob.learn.libsvm/trainer.h>
#include <boost/format.hpp>
#include <boost/make_shared.hpp>
#include <bob/core/logging.h>
......
......@@ -20,10 +20,10 @@
#ifdef NO_IMPORT_ARRAY
#undef NO_IMPORT_ARRAY
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io.base/config.h>
#include <xbob.learn.libsvm/config.h>
#include <bob.blitz/capi.h>
#include <bob.blitz/cleanup.h>
#include <bob.io.base/config.h>
#include <bob.learn.libsvm/config.h>
static int dict_set(PyObject* d, const char* key, const char* value) {
PyObject* v = Py_BuildValue("s", value);
......@@ -109,17 +109,17 @@ static PyObject* numpy_version() {
}
/**
* xbob.blitz c/c++ api version
* bob.blitz c/c++ api version
*/
static PyObject* xbob_blitz_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_BLITZ_API_VERSION));
static PyObject* bob_blitz_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_BLITZ_API_VERSION));
}
/**
* xbob.io.base c/c++ api version
* bob.io.base c/c++ api version
*/
static PyObject* xbob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_BASE_API_VERSION));
static PyObject* bob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(BOB_IO_BASE_API_VERSION));
}
static PyObject* build_version_dictionary() {
......@@ -134,8 +134,8 @@ static PyObject* build_version_dictionary() {
if (!dict_steal(retval, "Compiler", compiler_version())) return 0;
if (!dict_steal(retval, "Python", python_version())) return 0;
if (!dict_steal(retval, "NumPy", numpy_version())) return 0;
if (!dict_steal(retval, "xbob.blitz", xbob_blitz_version())) return 0;
if (!dict_steal(retval, "xbob.io.base", xbob_io_base_version())) return 0;
if (!dict_steal(retval, "bob.blitz", bob_blitz_version())) return 0;
if (!dict_steal(retval, "bob.io.base", bob_io_base_version())) return 0;
if (!dict_steal(retval, "Bob", bob_version())) return 0;
Py_INCREF(retval);
......@@ -153,7 +153,7 @@ PyDoc_STRVAR(module_docstr,
#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,
......@@ -166,15 +166,15 @@ 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
/* register version numbers and constants */
if (PyModule_AddIntConstant(m, "api", XBOB_LEARN_LIBSVM_API_VERSION) < 0)
if (PyModule_AddIntConstant(m, "api", BOB_LEARN_LIBSVM_API_VERSION) < 0)
return 0;
if (PyModule_AddStringConstant(m, "module", XBOB_EXT_MODULE_VERSION) < 0)
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0)
return 0;
PyObject* externals = build_version_dictionary();
......@@ -182,9 +182,9 @@ static PyObject* create_module (void) {
if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
/* imports dependencies */
if (import_xbob_blitz() < 0) {
if (import_bob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
PyErr_Format(PyExc_ImportError, "cannot import `%s'", BOB_EXT_MODULE_NAME);
return 0;
}
......@@ -193,7 +193,7 @@ static PyObject* create_module (void) {
}
PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
# if PY_VERSION_HEX >= 0x03000000
return
# endif
......
......@@ -4,25 +4,25 @@
[buildout]
parts = scripts
eggs = xbob.learn.libsvm
extensions = xbob.buildout
eggs = bob.learn.libsvm
extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/xbob.extension
src/xbob.blitz
src/xbob.io.base
develop = src/bob.extension
src/bob.blitz
src/bob.io.base
.
; options for xbob.buildout extension
; options for bob.buildout extension
debug = true
verbose = true
prefixes = /idiap/group/torch5spro/releases/preview/install/linux-x86_64-release
/Users/andre/work/bob/b/dbg/
[sources]
xbob.extension = git https://github.com/bioidiap/xbob.extension branch=prototype
xbob.blitz = git https://github.com/bioidiap/xbob.blitz
xbob.io.base = git https://github.com/bioidiap/xbob.io.base
bob.extension = git https://github.com/bioidiap/bob.extension
bob.blitz = git https://github.com/bioidiap/bob.blitz
bob.io.base = git https://github.com/bioidiap/bob.io.base
[scripts]
recipe = xbob.buildout:scripts
recipe = bob.buildout:scripts
......@@ -6,11 +6,11 @@
C++ API
=========
The C++ API of ``xbob.learn.libsvm`` allows users to leverage from automatic
converters for classes in :py:class:`xbob.learn.libsvm`. To use the C API,
clients should first, include the header file ``<xbob.learn.libsvm/api.h>`` on
The C++ API of ``bob.learn.libsvm`` allows users to leverage from automatic
converters for classes in :py:class:`bob.learn.libsvm`. To use the C API,
clients should first, include the header file ``<bob.learn.libsvm/api.h>`` on
their compilation units and then, make sure to call once
``import_xbob_learn_libsvm()`` at their module instantiation, as explained at
``import_bob_learn_libsvm()`` at their module instantiation, as explained at
the `Python manual
<http://docs.python.org/2/extending/extending.html#using-capsules>`_.
......@@ -19,9 +19,9 @@ the import function:
.. code-block:: c++
#include <xbob.blitz/capi.h>
#include <xbob.io/api.h>
#include <xbob.learn.libsvm/api.h>
#include <bob.blitz/capi.h>
#include <bob.io/api.h>
#include <bob.learn.libsvm/api.h>
PyMODINIT_FUNC initclient(void) {
......@@ -29,9 +29,9 @@ the import function:
if (!m) return 0;
if (import_xbob_blitz() < 0) return 0;
if (import_xbob_io() < 0) return 0;
if (import_xbob_learn_libsvm() < 0) return 0;
if (import_bob_blitz() < 0) return 0;
if (import_bob_io() < 0) return 0;
if (import_bob_learn_libsvm() < 0) return 0;
return m;
......@@ -40,7 +40,7 @@ the import function:
.. note::
The include directory can be discovered using
:py:func:`xbob.learn.libsvm.get_include`.
:py:func:`bob.learn.libsvm.get_include`.
File Interface
--------------
......
......@@ -58,12 +58,12 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'xbob.learn.libsvm'
project = u'bob.learn.libsvm'
import time
copyright = u'%s, Idiap Research Institute' % time.strftime('%Y')
# Grab the setup entry
distribution = pkg_resources.require('xbob.learn.libsvm')[0]
distribution = pkg_resources.require('bob.learn.libsvm')[0]
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
......@@ -129,7 +129,7 @@ if sphinx.__version__ >= "1.0":
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = 'xbob_learn_libsvm'
#html_short_title = 'bob_learn_libsvm'
# The name of an image file (relative to this directory) to place at the top