tmancal74 / quantarhei

Open Quantum System Theory for Molecular Systems
MIT License
21 stars 16 forks source link

save, savedata, load, loaddata methods for spectra and containers #30

Closed tmancal74 closed 5 years ago

tmancal74 commented 7 years ago

methods save and load should save and load the whole object with its details (perhaps load should be create an instance of the object and use its _load() method, which fills it? - in both cases an init method to create an empty object is needed). Methods savedata and loaddata, just save and read data from an into the existing object.

tmancal74 commented 7 years ago

we will use: save_data(filename) load_data(filename)

tmancal74 commented 7 years ago

With the latest commit, only save_data() and load_data() for TwoDSpectrum remains to be implemented.

tmancal74 commented 7 years ago

save and load methods are now inherited from Saveable class. Data saving is now implemented individually in different classes. It would make sense to also implement it centrally in a special class from which other inherit. Something like: DataSaveable, which would provide methods save_data and load_data.

tmancal74 commented 5 years ago

now load and save methods are available through Savable class from the quantarhei.core package, and save_data and load_data are available thought DataSavable class of the quantarhei.core package. Various formats like .dat, .txt, .mat, .npy are available for all classes which subclass DataSavable class. Currently, TwoDSpectrum and AbsSpectrum can be saved like this.