Package pyVerif :: Module Protocol :: Class Protocol
[show private | hide private]
[frames | no frames]

Class Protocol


Manage the Protocols.
Method Summary
  __init__(self, mode_is_dev)
Init the protocol.
  check_ids(self)
Make sanity checks on the ids.
  clients(self)
Get the full list of clients.
  id_of(self, filename)
Return the real id of the given filename.
  impostors_list(self, id)
Get the list of impostors files we can use for training the specified client.
  load(self, path, variant, norm_files)
Load the wanted protocol from the given path.
  norm_ids(self, name)
Get the list of ids used for the given normalization.
  norm_keys(self, name)
Get the list of keys for the specified norm.
  norm_list(self, name, id)
Get the list of files we can use for the specified normalization and the specified id.
  score_list(self, id)
Get the list of files we can use for computing the scores of the specified client.
  train_list(self, id)
Get the list of files we can use for training the specified client.
  _load_file(self, filename)
Internal method for loading the given file.
  _my_import(self, filename)
Internal method for importing a module.

Class Variable Summary
SRE_Pattern has_id_of = ^def\s+id_of\s*\(.*\)\s*:
SRE_Pattern has_something = [a-zA-Z0-9]+
str _map_fn = 'files_real_ids.lst'
str _models_fn = 'for_models.lst'
str _models_impostors_fn = 'for_models_impostors.lst'
str _norm_dir = 'norm'
str _scores_fn = 'for_scores.lst'

Method Details

__init__(self, mode_is_dev=True)
(Constructor)

Init the protocol.

Parameters:
  • mode_is_dev is used to specify if you are in dev or test mode.

check_ids(self)

Make sanity checks on the ids.

The tests done are:
  • every id used for computing scores must be in the ids used for training models,
  • every id used for training models must be in the ids used for computing scores,
  • every id used for computing normalizations must _not_ be in the _real_ ids used for computing scores. (not the claimed id, but the _real_ id).

clients(self)

Get the full list of clients.

Returns the full list of clients defined in the currently loaded protocol.

id_of(self, filename)

Return the real id of the given filename.

impostors_list(self, id)

Get the list of impostors files we can use for training the specified client.

load(self, path, variant=None, norm_files={})

Load the wanted protocol from the given path.

variant may be used if your protocol directory has variants.

You can specify some normalizations with the dictionary
norm_files.

Sample usage:

load ('where/is/the/protocol', variant='Mc',
      norm_files={'world': 'world_list.lst',
                  't-norm': 't-norm_list.lst'})

Note: norm_files keys may be any kind of type you want. Just
use the same when getting the lists with norm_list() method.

norm_ids(self, name)

Get the list of ids used for the given normalization.

norm_keys(self, name=None)

Get the list of keys for the specified norm.

If name is None, return the full list of keys of each norm.

norm_list(self, name, id=None)

Get the list of files we can use for the specified normalization and the specified id.

name must be one of the key you passed to the norm_files of the load() method. If id is None, returns the full list of files used for the specified normalization.

score_list(self, id=None)

Get the list of files we can use for computing the scores of the specified client.

If id is None, returns the full list of files used for computing scores.

train_list(self, id=None)

Get the list of files we can use for training the specified client.

If id is None, returns the full list of files used for training.

_load_file(self, filename)

Internal method for loading the given file.

Returns a dictionary created from the given file.

_my_import(self, filename)

Internal method for importing a module.

This is used for importing a function doing the translation from filename to real id.

Class Variable Details

has_id_of

Type:
SRE_Pattern
Value:
^def\s+id_of\s*\(.*\)\s*:                                              

has_something

Type:
SRE_Pattern
Value:
[a-zA-Z0-9]+                                                           

_map_fn

Type:
str
Value:
'files_real_ids.lst'                                                   

_models_fn

Type:
str
Value:
'for_models.lst'                                                       

_models_impostors_fn

Type:
str
Value:
'for_models_impostors.lst'                                             

_norm_dir

Type:
str
Value:
'norm'                                                                 

_scores_fn

Type:
str
Value:
'for_scores.lst'                                                       

Generated by Epydoc 2.1 on Fri Oct 6 12:25:10 2006 http://epydoc.sf.net