DataFiles

Inheritance Diagram

Inheritance diagram of tenpy.simulations.post_processing.DataFiles

Methods

DataFiles.__init__([files, folder])

DataFiles.close()

Close all files held open by self.

DataFiles.items()

DataFiles.keys()

Return paths of the files opened.

DataFiles.load_from_folder(folder[, glob])

Load all data files from a given folder.

DataFiles.values()

Return iterator over the DataLoader instances.

class tenpy.simulations.post_processing.DataFiles(files=None, folder=None)[source]

Bases: object

Hold multiple DataLoader instances open, indexed by the filename.

Acts like a dictionary mapping filenames to DataLoader. Item access implicitly opens files that are not yet loaded.

Parameters:

files (list of str) – Filenames of output files to be opened.

Examples

>>> data_files = DataFiles(['results/output_1.h5',
...                         'results_other/output_3.h5'])
>>> data_files['results/output_1.h5']
DataLoader(filename='results/output_1.h5')
>>> data_files['results/output_2.h5']
loading results/output_2.h5 ... successful
close()[source]

Close all files held open by self.

keys()[source]

Return paths of the files opened.

values()[source]

Return iterator over the DataLoader instances.

load_from_folder(folder, glob='*.h5')[source]

Load all data files from a given folder.