ATLAS Offline Software
|
File argument class. More...
Public Member Functions | |
def | __init__ (self, value=list(), type=None, subtype=None, io='output', splitter=',', runarg=True, guid=None, multipleOK=None, name=None, executor=list(), mergeTargetSize=-1, auxiliaryFile=False) |
Initialise an argFile. More... | |
def | value (self) |
Argument value getter. More... | |
def | value (self, value) |
Argument value setter. More... | |
def | multipleOK (self) |
multipleOK getter More... | |
def | multipleOK (self, value) |
multipleOK value setter More... | |
def | mergeTargetSize (self) |
mergeTargeSize value getter More... | |
def | mergeTargetSize (self, value) |
mergeTargeSize value setter More... | |
def | prodsysDescription (self) |
def | executor (self) |
Executor status getter. More... | |
def | valueSetter (self, value) |
Set the argFile value, but allow parameters here. More... | |
def | io (self) |
def | io (self, value) |
def | dataset (self) |
def | dataset (self, value) |
def | orignalName (self) |
def | originalName (self, value) |
def | type (self) |
def | type (self, value) |
def | subtype (self) |
def | subtype (self, value) |
def | name (self) |
Name getter. More... | |
def | name (self, value) |
Name setter. More... | |
def | auxiliaryFile (self) |
def | metadata (self) |
Returns the whole kit and kaboodle... More... | |
def | nentries (self) |
Return total number of events in all constituent files. More... | |
def | getnentries (self, fast=False) |
Explicit getter, offering fast switch. More... | |
def | getMetadata (self, files=None, metadataKeys=None, maskMetadataKeys=None, populate=True, flush=False) |
Return specific keys for specific files. More... | |
def | getSingleMetadata (self, fname, metadataKey, populate=True, flush=False) |
Convenience function to extract a single metadata key for a single file. More... | |
def | isCached (self, files=None, metadataKeys=None) |
Test if certain metadata elements are already cached. More... | |
def | __str__ (self) |
String representation of a file argument. More... | |
def | append (self, addme) |
Append a value to the list. More... | |
def | __repr__ (self) |
Repr conversion. More... | |
def | isRunarg (self) |
Return runarg status. More... | |
def | __eq__ (self, other) |
Comparison is based on value attribute. More... | |
def | __nq__ (self, other) |
def | __lt__ (self, other) |
def | __gt__ (self, other) |
Public Attributes | |
io | |
dataset | |
value | |
Private Member Functions | |
def | _resetMetadata (self, files=[]) |
Resets all metadata files in this instance. More... | |
def | _readMetadata (self, files, metadataKeys) |
Check metadata is in the cache or generate it if it's missing. More... | |
def | _setMetadata (self, files=None, metadataKeys={}) |
Set metadata values into the cache. More... | |
def | _getDatasetFromFilename (self, reset=False) |
Look for dataset name in dataset::filename Tier0 convention. More... | |
def | _getSize (self, files) |
Determines the size of files. More... | |
def | _getIntegrity (self, files) |
File integrity checker. More... | |
def | _generateGUID (self, files) |
Generate a GUID on demand - no intrinsic for this file type More... | |
def | _exists (self, files) |
Try to determine if a file actually exists... More... | |
def | _mergeArgs (self, argdict, copyArgs=None) |
Utility to strip arguments which should not be passed to the selfMerge methods of our child classes. More... | |
Private Attributes | |
_dataset | |
_urlType | |
_type | |
_subtype | |
_guid | |
_mergeTargetSize | |
_auxiliaryFile | |
_originalName | |
_exe | |
_metadataKeys | |
_fileMetadata | |
_io | |
Input file globbing and expansion. More... | |
_multipleOK | |
_value | |
_name | |
_splitter | |
_supressEmptyStrings | |
_runarg | |
def python.trfArgClasses.argFile.__init__ | ( | self, | |
value = list() , |
|||
type = None , |
|||
subtype = None , |
|||
io = 'output' , |
|||
splitter = ',' , |
|||
runarg = True , |
|||
guid = None , |
|||
multipleOK = None , |
|||
name = None , |
|||
executor = list() , |
|||
mergeTargetSize = -1 , |
|||
auxiliaryFile = False |
|||
) |
Initialise an argFile.
io | input , output or temporary file, default output . |
splitter | changes character a string list is split on, default is a comma (see argList). |
type | Datatype in this instance - this should be the major datatype (ESD, AOD, etc). |
subtype | The data subtype, which should match the DATATYPE portion of the corresponding argument name, e.g., outputDESD_SGLMUFile -> DESD_SGLMU |
guid | This is a non-standard option and allows the GUID for files without an intrinsic GUID to be set explicitly at initialisation. The parameter should be a dictionary, keyed by filename, which contains the GUID string, e.g., {'file1' : '930de3de-de8d-4819-9129-beef3bb4fadb', 'file2' : ... } |
multipleOK | Explicit declaration of whether multiple arguments are allowed; default is True for input , False for output and temporary |
name | The corresponding key for this argument in the argdict of the transform (e.g., inputESDFile ) |
executor | List of execution substeps where this file type should be added explicitly (e.g., minbias HITS for digitisation) |
mergeTargetSize | Target merge size if this instance supports a selfMerge method. Value is in bytes, with the special values: -1 Always merge to a single file, 0 never merge these files |
auxiliaryFile | Is set to True then all validation for this file is disabled - used for non-primary input files, e.g., pileup inputs |
multipleOK
is True
) Definition at line 544 of file trfArgClasses.py.
|
inherited |
Comparison is based on value attribute.
Definition at line 161 of file trfArgClasses.py.
|
inherited |
Definition at line 170 of file trfArgClasses.py.
|
inherited |
Definition at line 167 of file trfArgClasses.py.
|
inherited |
Definition at line 164 of file trfArgClasses.py.
|
inherited |
Repr conversion.
Return a python parsable string
Reimplemented from python.trfArgClasses.argument.
Definition at line 409 of file trfArgClasses.py.
def python.trfArgClasses.argFile.__str__ | ( | self | ) |
String representation of a file argument.
Reimplemented from python.trfArgClasses.argList.
Definition at line 1201 of file trfArgClasses.py.
|
private |
Try to determine if a file actually exists...
For a posix file, just call stat; for anything else call TFile.Open A small optimisation is to retieve the file_size metadatum at the same time.
Definition at line 1176 of file trfArgClasses.py.
|
private |
Generate a GUID on demand - no intrinsic for this file type
Use uuid.uuid4() call to generate a GUID
Definition at line 1165 of file trfArgClasses.py.
|
private |
Look for dataset name in dataset::filename Tier0 convention.
At the moment all files must be in the same dataset if it's specified. (To change this dataset will need to become a per-file metadatum.)
Definition at line 1089 of file trfArgClasses.py.
|
private |
File integrity checker.
For a 'plain' file, integrity just checks that we can read it
Reimplemented in python.trfArgClasses.argBZ2File, python.trfArgClasses.argNTUPFile, python.trfArgClasses.argHISTFile, python.trfArgClasses.argPOOLFile, and python.trfArgClasses.argBSFile.
Definition at line 1131 of file trfArgClasses.py.
|
private |
Determines the size of files.
Currently only for statable files (posix fs). Caches the
files | List of paths to the files for which the size is determined. |
self._fileMetadata
cache is updated) Definition at line 1113 of file trfArgClasses.py.
|
private |
Utility to strip arguments which should not be passed to the selfMerge methods of our child classes.
copyArgs | If None copy all arguments by default, otherwise only copy the listed keys |
Definition at line 1209 of file trfArgClasses.py.
|
private |
Check metadata is in the cache or generate it if it's missing.
Definition at line 996 of file trfArgClasses.py.
|
private |
Resets all metadata files in this instance.
Metadata dictionary entry is reset for any files given (default all files) and any files that are no longer in this instance have any metadata removed (useful for self merging).
{}
, except for the case when an explicit GUID option was given Definition at line 913 of file trfArgClasses.py.
|
private |
Set metadata values into the cache.
Manually sets the metadata cache values to the values given in the metadata key dictionary here. This is useful for setting values to make checks on file metadata handling.
_exists
metadatum to True
. files | Files to set metadata for (None means "all") |
metadataKeys | Dictionary with metadata keys and values |
Definition at line 1044 of file trfArgClasses.py.
|
inherited |
Append a value to the list.
addme | Item to add |
Definition at line 398 of file trfArgClasses.py.
def python.trfArgClasses.argFile.auxiliaryFile | ( | self | ) |
Definition at line 874 of file trfArgClasses.py.
def python.trfArgClasses.argFile.dataset | ( | self | ) |
Definition at line 814 of file trfArgClasses.py.
def python.trfArgClasses.argFile.dataset | ( | self, | |
value | |||
) |
Definition at line 818 of file trfArgClasses.py.
def python.trfArgClasses.argFile.executor | ( | self | ) |
Executor status getter.
Definition at line 638 of file trfArgClasses.py.
def python.trfArgClasses.argFile.getMetadata | ( | self, | |
files = None , |
|||
metadataKeys = None , |
|||
maskMetadataKeys = None , |
|||
populate = True , |
|||
flush = False |
|||
) |
Return specific keys for specific files.
files | List of files to return metadata for (default - all files in this instance) |
metadataKeys | Keys to return (default - all keys valid for this class of files) |
maskMetadataKeys | Keys to NOT return (useful when metadataKeys is left as default) |
populate | If missing keys should be generated by calling the population subroutines |
flush | If cached data should be flushed and the generators rerun |
Definition at line 941 of file trfArgClasses.py.
def python.trfArgClasses.argFile.getnentries | ( | self, | |
fast = False |
|||
) |
Explicit getter, offering fast switch.
Definition at line 890 of file trfArgClasses.py.
def python.trfArgClasses.argFile.getSingleMetadata | ( | self, | |
fname, | |||
metadataKey, | |||
populate = True , |
|||
flush = False |
|||
) |
Convenience function to extract a single metadata key for a single file.
Retrieves a single metadata item for a single file, returning it directly
fname | File to return metadata for |
metadataKey | Key to return |
populate | If missing key should be generated by calling the population subroutines |
flush | If cached data should be flushed and the generator rerun |
Definition at line 985 of file trfArgClasses.py.
def python.trfArgClasses.argFile.io | ( | self | ) |
Definition at line 803 of file trfArgClasses.py.
def python.trfArgClasses.argFile.io | ( | self, | |
value | |||
) |
Definition at line 807 of file trfArgClasses.py.
def python.trfArgClasses.argFile.isCached | ( | self, | |
files = None , |
|||
metadataKeys = None |
|||
) |
Test if certain metadata elements are already cached.
Will test for a cached value for all files and all keys given, aborting as soon as it finds a single uncached value.
files | Files to check (defaults to all files) |
metadataKeys | Keys to check (defaults to all keys) |
Definition at line 1061 of file trfArgClasses.py.
|
inherited |
Return runarg status.
Definition at line 134 of file trfArgClasses.py.
def python.trfArgClasses.argFile.mergeTargetSize | ( | self | ) |
mergeTargeSize value getter
Definition at line 613 of file trfArgClasses.py.
def python.trfArgClasses.argFile.mergeTargetSize | ( | self, | |
value | |||
) |
mergeTargeSize value setter
Definition at line 618 of file trfArgClasses.py.
def python.trfArgClasses.argFile.metadata | ( | self | ) |
Returns the whole kit and kaboodle...
Definition at line 880 of file trfArgClasses.py.
def python.trfArgClasses.argFile.multipleOK | ( | self | ) |
def python.trfArgClasses.argFile.multipleOK | ( | self, | |
value | |||
) |
multipleOK value setter
Definition at line 608 of file trfArgClasses.py.
def python.trfArgClasses.argFile.name | ( | self | ) |
Name getter.
Reimplemented from python.trfArgClasses.argument.
Definition at line 847 of file trfArgClasses.py.
def python.trfArgClasses.argFile.name | ( | self, | |
value | |||
) |
Name setter.
Reimplemented from python.trfArgClasses.argument.
Definition at line 855 of file trfArgClasses.py.
def python.trfArgClasses.argFile.nentries | ( | self | ) |
Return total number of events in all constituent files.
Definition at line 886 of file trfArgClasses.py.
def python.trfArgClasses.argFile.originalName | ( | self, | |
value | |||
) |
Definition at line 826 of file trfArgClasses.py.
def python.trfArgClasses.argFile.orignalName | ( | self | ) |
Definition at line 822 of file trfArgClasses.py.
def python.trfArgClasses.argFile.prodsysDescription | ( | self | ) |
Reimplemented from python.trfArgClasses.argList.
Reimplemented in python.trfArgClasses.argFTKIPFile, python.trfArgClasses.argBZ2File, python.trfArgClasses.argNTUPFile, python.trfArgClasses.argHISTFile, python.trfArgClasses.argPOOLFile, python.trfArgClasses.argBSFile, and python.trfArgClasses.argAthenaFile.
Definition at line 625 of file trfArgClasses.py.
def python.trfArgClasses.argFile.subtype | ( | self | ) |
Definition at line 838 of file trfArgClasses.py.
def python.trfArgClasses.argFile.subtype | ( | self, | |
value | |||
) |
Definition at line 842 of file trfArgClasses.py.
def python.trfArgClasses.argFile.type | ( | self | ) |
Definition at line 830 of file trfArgClasses.py.
def python.trfArgClasses.argFile.type | ( | self, | |
value | |||
) |
Definition at line 834 of file trfArgClasses.py.
def python.trfArgClasses.argFile.value | ( | self | ) |
Argument value getter.
Reimplemented from python.trfArgClasses.argList.
Definition at line 591 of file trfArgClasses.py.
def python.trfArgClasses.argFile.value | ( | self, | |
value | |||
) |
Argument value setter.
Calls the valueSetter function with the standard options
Reimplemented from python.trfArgClasses.argList.
Definition at line 597 of file trfArgClasses.py.
def python.trfArgClasses.argFile.valueSetter | ( | self, | |
value | |||
) |
Set the argFile value, but allow parameters here.
allowMultiOutputs = True
Definition at line 645 of file trfArgClasses.py.
|
private |
Definition at line 553 of file trfArgClasses.py.
|
private |
Definition at line 547 of file trfArgClasses.py.
|
private |
Definition at line 559 of file trfArgClasses.py.
|
private |
Definition at line 574 of file trfArgClasses.py.
|
private |
Definition at line 551 of file trfArgClasses.py.
|
private |
Input file globbing and expansion.
Definition at line 576 of file trfArgClasses.py.
|
private |
Definition at line 552 of file trfArgClasses.py.
|
private |
Definition at line 569 of file trfArgClasses.py.
|
private |
Definition at line 577 of file trfArgClasses.py.
|
private |
Definition at line 856 of file trfArgClasses.py.
|
private |
Definition at line 554 of file trfArgClasses.py.
|
privateinherited |
Definition at line 110 of file trfArgClasses.py.
|
privateinherited |
Definition at line 357 of file trfArgClasses.py.
|
private |
Definition at line 550 of file trfArgClasses.py.
|
privateinherited |
Definition at line 358 of file trfArgClasses.py.
|
private |
Definition at line 549 of file trfArgClasses.py.
|
private |
Definition at line 548 of file trfArgClasses.py.
|
private |
Definition at line 649 of file trfArgClasses.py.
python.trfArgClasses.argFile.dataset |
Definition at line 666 of file trfArgClasses.py.
python.trfArgClasses.argFile.io |
Definition at line 557 of file trfArgClasses.py.
|
inherited |
@value
.setter function! Definition at line 118 of file trfArgClasses.py.