Workspace#

The Workspace module keeps track of the data files of a project. Using this module will simplify access to data and results using coherent filenames across experiments and samples.

One can think of a Workspace as a transparent data structure for ClearMap.

Note

Additional standard filenames can be added in the ftype_to_filename dict.

class Workspace(ws_type=None, directory=None, prefix=None, postfix=None, debug=None, file_type_to_name=None, file_type_synonyms=None, file_type_to_directory_type=None, directory_type_to_name=None, **kwargs)[source]#

Bases: object

Class to organize files.

all_tiles_exist(f_type, file_type_to_name=None, directory=None, expression=None, values=None, prefix=None, extension=None, debug=None, **kwargs)[source]#
create(f_type=None, dtype=None, shape=None, order=None, **kwargs)[source]#
create_debug(f_type, slicing, debug=None, **kwargs)[source]#
directory_name(f_type=None, dirtype=None, ws_type=None, directory=None, default_directory=None, file_type_to_directory_type=None, directory_type_to_name=None, file_type_synonyms=None, return_f_type=False, return_dirtype=False)[source]#
directory_type(f_type=None, ws_type=None, file_type_to_directory_type=None, file_type_synonyms=None, return_f_type=False)[source]#
exists(f_type, file_type_to_name=None, directory=None, expression=None, values=None, prefix=None, extension=None, debug=None, **kwargs)[source]#
expression(*args, **kwargs)[source]#
extension(*args, **kwargs)[source]#
file_list(*args, **kwargs)[source]#
file_name(f_type=None, dirtype=None, ws_type=None, directory=None, expression=None, values=None, prefix=None, postfix=None, extension=None, debug=None, file_type_to_name=None, file_type_synonyms=None, file_type_to_directory_type=None, directory_type_to_name=None, **kwargs)[source]#
filename(*args, **kwargs)[source]#
get_positions(f_type)[source]#
info(tile_axes=None, check_extensions=True, check_directory=True)[source]#
load(file_path)[source]#

Loads the workspace configuration from disk

mosaic_shape(f_type)[source]#
plot(f_type, **kwargs)[source]#
read(*args, **kwargs)[source]#
save(file_path)[source]#

Saves the workspace configuration to disk

source(*args, **kwargs)[source]#
update(*args, **kwargs)[source]#
write(*args, **kwargs)[source]#
property debug#
property directory#
property directory_type_to_name#
property file_type_synonyms#
property file_type_to_directory_type#
property wstype#
directory_name(f_type=None, dirtype=None, ws_type=None, directory=None, default_directory=None, file_type_to_directory_type=None, directory_type_to_name=None, file_type_synonyms=None, return_f_type=False, return_dirtype=False)[source]#

Returns the directory name to use for a file in the work space.

Arguments

f_typestr or None

The type of the file for which the file name is requested. If None, use the

dirtypestr or None

The directory type, overwrites the directory type inferred from the file type if not None.

ws_typestr or None

The type of workspace to use. If None, use the default workspace.

directorystr or None

A specific directory to use.

default_directorystr or None

A default directory to fall back to if not None.

file_type_to_directory_typedict or None

The file type to determine the directory type for. If None, the default is used.

directory_type_to_namedict or None

The mapping between th directory type and the actual directory.

file_type_synonymsdict or None

Additional file type synonyms or abbreviation to use for the file types.

return_f_typebool

If True return also the file type

return_dirtypebool

If True return also the directory type.

Returns

directorystr

The standard directory name of the requested file type.

directory_type(f_type=None, ws_type=None, file_type_to_directory_type=None, file_type_synonyms=None, return_f_type=False)[source]#
file_name(f_type, dirtype=None, ws_type=None, directory=None, default_directory=None, expression=None, values=None, prefix=None, postfix=None, extension=None, debug=None, file_type_to_name=None, file_type_synonyms=None, file_type_to_directory_type=None, directory_type_to_name=None, **kwargs)[source]#

Returns the standard file name to use for a result file.

Arguments

f_typestr or None

The type of the file for which the file name is requested.

dirtypestr or None

The directory type to use for the requested file name.

ws_typestr or None

The type of workspace to use. If None, use the default workspace.

directorystr or None

A specific directory for the file.

default_directorystr or None

A default directory to fall back to if not None.

expressionstr or None

A tag expression to use if f_type is ‘expression’.

valuesdict or None

The values to use in case a tag expression is given.

prefixstr or None

Optional prefix to the file if not None.

postfixstr or list of str or None

Optional postfix to the file if not None.

extensionstr or None

Optional extension to replace existing one.

debugstr, bool or None

Optional string for testing in which the string is added as postfix. If True, ‘debug’ is added.

file_type_to_namedict or None

The file types to name mappings. If None, the default is used.

file_type_synonymsdict or None

Additional file type synonyms or abbreviation to use for the file types.

file_type_to_directory_typedict or None

The file type to determine the directory type for. If None, the default is used.

directory_type_to_namedict or None

The mapping between th directory type and the actual directory.

Returns

filenamestr

The file name of the requested file specifications.

file_type(f_type=None, ws_type=None, file_type_synonyms=None)[source]#