StorageManager

class StorageManager(defaultVersion=1)

Define the way OpenTURNS’ objects are saved and reloaded.

Available constructors:
StorageManager(defaultVersion=1)
Parameters:

defaultVersion : positive int

Argument interpreted as the name of the object in a user point of view. This name is never used in another way than for user information. This name has no meaning to the platform.

Notes

A StorageManager object can be used only through its derived class XMLStorageManager.

Methods

finalize(*args) Do some administrative tasks after saving/reloading.
getClassName() Accessor to the object’s name.
getDefaultStudyVersion() Return the version of the study that the manager can read/write.
getStudy() Get the study bound to the manager.
getStudyVersion() 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.
markObjectAsSaved(id) Tell that an object is saved.
read() Read and create the internal representation.
save(obj, label[, fromStudy]) Save the object onto the medium.
setStudy(p_study) Set the study bound to the manager.
setStudyVersion(version) Set the study version.
write() Write the internal representation.
__init__(defaultVersion=1)

x.__init__(…) initializes x; see help(type(x)) for 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_name : str

The object class name (object.__class__.__name__).

getDefaultStudyVersion()

Return the version of the study that the manager can read/write.

Returns:

version : positive int

Version of the study that the manager can read/write.

getStudy()

Get the study bound to the manager.

Returns:

study : Study

Study bound to the manager.

getStudyVersion()

Get the study version.

Returns:

version : positive 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:

isSaved : bool

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.

markObjectAsSaved(id)

Tell that an object is saved.

Parameters:

Id : int

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.

label : str

Name associate with the object to be saved.

fromStudy : bool, optional

Flag telling if the object was explicitely put in the study or not. By default, it is equal to False.

setStudy(p_study)

Set the study bound to the manager.

Parameters:

study : Study

Study bound to the manager.

setStudyVersion(version)

Set the study version.

Parameters:

version : positive int

Study version.

write()

Write the internal representation.