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

Massive update to Bob v2

parent b7358a73
......@@ -3,7 +3,7 @@
*.pyc
.DS_Store
.installed.cfg
xbob.db.atvskeystroke.egg-info/
bob.db.atvskeystroke.egg-info/
parts
develop-eggs
bin
......
language: python
matrix:
include:
- python: 2.7
env:
- secure: nFUUA3ju4Y+JTuLS4N2u+9FZtvWMIKij8wz4OzpLNtPhAitdzZJSiAUgE5uY94MbRlsyBkLuyUiJ144RVRoRmZuaw4Dkr/ntW3Z/zqIni7IYJ4yl3QUPXGSbTH7HR2LQIid7mHkeWcEguyfiusSYhBhmEtxPJoHN4SfaFfveX28=
- secure: bN9g+XWFSBHYsJdjNVk/h0ijua42yi5pfw2EIEpSGAg5IoIVP2ZwwC5Nc3z+w08+TpdyHjFqP7wVj0e0Ltcz2+Ia3sG8sprqC4jaVrEe4E2xaImvzxRUpLBzgO7jbPsi8Kulz1BCuSKcE+P9/wHpGi92DX42+lVw4f2iFtKWEaM=
- BOB_DOCUMENTATION_SERVER=https://www.idiap.ch/software/bob/docs/latest/bioidiap/%s/master
- BOB_UPLOAD_WHEEL="--universal"
- python: 3.3
- python: 3.4
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 libhdf5-serial-dev libatlas-dev libatlas-base-dev liblapack-dev texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- pip install --find-links https://www.idiap.ch/software/bob/wheels/travis/ --use-wheel sphinx nose numpy coverage
- pip install --find-links https://www.idiap.ch/software/bob/wheels/travis/ --use-wheel --pre -r requirements.txt coveralls
install:
- python bootstrap-buildout.py
- ./bin/buildout buildout:develop=. buildout:extensions=bob.buildout buildout:auto-checkout=
script:
- ./bin/python -c 'import pkg_resources; from bob.db.atvskeystroke import get_config; print(get_config())'
- ./bin/coverage run --source=bob.db.atvskeystroke ./bin/nosetests -sv
after_success:
- coveralls
- wget https://raw.githubusercontent.com/bioidiap/bob.extension/master/scripts/upload-wheel.sh
- chmod a+x upload-wheel.sh
- ./upload-wheel.sh
include README.rst bootstrap-buildout.py buildout.cfg COPYING
recursive-include docs *.py *.rst
recursive-include xbob *.sql3
recursive-include bob *.sql3
.. image:: http://img.shields.io/badge/docs-stable-yellow.png
:target: http://pythonhosted.org/bob.db.atvskeystroke/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png
:target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.db.atvskeystroke/master/index.html
.. image:: https://travis-ci.org/bioidiap/bob.db.atvskeystroke.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.db.atvskeystroke
.. image:: https://coveralls.io/repos/bioidiap/bob.db.atvskeystroke/badge.png
:target: https://coveralls.io/r/bioidiap/bob.db.atvskeystroke
.. image:: https://img.shields.io/badge/github-master-0000c0.png
:target: https://github.com/bioidiap/bob.db.atvskeystroke/tree/master
.. image:: http://img.shields.io/pypi/v/bob.db.atvskeystroke.png
:target: https://pypi.python.org/pypi/bob.db.atvskeystroke
.. image:: http://img.shields.io/pypi/dm/bob.db.atvskeystroke.png
:target: https://pypi.python.org/pypi/bob.db.atvskeystroke
=========================
ATVS Keystroke Database
=========================
......@@ -24,7 +40,7 @@ The package is available in two different distribution formats:
1. You can download it from `PyPI <http://pypi.python.org/pypi>`_, or
2. You can download it in its source form from `its git repository
<https://github.com/mgbarrero/xbob.db.atvskeystroke>`_. When you download the
<https://github.com/mgbarrero/bob.db.atvskeystroke>`_. When you download the
version at the git repository, you will need to run a command to recreate
the backend SQLite file required for its operation. This means that the
database raw files must be installed somewhere in this case. With option
......@@ -44,11 +60,11 @@ script)::
install_requires=[
...
"xbob.db.atvskeystroke",
"bob.db.atvskeystroke",
],
Proceed normally with your ``boostrap/buildout`` steps and you should be all
set. That means you can now import the ``xbob.db.atvskeystroke`` namespace into your scripts.
set. That means you can now import the ``bob.db.atvskeystroke`` namespace into your scripts.
Modify your buildout.cfg and download from git
==============================================
......@@ -60,12 +76,11 @@ lines::
[buildout]
...
extensions = mr.developer
extensions =mr.developer
auto-checkout = *
eggs = bob
...
xbob.db.atvskeystroke
eggs = ...
bob.db.atvskeystroke
[sources]
xbob.db.atvskeystroke = git https://github.com/mgbarrero/xbob.db.atvskeystroke.git
bob.db.atvskeystroke = git https://github.com/mgbarrero/bob.db.atvskeystroke.git
...
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
......@@ -13,10 +13,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""The BiosecurID database
"""The ATVSKeystroke database
"""
from .query import Database
from .models import Client, File, Protocol, ProtocolPurpose
__all__ = dir()
def get_config():
"""Returns a string containing the configuration information.
"""
import bob.extension
return bob.extension.get_config(__name__)
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
......@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""This script creates the BiosecurId database in a single pass.
"""This script creates the ATVSKeystroke database in a single pass.
"""
import os,string
......
......@@ -18,7 +18,7 @@
import os
import sys
from bob.db.driver import Interface as BaseInterface
from bob.db.base.driver import Interface as BaseInterface
def dumplist(args):
"""Dumps lists of files based on your criteria"""
......@@ -36,7 +36,7 @@ def dumplist(args):
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
for f in r:
......@@ -64,7 +64,7 @@ def checkfiles(args):
# report
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
if bad:
......@@ -83,7 +83,7 @@ def reverse(args):
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
r = db.reverse(args.path)
......@@ -101,7 +101,7 @@ def path(args):
output = sys.stdout
if args.selftest:
from bob.db.utils import null
from bob.db.base.utils import null
output = null()
r = db.paths(args.id, prefix=args.directory, suffix=args.extension)
......@@ -119,7 +119,7 @@ class Interface(BaseInterface):
def version(self):
import pkg_resources # part of setuptools
return pkg_resources.require('xbob.db.%s' % self.name())[0].version
return pkg_resources.require('bob.db.%s' % self.name())[0].version
def files(self):
......
......@@ -13,17 +13,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Table models and functionality for the BiosecurId database.
"""Table models and functionality for the ATVSKeystroke database.
"""
import os, numpy
import bob.db.utils
from sqlalchemy import Table, Column, Integer, String, ForeignKey, or_, and_, not_
from bob.db.sqlalchemy_migration import Enum, relationship
from bob.db.base.sqlalchemy_migration import Enum, relationship
from sqlalchemy.orm import backref
from sqlalchemy.ext.declarative import declarative_base
import xbob.db.verification.utils
import bob.db.verification.utils
Base = declarative_base()
......@@ -53,7 +52,7 @@ class Client(Base):
return "Client(`%s`, `%s`)" % (self.id, self.stype)
class File(Base, xbob.db.verification.utils.File):
class File(Base, bob.db.verification.utils.File):
"""Generic file container"""
__tablename__ = 'file'
......@@ -74,7 +73,7 @@ class File(Base, xbob.db.verification.utils.File):
def __init__(self, client_id, path, session_id, shot_id):
# call base class constructor
xbob.db.verification.utils.File.__init__(self, client_id = client_id, path = path)
bob.db.verification.utils.File.__init__(self, client_id = client_id, path = path)
self.session_id = session_id
self.shot_id = shot_id
......
......@@ -14,20 +14,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""This module provides the Dataset interface allowing the user to query the
BiosecurID database in the most obvious ways.
ATVSKeystroke database in the most obvious ways.
"""
import os
import six
from bob.db import utils
from .models import *
from .driver import Interface
import xbob.db.verification.utils
import bob.db.verification.utils
SQLITE_FILE = Interface().files()[0]
class Database(xbob.db.verification.utils.SQLiteDatabase,xbob.db.verification.utils.Database):
class Database(bob.db.verification.utils.SQLiteDatabase,bob.db.verification.utils.Database):
"""The dataset class opens and maintains a connection opened to the Database.
It provides many different ways to probe for the characteristics of the data
......@@ -36,8 +35,8 @@ class Database(xbob.db.verification.utils.SQLiteDatabase,xbob.db.verification.ut
def __init__(self, original_directory = None, original_extension = db_file_extension):
# call base class constructor
xbob.db.verification.utils.SQLiteDatabase.__init__(self, SQLITE_FILE, File)
xbob.db.verification.utils.Database.__init__(self, original_directory=original_directory, original_extension=original_extension)
bob.db.verification.utils.SQLiteDatabase.__init__(self, SQLITE_FILE, File)
bob.db.verification.utils.Database.__init__(self, original_directory=original_directory, original_extension=original_extension)
def __group_replace_eval_by_genuine__(self, l):
"""Replace 'eval' by 'Genuine' and returns the new list"""
......@@ -103,7 +102,7 @@ class Database(xbob.db.verification.utils.SQLiteDatabase,xbob.db.verification.ut
The groups to which the subjects attached to the models belong ('Genuine')
Note that 'dev', 'eval' and 'world' are alias for 'Genuine'.
Returns: A list containing all the models (model <-> client in BiosecurID) belonging
Returns: A list containing all the models (model <-> client in AVTSKeystroke) belonging
to the given group.
"""
......@@ -157,7 +156,7 @@ class Database(xbob.db.verification.utils.SQLiteDatabase,xbob.db.verification.ut
Keyword Parameters:
protocol
One of the Biosecurid protocols ('A').
One of the ATVSKeystroke protocols ('A').
purposes
The purposes required to be retrieved ('enrol', 'probe') or a tuple
......
; vim: set fileencoding=utf-8 :
; author: Manuel Guenther <manuel.guenther@idiap.ch>
; date: Wed Feb 13 12:35:29 CET 2013
[buildout]
parts = scripts
develop = .
eggs = xbob.db.atvskeystroke
eggs = bob.db.atvskeystroke
newest = false
[scripts]
recipe = xbob.buildout:scripts
recipe = bob.buildout:scripts
dependent-scripts = true
......@@ -4,16 +4,16 @@
# Mon 13 Aug 2012 12:38:15 CEST
#
# Copyright (C) 2011-2012 Idiap Research Institute, Martigny, Switzerland
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
......@@ -40,7 +40,6 @@ extensions = [
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'bob.sphinxext.plot', # ours add source copying to install directory
]
# The viewcode extension appeared only on Sphinx >= 1.0.0
......@@ -248,7 +247,7 @@ man_pages = [
]
# We want to remove all private (i.e. _. or __.__) members
# We want to remove all private (i.e. _. or __.__) members
# that are not in the list of accepted functions
accepted_private_functions = ['__call__']
......@@ -263,10 +262,10 @@ def member_function_test(app, what, name, obj, skip, options):
# test if the method is documented
if not hasattr(obj, '__doc__') or not obj.__doc__:
return True
# Skips selected members in auto-generated documentation. Unfortunately, old
# versions of Boost.Python will not generate a __self__ member for static
# methods and that screws-up Sphinx processing.
# methods and that screws-up Sphinx processing.
if sphinx.__version__ < "1.0":
# We have to remove objects that do not have a __self__ attribute set
import types
......@@ -276,7 +275,7 @@ def member_function_test(app, what, name, obj, skip, options):
return True
return False
# Default processing flags for sphinx
autoclass_content = 'both'
autodoc_member_order = 'bysource'
......
......@@ -16,16 +16,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from setuptools import setup, find_packages
from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['bob.extension']))
from bob.extension.utils import load_requirements
install_requires = load_requirements()
# Define package version
version = open("version.txt").read().rstrip()
# The only thing we do in this file is to call the setup() function with all
# parameters that define our package.
setup(
name='xbob.db.atvskeystroke',
version='0.0.1',
name='bob.db.atvskeystroke',
version=version,
description='ATVS-Keystroke Database Access API for Bob',
url='http://github.com/mgbarrero/xbob.db.atvskeystroke',
url='http://github.com/mgbarrero/bob.db.atvskeystroke',
license='GPLv3',
author='Marta Gomez-Barrero',
author_email='marta.barrero@uam.es',
......@@ -36,28 +43,13 @@ setup(
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'six', # py2/3 compatibility library
'bob', # base signal proc./machine learning library
'xbob.db.verification.utils>=0.1.4' # defines a set of utilities for face verification databases like this one.
],
namespace_packages = [
'xbob',
'xbob.db',
],
install_requires=install_requires,
entry_points={
# declare database to bob
'bob.db': [
'atvskeystroke = xbob.db.atvskeystroke.driver:Interface',
],
# declare tests to bob
'bob.test': [
'atvskeystroke = xbob.db.atvskeystroke.test:ATVSKeystrokeDatabaseTest',
'atvskeystroke = bob.db.atvskeystroke.driver:Interface',
],
},
......
#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
__import__('pkg_resources').declare_namespace(__name__)
#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
__import__('pkg_resources').declare_namespace(__name__)
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