Exceptions for File Storage layer.
Bases: tvb.basic.exceptions.TVBException
Exception to be thrown in case of an unexpected problem when migrating an H5 file to a newer version.
Bases: tvb.basic.exceptions.TVBException
Generic exception when storing in data in files.
Bases: tvb.basic.exceptions.TVBException
Exception to be thrown in case of a problem related to File Structure Storage.
Bases: tvb.basic.exceptions.TVBException
A base exception class for all TVB file storage version conversion custom exceptions.
Bases: tvb.storage.h5.file.exceptions.FileVersioningException
Exception that should be raised in case a file is handled by some filemanager which is incompatible with that version of TVB file storage.
Bases: tvb.storage.h5.file.exceptions.FileStorageException
Exception when the file associated to some manager does not exist on disk for some reason.
Bases: tvb.storage.h5.file.exceptions.FileStorageException
Exception when a dataset is accessed, but no written entry exists in HDF5 file for it. we will consider the attribute None.
Bases: tvb.storage.h5.file.exceptions.FileMigrationException
Exception to be thrown in case of an unexpected problem when migrating an H5 file to a newer version.
Bases: tvb.basic.exceptions.TVBException
Exception to be thrown in case a project is to be renamed during sync encryption.
Bases: tvb.basic.exceptions.TVBException
Exception to be thrown in case of an unsupported file storage is chosen. Currently only H5 Storage is supported.
Bases: builtins.object
This class manages all Structure related operations, using File storage. It will handle creating meaning-full entities and retrieving existent ones.
Computes the disk usage of all h5 files under the given directory. :param start_path: :return: A tuple of size in kiB
Given a file’s path, return size occupied on disk by that file. Size should be a number, representing size in KB.
Copy a file from source to dest. source and dest can either be strings or any object with a read or write method, like StringIO for example.
Computes the name/path of the folder where to store images.
Retrieve the root path for the given project. If root folder is not created yet, will create it.
Retrieve project meta info file path.
Returns: | File path for storing Project meta-data File might not exist yet, but parent folder is created after this method call. |
---|
Parameters: |
|
---|
Given a folder path, try to remove that folder from disk. :param ignore_errors: When False throw FileStructureException if folder_path is invalid.
Remove all folders for project or THROW FileStructureException.
Rename Project folder or THROW FileStructureException.
Simple method to unpack ZIP archive in a given folder.
Writes figure meta-data into XML file
Parameters: |
|
---|
Persistence of data in HDF5 format.
Bases: builtins.object
This class is responsible for saving / loading data in HDF5 file / format.
Bases: builtins.object
Helper class in order to buffer data for append operations, to limit the number of actual HDD I/O operations.
This method appends data to an existing data set. If the data set does not exists, create it first.
Parameters: |
|
---|
The synchronization of open/close doesn’t seem to be needed anymore for h5py in contrast to PyTables for concurrent reads. However since it shouldn’t add that much overhead in most situation we’ll leave it like this for now since in case of concurrent writes(metadata) this provides extra safety.
This method reads data from the given data set based on the slice specification
Parameters: |
|
---|---|
Returns: | a numpy.ndarray containing filtered data |
This method reads data-size from the given data set
Parameters: |
|
---|---|
Returns: | a tuple containing data size |
Checks the data version for the current file.
Retrieve ALL meta-data information for root node or for a given data set.
Parameters: |
|
---|---|
Returns: | a dictionary containing all metadata associated with the node |
This method checks if specified file exists and if it has correct HDF5 format :returns: True is file exists and has HDF5 format. False otherwise.
Deleting a data set from H5 file.
:param dataset_name:name of the data set to be deleted :param where: represents the path where dataset is stored (e.g. /data/info)
Remove meta-data information for root node or for a given data set.
Parameters: |
|
---|
Set meta-data information for root node or for a given data set.
Parameters: |
|
---|
This method stores provided data list into a data set in the H5 file.
Parameters: |
|
---|
This module contains logic for meta-data handling.
It handles read/write operations in XML files for retrieving/storing meta-data. More specific: it contains XML Reader/Writer Utility, for generic metadata dictionary.
Bases: builtins.object
Reader for XML with meta-data on generic entities (e.g. Project, Operation).