capsul.engine module

Main module

capsul.engine.database_json submodule

capsul.engine.database_populse submodule

capsul.engine.database submodule

class capsul.engine.database.DatabaseEngine[source]

A DatabaseEngine is the base class for all engines allowing to store, retrieve and search metadata associated with a key that can be either a string or a path (i.e. a file or directory name).

To instantiate a DatabaseEngine one must use the factory To date, two concrete DatabaseEngine implementations exist:

  • capsul.engine.database_json.JSONDBEngine

  • capsul.engine.database_populse.PopulseDBEngine

check_path(path, named_directory=None)[source]

Find a pair (named_directory, path) given a path and eventually a named_directory.

If named_directory is not given, path must be absolute or a ValueError is raised. Then, either the corresponding named directory is found or ‘absolute’ is used.

If name_directory is given, the path must be relative (unless named_directory == ‘absolute’) or begin with the path of the named directory.

json_value(name)[source]

Retrieve a value previously stored with set_json_value()

named_directories()[source]

List the names of all named directories. This method may return any iterable value (list, generator, etc.)

named_directory(name)[source]

Return the absolute path of a named directory.

path_metadata(path, named_directory=None)[source]

Retrieve metadata associated with a path.

set_json_value(name, json_value)[source]

Store a json value and associate it with a key given in “name”. The value can be retrieved with method json_value().

@param name: unique key used to identify and retrieve the value @type name: C{string} @param json_value: a value to store in the database @type name: any JSON compatible value

set_named_directory(name, path)[source]

Associate an absolute path to a generic name. This allow to always use a location independent name for a directory such as ‘spm_template’ and to customize the real absolute path in the configuration. These named directories are used when setting/retrieving path metadata with set_path_metadata() and path_metadata().

set_path_metadata(path, metadata, named_directory=None)[source]

Set metadata associated to a path. The metadata are associated to the result of self.check_path(path, named_directory). metadata can be any JSON serializable value.

capsul.engine.module submodule

attributes

axon

fom

fsl

matlab

python

spm

capsul.engine.run submodule

capsul.engine.settings submodule