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

Implement discrete xbob.io packaging

parent 9cbe71de
......@@ -10,7 +10,7 @@ extensions = xbob.buildout
auto-checkout = *
develop = src/xbob.extension
src/xbob.blitz
src/xbob.io
src/xbob.io.base
src/xbob.learn.activation
src/xbob.core
.
......@@ -18,13 +18,13 @@ develop = src/xbob.extension
; options for xbob.buildout extension
debug = true
verbose = true
prefixes = /idiap/group/torch5spro/nightlies/last/bob/linux-x86_64-release
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 = git https://github.com/bioidiap/xbob.io
xbob.io.base = git https://github.com/bioidiap/xbob.io.base
xbob.learn.activation = git https://github.com/bioidiap/xbob.learn.activation
xbob.core = git https://github.com/bioidiap/xbob.core
......
......@@ -4,9 +4,9 @@
# Mon 16 Apr 08:18:08 2012 CEST
from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['xbob.blitz', 'xbob.io', 'xbob.learn.activation', 'xbob.core']))
dist.Distribution(dict(setup_requires=['xbob.blitz', 'xbob.io.base', 'xbob.learn.activation', 'xbob.core']))
from xbob.blitz.extension import Extension
import xbob.io
import xbob.io.base
import xbob.core
import xbob.learn.activation
......@@ -16,7 +16,7 @@ package_dir = os.path.join(package_dir, 'xbob', 'learn', 'mlp', 'include')
include_dirs = [
package_dir,
xbob.blitz.get_include(),
xbob.io.get_include(),
xbob.io.base.get_include(),
xbob.learn.activation.get_include(),
xbob.core.get_include(),
]
......@@ -42,7 +42,7 @@ setup(
install_requires=[
'setuptools',
'xbob.blitz',
'xbob.io',
'xbob.io.base',
'xbob.learn.activation',
'xbob.core',
],
......
......@@ -10,7 +10,7 @@
#define XBOB_LEARN_MLP_MODULE
#include <xbob.blitz/cppapi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.activation/api.h>
#include <xbob.learn.mlp/api.h>
#include <xbob.core/random.h>
......
......@@ -13,7 +13,7 @@
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/api.h>
#include <xbob.io.base/api.h>
#include <xbob.learn.activation/api.h>
#include <xbob.core/random.h>
......@@ -177,7 +177,7 @@ static PyObject* create_module (void) {
return 0;
}
if (import_xbob_io() < 0) {
if (import_xbob_io_base() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
return 0;
......
......@@ -15,8 +15,8 @@ import nose.tools
from . import Machine
from .test_utils import Machine as PythonMachine
import xbob.io
from xbob.io.test_utils import temporary_filename
import xbob.io.base
from xbob.io.base.test_utils import temporary_filename
from xbob.learn.activation import Logistic, HyperbolicTangent
from xbob.core.random import mt19937
......@@ -224,8 +224,8 @@ def test_persistence():
# creates a file that will be used in the next test!
machine_file = temporary_filename()
m.save(xbob.io.HDF5File(machine_file, 'w'))
m2 = Machine(xbob.io.HDF5File(machine_file))
m.save(xbob.io.base.HDF5File(machine_file, 'w'))
m2 = Machine(xbob.io.base.HDF5File(machine_file))
assert m.is_similar_to(m2)
nose.tools.eq_(m, m2)
......
......@@ -20,7 +20,7 @@ PyObject* convert_vector(const std::vector<blitz::Array<double,N>>& v) {
PyObject* retval = PyTuple_New(v.size());
auto retval_ = make_safe(retval);
if (!retval) return 0;
for (int k=0; k<v.size(); ++k) {
for (unsigned int k=0; k<v.size(); ++k) {
auto arr = PyBlitzArrayCxx_NewFromConstArray(v[k]);
if (!arr) return 0;
PyTuple_SET_ITEM(retval, k, PyBlitzArray_NUMPY_WRAP(arr));
......
......@@ -21,7 +21,7 @@
#endif
#include <xbob.blitz/capi.h>
#include <xbob.blitz/cleanup.h>
#include <xbob.io/config.h>
#include <xbob.io.base/config.h>
#include <xbob.learn.activation/config.h>
#include <xbob.learn.mlp/config.h>
#include <xbob.core/config.h>
......@@ -107,10 +107,10 @@ static PyObject* xbob_blitz_version() {
}
/**
* xbob.io c/c++ api version
* xbob.io.base c/c++ api version
*/
static PyObject* xbob_io_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_API_VERSION));
static PyObject* xbob_io_base_version() {
return Py_BuildValue("{ss}", "api", BOOST_PP_STRINGIZE(XBOB_IO_BASE_API_VERSION));
}
/**
......@@ -139,7 +139,7 @@ static PyObject* build_version_dictionary() {
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", xbob_io_version())) return 0;
if (!dict_steal(retval, "xbob.io.base", xbob_io_base_version())) return 0;
if (!dict_steal(retval, "xbob.core", xbob_core_version())) return 0;
if (!dict_steal(retval, "xbob.learn.activation", xbob_learn_activation_version())) return 0;
if (!dict_steal(retval, "Bob", bob_version())) return 0;
......@@ -187,8 +187,12 @@ static PyObject* create_module (void) {
if (!externals) return 0;
if (PyModule_AddObject(m, "externals", externals) < 0) return 0;
/* imports xbob.blitz C-API + dependencies */
if (import_xbob_blitz() < 0) return 0;
/* imports dependencies */
if (import_xbob_blitz() < 0) {
PyErr_Print();
PyErr_Format(PyExc_ImportError, "cannot import `%s'", XBOB_EXT_MODULE_NAME);
return 0;
}
Py_INCREF(m);
return m;
......
Supports Markdown
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