configuration#

Implements global configuration of Acoular.

Config()

Implements the global configuration of the Acoular package.

config

This instance implements the global configuration of the Acoular package.

class acoular.configuration.Config#

Bases: HasStrictTraits

Implements the global configuration of the Acoular package.

An instance of this class can be accessed for adjustment of the following properties. General caching behaviour can be controlled by global_caching. The package used to read and write .h5 files can be specified by h5library.

Examples

For using Acoular with h5py package and overwrite existing cache:

>>> import acoular
>>> acoular.config.h5library = 'h5py'
>>> acoular.config.global_caching = 'overwrite'
global_caching = Property()#

Flag that globally defines caching behaviour of Acoular classes defaults to ‘individual’.

  • ‘individual’: Acoular classes handle caching behavior individually.

  • ‘all’: Acoular classes cache everything and read from cache if possible.

  • ‘none’: Acoular classes do not cache results. Cachefiles are not created.

  • ‘readonly’: Acoular classes do not actively cache, but read from cache if existing.

  • ‘overwrite’: Acoular classes replace existing cachefile content with new data.

h5library = Property()#

Flag that globally defines package used to read and write .h5 files defaults to ‘pytables’. It is also possible to set it to ‘tables’, which is an alias for ‘pytables’. If pytables cannot be imported, ‘h5py’ is used.

cache_dir = Property()#

Defines the path to the directory containing Acoulars cache files. If the specified cache_dir directory does not exist, it will be created. cache_dir defaults to current session path.

td_dir = Property()#

Defines the working directory containing data files. Used only by WriteH5 class. Defaults to current session path.

use_traitsui = Property()#

Boolean Flag that determines whether user has access to traitsui features. Defaults to False.

have_tables = Property()#

Boolean Flag that determines whether tables is installed.

have_h5py = Property()#

Boolean Flag that determines whether h5py is installed.

have_matplotlib = Property()#

Boolean Flag that determines whether matplotlib is installed.

have_pylops = Property()#

Boolean Flag that determines whether pylops is installed.

have_sounddevice = Property()#

Boolean Flag that determines whether sounddevice is installed.

have_traitsui = Property()#

Boolean Flag that determines whether the package is installed.

acoular.configuration.config = <acoular.configuration.Config object>#

This instance implements the global configuration of the Acoular package.

General caching behaviour can be controlled by the global_caching attribute: * ‘individual’: Acoular classes handle caching behavior individually. * ‘all’: Acoular classes cache everything and read from cache if possible. * ‘none’: Acoular classes do not cache results. Cachefiles are not created. * ‘readonly’: Acoular classes do not actively cache, but read from cache if existing. * ‘overwrite’: Acoular classes replace existing cachefile content with new data.

The package used to read and write .h5 files can be specified by h5library: * ‘PyTables’: Use ‘tables’ (or ‘pytables’, depending on python distribution). * ‘H5py’: Use ‘h5py’.

Some Acoular classes support GUI elements for usage with tools from the TraitsUI package. If desired, this package has to be installed manually, as it is not a prerequisite for installing Acoular. To enable the functionality, the flag attribute use_traitsui has to be set to True (default: False). Note: this is independent from the GUI tools implemented in the spectAcoular package.

Example:

For using Acoular with h5py package and overwrite existing cache:

>>> import acoular
>>> acoular.config.h5library = "h5py"
>>> acoular.config.global_caching = "overwrite"