Table¶
-
class
hep_rfm.
Table
(files=None, description='', last_update=None, version=None)[source]¶ Bases:
dict
Create a table storing the information about files.
Parameters: Variables: - description – string with a description of the values contained in the table.
- last_update – data and time of the last update done to the table. The value is only filled for tables read from a file. If the table is created from scratch, then it is set to None.
- version – version of the package used to create the table. The value is only filled for tables read from a file. If the table is created from scratch, then it is set to None.
Note
For tables built from a file, the version corresponds to that of the hep_rfm package used to create them, although the structure corresponds to that of the current. The information of the last update is set to None for just created tables, and it is set only for tables read from files.
Warning
If a dictionary of files is provided in “files”, then it is necessary for each key to be equal to the name of its related file.
See also
Methods Summary
from_fields
(**fields)Build the class from a set of fields, which might or not coincide with those in the class constructor. from_files
(files[, description, …])Build the class from a list of hep_rfm.FileInfo
instances.read
(path)Build a table from the information in the file at the given local path. updated
([files, modifiers, parallelize])Return an updated version of this table, checking again all the properties of the files within it. write
(path[, backup])Write this table in the following location. Methods Documentation
-
classmethod
from_fields
(**fields)[source]¶ Build the class from a set of fields, which might or not coincide with those in the class constructor.
Parameters: fields (dict) – dictionary of fields to process. Returns: built table. Return type: Table
-
classmethod
from_files
(files, description='', last_update=None, version=None)[source]¶ Build the class from a list of
hep_rfm.FileInfo
instances. The names of the files are used as keys for the table.Parameters:
-
classmethod
read
(path)[source]¶ Build a table from the information in the file at the given local path.
Parameters: path (str) – path to the text file storing the table. Returns: built table. Return type: Table
-
updated
(files=None, modifiers=None, parallelize=False)[source]¶ Return an updated version of this table, checking again all the properties of the files within it.
Parameters: - files (collection(str)) – files to update within the table. The returned table will contain the same entries as the parent, but with the files specified in “files” updated.
- modifiers (dict) – information to modify the path of this class.
- parallelize (int) – number of processes allowed to parallelize the synchronization of all the proxies. By default it is set to 0, so no parallelization is done.
Returns: updated version of the table.
Return type: