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

xbob -> bob

parent e50483e7
......@@ -25,8 +25,8 @@ install:
- "python bootstrap.py"
- "CFLAGS=-coverage ./bin/buildout"
script:
- "./bin/python -c 'from xbob.core import get_config; print(get_config())'"
- "./bin/coverage run --source=xbob.core ./bin/nosetests -sv"
- "./bin/python -c 'from bob.core import get_config; print(get_config())'"
- "./bin/coverage run --source=bob.core ./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 *.rst
recursive-include xbob *.cpp *.h
recursive-include bob *.cpp *.h
......@@ -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.core.svg?branch=master
:target: https://travis-ci.org/bioidiap/xbob.core
.. image:: https://coveralls.io/repos/bioidiap/xbob.core/badge.png
:target: https://coveralls.io/r/bioidiap/xbob.core
.. image:: http://img.shields.io/github/tag/bioidiap/xbob.core.png
:target: https://github.com/bioidiap/xbob.core
.. image:: http://img.shields.io/pypi/v/xbob.core.png
:target: https://pypi.python.org/pypi/xbob.core
.. image:: http://img.shields.io/pypi/dm/xbob.core.png
:target: https://pypi.python.org/pypi/xbob.core
.. image:: https://travis-ci.org/bioidiap/bob.core.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.core
.. image:: https://coveralls.io/repos/bioidiap/bob.core/badge.png
:target: https://coveralls.io/r/bioidiap/bob.core
.. image:: http://img.shields.io/github/tag/bioidiap/bob.core.png
:target: https://github.com/bioidiap/bob.core
.. image:: http://img.shields.io/pypi/v/bob.core.png
:target: https://pypi.python.org/pypi/bob.core
.. image:: http://img.shields.io/pypi/dm/bob.core.png
:target: https://pypi.python.org/pypi/bob.core
==============================
Python bindings for bob.core
......@@ -42,7 +42,7 @@ Testing
You can run a set of tests using the nose test runner::
$ nosetests -sv xbob.core
$ nosetests -sv bob.core
.. warning::
......@@ -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.core
$ nosetests --with-coverage --cover-package=bob.core
The ``coverage`` egg must be installed for this to work properly.
......
......@@ -5,12 +5,12 @@
* @brief Pythonic bindings to C++ constructs on bob.core
*/
#include <xbob.core/config.h>
#include <bob.core/config.h>
#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/core/array_convert.h>
......@@ -245,7 +245,7 @@ PyDoc_STRVAR(module_docstr, "bob::core::array::convert bindings");
#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,
......@@ -258,18 +258,18 @@ 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_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 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;
}
......@@ -278,7 +278,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
......
......@@ -2,13 +2,13 @@
* @author Andre Anjos <andre.anjos@idiap.ch>
* @date Fri 1 Nov 07:10:59 2013
*
* @brief General directives for all modules in xbob.core
* @brief General directives for all modules in bob.core
*/
#ifndef XBOB_CORE_CONFIG_H
#define XBOB_CORE_CONFIG_H
#ifndef BOB_CORE_CONFIG_H
#define BOB_CORE_CONFIG_H
/* Macros that define versions and important names */
#define XBOB_CORE_API_VERSION 0x0200
#define BOB_CORE_API_VERSION 0x0200
#endif /* XBOB_CORE_CONFIG_H */
#endif /* BOB_CORE_CONFIG_H */
......@@ -5,18 +5,18 @@
* @brief C/C++-API for the random module
*/
#ifndef XBOB_CORE_RANDOM_H
#define XBOB_CORE_RANDOM_H
#ifndef BOB_CORE_RANDOM_H
#define BOB_CORE_RANDOM_H
#include <Python.h>
#include <xbob.core/config.h>
#include <bob.core/config.h>
#include <boost/shared_ptr.hpp>
#include <boost/random.hpp>
/* Define Module Name and Prefix for other Modules
Note: We cannot use XBOB_EXT_* macros here, unfortunately */
#define XBOB_CORE_RANDOM_PREFIX "xbob.core.random"
#define XBOB_CORE_RANDOM_FULL_NAME "xbob.core.random._library"
Note: We cannot use BOB_EXT_* macros here, unfortunately */
#define BOB_CORE_RANDOM_PREFIX "bob.core.random"
#define BOB_CORE_RANDOM_FULL_NAME "bob.core.random._library"
/*******************
* C API functions *
......@@ -26,11 +26,11 @@
* Versioning *
**************/
#define PyXbobCoreRandom_APIVersion_NUM 0
#define PyXbobCoreRandom_APIVersion_TYPE int
#define PyBobCoreRandom_APIVersion_NUM 0
#define PyBobCoreRandom_APIVersion_TYPE int
/*****************************************
* Bindings for xbob.core.random.mt19937 *
* Bindings for bob.core.random.mt19937 *
*****************************************/
/* Type definition for PyBoostMt19937Object */
......@@ -62,7 +62,7 @@ typedef struct {
#define PyBoostMt19937_NewWithSeed_PROTO (Py_ssize_t seed)
/*****************************************
* Bindings for xbob.core.random.uniform *
* Bindings for bob.core.random.uniform *
*****************************************/
/* Type definition for PyBoostUniformObject */
......@@ -91,7 +91,7 @@ typedef struct {
#define PyBoostUniform_SimpleNew_PROTO (int type_num, PyObject* min, PyObject* max)
/****************************************
* Bindings for xbob.core.random.normal *
* Bindings for bob.core.random.normal *
****************************************/
/* Type definition for PyBoostNormalObject */
......@@ -120,7 +120,7 @@ typedef struct {
#define PyBoostNormal_SimpleNew_PROTO (int type_num, PyObject* mean, PyObject* sigma)
/*******************************************
* Bindings for xbob.core.random.lognormal *
* Bindings for bob.core.random.lognormal *
*******************************************/
/* Type definition for PyBoostLogNormalObject */
......@@ -149,7 +149,7 @@ typedef struct {
#define PyBoostLogNormal_SimpleNew_PROTO (int type_num, PyObject* mean, PyObject* sigma)
/***************************************
* Bindings for xbob.core.random.gamma *
* Bindings for bob.core.random.gamma *
***************************************/
/* Type definition for PyBoostGammaObject */
......@@ -178,7 +178,7 @@ typedef struct {
#define PyBoostGamma_SimpleNew_PROTO (int type_num, PyObject* alpha)
/******************************************
* Bindings for xbob.core.random.binomial *
* Bindings for bob.core.random.binomial *
******************************************/
/* Type definition for PyBoostBinomialObject */
......@@ -207,7 +207,7 @@ typedef struct {
#define PyBoostBinomial_SimpleNew_PROTO (int type_num, PyObject* alpha, PyObject* beta)
/******************************************
* Bindings for xbob.core.random.discrete *
* Bindings for bob.core.random.discrete *
******************************************/
/* Type definition for PyBoostDiscreteObject */
......@@ -236,20 +236,20 @@ typedef struct {
#define PyBoostDiscrete_SimpleNew_PROTO (int type_num, PyObject* probabilities)
/* Total number of C API pointers */
#define PyXbobCoreRandom_API_pointers 30
#define PyBobCoreRandom_API_pointers 30
#ifdef XBOB_CORE_RANDOM_MODULE
#ifdef BOB_CORE_RANDOM_MODULE
/* This section is used when compiling `xbob.core.random' itself */
/* This section is used when compiling `bob.core.random' itself */
/**************
* Versioning *
**************/
extern int PyXbobCoreRandom_APIVersion;
extern int PyBobCoreRandom_APIVersion;
/*****************************************
* Bindings for xbob.core.random.mt19937 *
* Bindings for bob.core.random.mt19937 *
*****************************************/
extern PyBoostMt19937_Type_TYPE PyBoostMt19937_Type;
......@@ -263,7 +263,7 @@ typedef struct {
PyBoostMt19937_NewWithSeed_RET PyBoostMt19937_NewWithSeed PyBoostMt19937_NewWithSeed_PROTO;
/*****************************************
* Bindings for xbob.core.random.uniform *
* Bindings for bob.core.random.uniform *
*****************************************/
extern PyBoostUniform_Type_TYPE PyBoostUniform_Type;
......@@ -275,7 +275,7 @@ typedef struct {
PyBoostUniform_SimpleNew_RET PyBoostUniform_SimpleNew PyBoostUniform_SimpleNew_PROTO;
/****************************************
* Bindings for xbob.core.random.normal *
* Bindings for bob.core.random.normal *
****************************************/
extern PyBoostNormal_Type_TYPE PyBoostNormal_Type;
......@@ -287,7 +287,7 @@ typedef struct {
PyBoostNormal_SimpleNew_RET PyBoostNormal_SimpleNew PyBoostNormal_SimpleNew_PROTO;
/*******************************************
* Bindings for xbob.core.random.lognormal *
* Bindings for bob.core.random.lognormal *
*******************************************/
extern PyBoostLogNormal_Type_TYPE PyBoostLogNormal_Type;
......@@ -299,7 +299,7 @@ typedef struct {
PyBoostLogNormal_SimpleNew_RET PyBoostLogNormal_SimpleNew PyBoostLogNormal_SimpleNew_PROTO;
/***************************************
* Bindings for xbob.core.random.gamma *
* Bindings for bob.core.random.gamma *
***************************************/
extern PyBoostGamma_Type_TYPE PyBoostGamma_Type;
......@@ -311,7 +311,7 @@ typedef struct {
PyBoostGamma_SimpleNew_RET PyBoostGamma_SimpleNew PyBoostGamma_SimpleNew_PROTO;
/******************************************
* Bindings for xbob.core.random.binomial *
* Bindings for bob.core.random.binomial *
******************************************/
extern PyBoostBinomial_Type_TYPE PyBoostBinomial_Type;
......@@ -323,7 +323,7 @@ typedef struct {
PyBoostBinomial_SimpleNew_RET PyBoostBinomial_SimpleNew PyBoostBinomial_SimpleNew_PROTO;
/******************************************
* Bindings for xbob.core.random.discrete *
* Bindings for bob.core.random.discrete *
******************************************/
extern PyBoostDiscrete_Type_TYPE PyBoostDiscrete_Type;
......@@ -339,12 +339,12 @@ typedef struct {
/* This section is used in modules that use `blitz.array's' C-API */
# if defined(NO_IMPORT_ARRAY)
extern void **PyXbobCoreRandom_API;
extern void **PyBobCoreRandom_API;
# else
# if defined(PY_ARRAY_UNIQUE_SYMBOL)
void **PyXbobCoreRandom_API;
void **PyBobCoreRandom_API;
# else
static void **PyXbobCoreRandom_API=NULL;
static void **PyBobCoreRandom_API=NULL;
# endif
# endif
......@@ -352,105 +352,105 @@ typedef struct {
* Versioning *
**************/
# define PyXbobCoreRandom_APIVersion (*(PyXbobCoreRandom_APIVersion_TYPE *)PyXbobCoreRandom_API[PyXbobCoreRandom_APIVersion_NUM])
# define PyBobCoreRandom_APIVersion (*(PyBobCoreRandom_APIVersion_TYPE *)PyBobCoreRandom_API[PyBobCoreRandom_APIVersion_NUM])
/*****************************************
* Bindings for xbob.core.random.mt19937 *
* Bindings for bob.core.random.mt19937 *
*****************************************/
# define PyBoostMt19937_Type (*(PyBoostMt19937_Type_TYPE *)PyXbobCoreRandom_API[PyBoostMt19937_Type_NUM])
# define PyBoostMt19937_Type (*(PyBoostMt19937_Type_TYPE *)PyBobCoreRandom_API[PyBoostMt19937_Type_NUM])
# define PyBoostMt19937_Check (*(PyBoostMt19937_Check_RET (*)PyBoostMt19937_Check_PROTO) PyXbobCoreRandom_API[PyBoostMt19937_Check_NUM])
# define PyBoostMt19937_Check (*(PyBoostMt19937_Check_RET (*)PyBoostMt19937_Check_PROTO) PyBobCoreRandom_API[PyBoostMt19937_Check_NUM])
# define PyBoostMt19937_Converter (*(PyBoostMt19937_Converter_RET (*)PyBoostMt19937_Converter_PROTO) PyXbobCoreRandom_API[PyBoostMt19937_Converter_NUM])
# define PyBoostMt19937_Converter (*(PyBoostMt19937_Converter_RET (*)PyBoostMt19937_Converter_PROTO) PyBobCoreRandom_API[PyBoostMt19937_Converter_NUM])
# define PyBoostMt19937_SimpleNew (*(PyBoostMt19937_SimpleNew_RET (*)PyBoostMt19937_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostMt19937_SimpleNew_NUM])
# define PyBoostMt19937_SimpleNew (*(PyBoostMt19937_SimpleNew_RET (*)PyBoostMt19937_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostMt19937_SimpleNew_NUM])
# define PyBoostMt19937_NewWithSeed (*(PyBoostMt19937_NewWithSeed_RET (*)PyBoostMt19937_NewWithSeed_PROTO) PyXbobCoreRandom_API[PyBoostMt19937_NewWithSeed_NUM])
# define PyBoostMt19937_NewWithSeed (*(PyBoostMt19937_NewWithSeed_RET (*)PyBoostMt19937_NewWithSeed_PROTO) PyBobCoreRandom_API[PyBoostMt19937_NewWithSeed_NUM])
/*****************************************
* Bindings for xbob.core.random.uniform *
* Bindings for bob.core.random.uniform *
*****************************************/
# define PyBoostUniform_Type (*(PyBoostUniform_Type_TYPE *)PyXbobCoreRandom_API[PyBoostUniform_Type_NUM])
# define PyBoostUniform_Type (*(PyBoostUniform_Type_TYPE *)PyBobCoreRandom_API[PyBoostUniform_Type_NUM])
# define PyBoostUniform_Check (*(PyBoostUniform_Check_RET (*)PyBoostUniform_Check_PROTO) PyXbobCoreRandom_API[PyBoostUniform_Check_NUM])
# define PyBoostUniform_Check (*(PyBoostUniform_Check_RET (*)PyBoostUniform_Check_PROTO) PyBobCoreRandom_API[PyBoostUniform_Check_NUM])
# define PyBoostUniform_Converter (*(PyBoostUniform_Converter_RET (*)PyBoostUniform_Converter_PROTO) PyXbobCoreRandom_API[PyBoostUniform_Converter_NUM])
# define PyBoostUniform_Converter (*(PyBoostUniform_Converter_RET (*)PyBoostUniform_Converter_PROTO) PyBobCoreRandom_API[PyBoostUniform_Converter_NUM])
# define PyBoostUniform_SimpleNew (*(PyBoostUniform_SimpleNew_RET (*)PyBoostUniform_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostUniform_SimpleNew_NUM])
# define PyBoostUniform_SimpleNew (*(PyBoostUniform_SimpleNew_RET (*)PyBoostUniform_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostUniform_SimpleNew_NUM])
/****************************************
* Bindings for xbob.core.random.normal *
* Bindings for bob.core.random.normal *
****************************************/
# define PyBoostNormal_Type (*(PyBoostNormal_Type_TYPE *)PyXbobCoreRandom_API[PyBoostNormal_Type_NUM])
# define PyBoostNormal_Type (*(PyBoostNormal_Type_TYPE *)PyBobCoreRandom_API[PyBoostNormal_Type_NUM])
# define PyBoostNormal_Check (*(PyBoostNormal_Check_RET (*)PyBoostNormal_Check_PROTO) PyXbobCoreRandom_API[PyBoostNormal_Check_NUM])
# define PyBoostNormal_Check (*(PyBoostNormal_Check_RET (*)PyBoostNormal_Check_PROTO) PyBobCoreRandom_API[PyBoostNormal_Check_NUM])
# define PyBoostNormal_Converter (*(PyBoostNormal_Converter_RET (*)PyBoostNormal_Converter_PROTO) PyXbobCoreRandom_API[PyBoostNormal_Converter_NUM])
# define PyBoostNormal_Converter (*(PyBoostNormal_Converter_RET (*)PyBoostNormal_Converter_PROTO) PyBobCoreRandom_API[PyBoostNormal_Converter_NUM])
# define PyBoostNormal_SimpleNew (*(PyBoostNormal_SimpleNew_RET (*)PyBoostNormal_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostNormal_SimpleNew_NUM])
# define PyBoostNormal_SimpleNew (*(PyBoostNormal_SimpleNew_RET (*)PyBoostNormal_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostNormal_SimpleNew_NUM])
/*******************************************
* Bindings for xbob.core.random.lognormal *
* Bindings for bob.core.random.lognormal *
*******************************************/
# define PyBoostLogNormal_Type (*(PyBoostLogNormal_Type_TYPE *)PyXbobCoreRandom_API[PyBoostLogNormal_Type_NUM])
# define PyBoostLogNormal_Type (*(PyBoostLogNormal_Type_TYPE *)PyBobCoreRandom_API[PyBoostLogNormal_Type_NUM])
# define PyBoostLogNormal_Check (*(PyBoostLogNormal_Check_RET (*)PyBoostLogNormal_Check_PROTO) PyXbobCoreRandom_API[PyBoostLogNormal_Check_NUM])
# define PyBoostLogNormal_Check (*(PyBoostLogNormal_Check_RET (*)PyBoostLogNormal_Check_PROTO) PyBobCoreRandom_API[PyBoostLogNormal_Check_NUM])
# define PyBoostLogNormal_Converter (*(PyBoostLogNormal_Converter_RET (*)PyBoostLogNormal_Converter_PROTO) PyXbobCoreRandom_API[PyBoostLogNormal_Converter_NUM])
# define PyBoostLogNormal_Converter (*(PyBoostLogNormal_Converter_RET (*)PyBoostLogNormal_Converter_PROTO) PyBobCoreRandom_API[PyBoostLogNormal_Converter_NUM])
# define PyBoostLogNormal_SimpleNew (*(PyBoostLogNormal_SimpleNew_RET (*)PyBoostLogNormal_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostLogNormal_SimpleNew_NUM])
# define PyBoostLogNormal_SimpleNew (*(PyBoostLogNormal_SimpleNew_RET (*)PyBoostLogNormal_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostLogNormal_SimpleNew_NUM])
/***************************************
* Bindings for xbob.core.random.gamma *
* Bindings for bob.core.random.gamma *
***************************************/
# define PyBoostGamma_Type (*(PyBoostGamma_Type_TYPE *)PyXbobCoreRandom_API[PyBoostGamma_Type_NUM])
# define PyBoostGamma_Type (*(PyBoostGamma_Type_TYPE *)PyBobCoreRandom_API[PyBoostGamma_Type_NUM])
# define PyBoostGamma_Check (*(PyBoostGamma_Check_RET (*)PyBoostGamma_Check_PROTO) PyXbobCoreRandom_API[PyBoostGamma_Check_NUM])
# define PyBoostGamma_Check (*(PyBoostGamma_Check_RET (*)PyBoostGamma_Check_PROTO) PyBobCoreRandom_API[PyBoostGamma_Check_NUM])
# define PyBoostGamma_Converter (*(PyBoostGamma_Converter_RET (*)PyBoostGamma_Converter_PROTO) PyXbobCoreRandom_API[PyBoostGamma_Converter_NUM])
# define PyBoostGamma_Converter (*(PyBoostGamma_Converter_RET (*)PyBoostGamma_Converter_PROTO) PyBobCoreRandom_API[PyBoostGamma_Converter_NUM])
# define PyBoostGamma_SimpleNew (*(PyBoostGamma_SimpleNew_RET (*)PyBoostGamma_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostGamma_SimpleNew_NUM])
# define PyBoostGamma_SimpleNew (*(PyBoostGamma_SimpleNew_RET (*)PyBoostGamma_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostGamma_SimpleNew_NUM])
/******************************************
* Bindings for xbob.core.random.binomial *
* Bindings for bob.core.random.binomial *
******************************************/
# define PyBoostBinomial_Type (*(PyBoostBinomial_Type_TYPE *)PyXbobCoreRandom_API[PyBoostBinomial_Type_NUM])
# define PyBoostBinomial_Type (*(PyBoostBinomial_Type_TYPE *)PyBobCoreRandom_API[PyBoostBinomial_Type_NUM])
# define PyBoostBinomial_Check (*(PyBoostBinomial_Check_RET (*)PyBoostBinomial_Check_PROTO) PyXbobCoreRandom_API[PyBoostBinomial_Check_NUM])
# define PyBoostBinomial_Check (*(PyBoostBinomial_Check_RET (*)PyBoostBinomial_Check_PROTO) PyBobCoreRandom_API[PyBoostBinomial_Check_NUM])
# define PyBoostBinomial_Converter (*(PyBoostBinomial_Converter_RET (*)PyBoostBinomial_Converter_PROTO) PyXbobCoreRandom_API[PyBoostBinomial_Converter_NUM])
# define PyBoostBinomial_Converter (*(PyBoostBinomial_Converter_RET (*)PyBoostBinomial_Converter_PROTO) PyBobCoreRandom_API[PyBoostBinomial_Converter_NUM])
# define PyBoostBinomial_SimpleNew (*(PyBoostBinomial_SimpleNew_RET (*)PyBoostBinomial_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostBinomial_SimpleNew_NUM])
# define PyBoostBinomial_SimpleNew (*(PyBoostBinomial_SimpleNew_RET (*)PyBoostBinomial_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostBinomial_SimpleNew_NUM])
/******************************************
* Bindings for xbob.core.random.discrete *
* Bindings for bob.core.random.discrete *
******************************************/
# define PyBoostDiscrete_Type (*(PyBoostDiscrete_Type_TYPE *)PyXbobCoreRandom_API[PyBoostDiscrete_Type_NUM])
# define PyBoostDiscrete_Type (*(PyBoostDiscrete_Type_TYPE *)PyBobCoreRandom_API[PyBoostDiscrete_Type_NUM])
# define PyBoostDiscrete_Check (*(PyBoostDiscrete_Check_RET (*)PyBoostDiscrete_Check_PROTO) PyXbobCoreRandom_API[PyBoostDiscrete_Check_NUM])
# define PyBoostDiscrete_Check (*(PyBoostDiscrete_Check_RET (*)PyBoostDiscrete_Check_PROTO) PyBobCoreRandom_API[PyBoostDiscrete_Check_NUM])
# define PyBoostDiscrete_Converter (*(PyBoostDiscrete_Converter_RET (*)PyBoostDiscrete_Converter_PROTO) PyXbobCoreRandom_API[PyBoostDiscrete_Converter_NUM])
# define PyBoostDiscrete_Converter (*(PyBoostDiscrete_Converter_RET (*)PyBoostDiscrete_Converter_PROTO) PyBobCoreRandom_API[PyBoostDiscrete_Converter_NUM])
# define PyBoostDiscrete_SimpleNew (*(PyBoostDiscrete_SimpleNew_RET (*)PyBoostDiscrete_SimpleNew_PROTO) PyXbobCoreRandom_API[PyBoostDiscrete_SimpleNew_NUM])
# define PyBoostDiscrete_SimpleNew (*(PyBoostDiscrete_SimpleNew_RET (*)PyBoostDiscrete_SimpleNew_PROTO) PyBobCoreRandom_API[PyBoostDiscrete_SimpleNew_NUM])
# if !defined(NO_IMPORT_ARRAY)
/**
* Returns -1 on error, 0 on success.
*/
static int import_xbob_core_random(void) {
static int import_bob_core_random(void) {
PyObject *c_api_object;
PyObject *module;
module = PyImport_ImportModule(XBOB_CORE_RANDOM_FULL_NAME);
module = PyImport_ImportModule(BOB_CORE_RANDOM_FULL_NAME);
if (module == NULL) return -1;
......@@ -463,34 +463,34 @@ typedef struct {
# if PY_VERSION_HEX >= 0x02070000
if (PyCapsule_CheckExact(c_api_object)) {
PyXbobCoreRandom_API = (void **)PyCapsule_GetPointer(c_api_object,
PyBobCoreRandom_API = (void **)PyCapsule_GetPointer(c_api_object,
PyCapsule_GetName(c_api_object));
}
# else
if (PyCObject_Check(c_api_object)) {
PyXbobCoreRandom_API = (void **)PyCObject_AsVoidPtr(c_api_object);
PyBobCoreRandom_API = (void **)PyCObject_AsVoidPtr(c_api_object);
}
# endif
Py_DECREF(c_api_object);
Py_DECREF(module);
if (!PyXbobCoreRandom_API) {
if (!PyBobCoreRandom_API) {
PyErr_SetString(PyExc_ImportError, "cannot find C/C++ API "
# if PY_VERSION_HEX >= 0x02070000
"capsule"
# else
"cobject"
# endif
" at `" XBOB_CORE_RANDOM_FULL_NAME "._C_API'");
" at `" BOB_CORE_RANDOM_FULL_NAME "._C_API'");
return -1;
}
/* Checks that the imported version matches the compiled version */
int imported_version = *(int*)PyXbobCoreRandom_API[PyXbobCoreRandom_APIVersion_NUM];
int imported_version = *(int*)PyBobCoreRandom_API[PyBobCoreRandom_APIVersion_NUM];
if (XBOB_CORE_API_VERSION != imported_version) {
PyErr_Format(PyExc_ImportError, XBOB_CORE_RANDOM_FULL_NAME " import error: you compiled against API version 0x%04x, but are now importing an API with version 0x%04x which is not compatible - check your Python runtime environment for errors", XBOB_CORE_API_VERSION, imported_version);
if (BOB_CORE_API_VERSION != imported_version) {
PyErr_Format(PyExc_ImportError, BOB_CORE_RANDOM_FULL_NAME " import error: you compiled against API version 0x%04x, but are now importing an API with version 0x%04x which is not compatible - check your Python runtime environment for errors", BOB_CORE_API_VERSION, imported_version);
return -1;
}
......@@ -501,6 +501,6 @@ typedef struct {
# endif //!defined(NO_IMPORT_ARRAY)
#endif /* XBOB_CORE_RANDOM_MODULE */
#endif /* BOB_CORE_RANDOM_MODULE */
#endif /* XBOB_CORE_RANDOM_H */
#endif /* BOB_CORE_RANDOM_H */
......@@ -9,8 +9,8 @@
#include <boost/shared_array.hpp>
#include <boost/make_shared.hpp>
#include <bob/core/logging.h>
#include <xbob.core/config.h>
#include <xbob.blitz/cleanup.h>
#include <bob.core/config.h>
#include <bob.blitz/cleanup.h>
#define PYTHON_LOGGING_DEBUG 0
......@@ -492,7 +492,7 @@ PyDoc_STRVAR(module_docstr, "C++ logging handling");
#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,
......@@ -505,20 +505,20 @@ 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_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION) < 0) return 0;
if (PyModule_AddStringConstant(m, "__version__", BOB_EXT_MODULE_VERSION) < 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
......
......@@ -8,7 +8,7 @@ class variate_generator:
engine
An instance of the RNG you would like to use. This has to be an
object of the class :py:class:`xbob.core.random.mt19937`, already
object of the class :py:class:`bob.core.random.mt19937`, already
initialized.
distribution
......
......@@ -5,12 +5,12 @@
* @brief Binomial distributions (with integers or floating point numbers)
*/
#define XBOB_CORE_RANDOM_MODULE
#include <xbob.core/random.h>
#include <xbob.blitz/cppapi.h>
#define BOB_CORE_RANDOM_MODULE
#include <bob.core/random.h>
#include <bob.blitz/cppapi.h>
#include <boost/make_shared.hpp>
PyDoc_STRVAR(s_binomial_str, XBOB_EXT_MODULE_PREFIX ".binomial");
PyDoc_STRVAR(s_binomial_str, BOB_EXT_MODULE_PREFIX ".binomial");
PyDoc_STRVAR(s_binomial_doc,
"binomial(dtype, [t=1.0, p=0.5]]) -> new binomial distribution\n\
......
......@@ -5,10 +5,10 @@
* @brief Discrete distributions (with integers or floating point numbers)
*/
#define XBOB_CORE_RANDOM_MODULE
#include <xbob.core/random.h>
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#define BOB_CORE_RANDOM_MODULE
#include <bob.core/random.h>
#include <bob.blitz/cppapi.h>
#include <bob.blitz/cleanup.h>
#include <boost/make_shared.hpp>
#include <boost/version.hpp>
......@@ -16,7 +16,7 @@
#include <boost/random/discrete_distribution.hpp>
#endif
PyDoc_STRVAR(s_discrete_str, XBOB_EXT_MODULE_PREFIX ".discrete");
PyDoc_STRVAR(s_discrete_str, BOB_EXT_MODULE_PREFIX ".discrete");
/* How to create a new PyBoostDiscreteObject */
static PyObject* PyBoostDiscrete_New(PyTypeObject* type, PyObject*, PyObject*) {
......
......@@ -5,12 +5,12 @@
* @brief Gamma distributions (with integers or floating point numbers)
*/
#define XBOB_CORE_RANDOM_MODULE
#include <xbob.core/random.h>
#include <xbob.blitz/cppapi.h>
#define BOB_CORE_RANDOM_MODULE
#include <bob.core/random.h>
#include <bob.blitz/cppapi.h>
#include <boost/make_shared.hpp>
PyDoc_STRVAR(s_gamma_str, XBOB_EXT_MODULE_PREFIX ".gamma");
PyDoc_STRVAR(s_gamma_str, BOB_EXT_MODULE_PREFIX ".gamma");
PyDoc_STRVAR(s_gamma_doc,
"gamma(dtype, [alpha=1.]]) -> new gamma distribution\n\
...