XMLH5StorageManager¶
- class XMLH5StorageManager(*args)¶
Storage manager that drives a XML file for metadata and HDF5 binary file for sample data.
- Available constructors:
XMLH5StorageManager(filename)
XMLH5StorageManager(filename, compressionLevel)
- Parameters
- fileNamestr
Name of the file containing the study. Will also specify the name of the h5 file, which will be created next to the XML file.
- compressionLevelint
Compression level of the resulting XML file, in the range 0,…,9 (0=no compression, 9=best compression). The compression is done only if the XML lib has been compiled with zlib support. The default value is given by ‘XMLStorageManager-DefaultCompressionLevel’ in
ResourceMap
.
See also
Notes
XMLH5StorageManager enables to read and write OPENTURNS’ objects from a XML file and the associated HDF5 file.
Methods
finalize
(*args)Do some administrative tasks after saving/reloading.
Accessor to the object’s name.
Return the version of the study that the manager can read/write.
Get the name of the file containing the study.
getStudy
()Get the study bound to the manager.
Get the study version.
initialize
(*args)Do some administrative tasks before saving/reloading.
isSavedObject
(id)Tell if an object is already saved.
load
(study)Reload the whole study from the medium.
Tell that an object is saved.
read
()Read and create the internal representation.
save
(obj, label[, fromStudy])Save the object onto the medium.
setFileName
(fileName)Set the name of the file containing the study.
setStudy
(p_study)Set the study bound to the manager.
setStudyVersion
(version)Set the study version.
write
()Write the internal representation.
checkStorageManager
setStorageManager
- __init__(*args)¶
Initialize self. See help(type(self)) for accurate signature.
- finalize(*args)¶
Do some administrative tasks after saving/reloading.
- Available usages
finalize(ot.SaveAction())
finalize(ot.LoadAction())
- getClassName()¶
Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
- getDefaultStudyVersion()¶
Return the version of the study that the manager can read/write.
- Returns
- versionpositive int
Version of the study that the manager can read/write.
- getFileName()¶
Get the name of the file containing the study.
- Returns
- fileNamestr
Name of the file containing the study.
- getStudyVersion()¶
Get the study version.
- Returns
- versionpositive int
Study version.
- initialize(*args)¶
Do some administrative tasks before saving/reloading.
- Available usages
initialize(ot.SaveAction())
initialize(ot.LoadAction())
- isSavedObject(id)¶
Tell if an object is already saved.
- Returns
- isSavedbool
True if an object is already saved.
- load(study)¶
Reload the whole study from the medium.
- Parameters
- study
Study
The study to reload objects from.
- study
- markObjectAsSaved(id)¶
Tell that an object is saved.
- Parameters
- Idint
Internal identifier of the object.
- read()¶
Read and create the internal representation.
- save(obj, label, fromStudy=False)¶
Save the object onto the medium.
- Parameters
- object
PersistentObject
Object to be saved.
- labelstr
Name associate with the object to be saved.
- fromStudybool, optional
Flag telling if the object was explicitely put in the study or not. By default, it is equal to False.
- object
- setFileName(fileName)¶
Set the name of the file containing the study.
- Parameters
- fileNamestr
Name of the file containing the study.
- setStudy(p_study)¶
Set the study bound to the manager.
- Parameters
- study
Study
Study bound to the manager.
- study
- setStudyVersion(version)¶
Set the study version.
- Parameters
- versionpositive int
Study version.
- write()¶
Write the internal representation.