ATLAS Offline Software
|
Public Member Functions | |
None | __init__ (self, str connection_string=DEFAULT_CONNECTION_STRING, bool read_only=True, bool create=False, Union[str, Tuple] tag="HEAD") |
None | __del__ (self) |
None | create_defect (self, str name, str description) |
IOVSet | retrieve (self, Optional[Union[int, Tuple[int, int], RunLumi]] since=None, Optional[Union[int, Tuple[int, int], RunLumi]] until=None, Optional[Iterable[Union[str, int]]] channels=None, bool nonpresent=False, bool primary_only=False, Optional[Collection[str]] ignore=None, bool with_primary_dependencies=False, bool intersect=False, bool with_time=False, bool evaluate_full=True) |
def | storage_buffer (self) |
None | insert (self, Union[str, int] defect_id, int since, int until, str comment, str added_by, bool present=True, bool recoverable=False) |
def | insert_multiple (self, Iterable[IOVType] defect_list, str tag='HEAD', bool use_flask=False, str flask_cool_target='oracle://ATONR_COOLOFL_GPN/ATLAS_COOLOFL_GLOBAL', Mapping[str, str] flask_auth={}, str flask_db='CONDBR2', str flask_uri='https://cool-proxy-app.cern.ch/cool/multi_iovs') |
None | validate_clauses (self, str clauses) |
None | update_virtual_defect (self, str defect_name, str clauses, Optional[str] comment=None) |
None | rename_defect (self, str defect_name, str new_defect_name) |
int | new_virtual_defect (self, str defect_name, Optional[str] comment, str clauses) |
Set[str] | resolve_primary_defects (self, Iterable[DefectLogic] defect_logics) |
Mapping[str, DefectLogic] | virtual_defect_logics (self) |
def | get_intolerable_defects (self, bool old_primary_only=True, Sequence[str] exclude=['TIGHT', 'IDTIGHT', 'PHYS_.*']) |
str | logics_tag (self) |
List[str] | logics_tags (self) |
List[str] | defects_tags (self) |
str | next_logics_tag (self) |
str | new_hierarchical_tag (self, str defects_tag, str logics_tag) |
bool | defects_tag_valid (self) |
bool | logics_tag_valid (self) |
None | check_tag_validity (self) |
str | defects_tag (self) |
tagtype | tag (self) |
List[str] | tags (self) |
str | new_logics_tag (self, str description="") |
str | new_defects_tag (self, str name, str description, Optional[Iterable] iovranges=None) |
cool.IFolderSet | parent_folderset (self) |
cool.IFolder | defects_folder (self) |
cool.IFolder | defect_logic_folder (self) |
Set[int] | defect_ids (self) |
Set[str] | defect_names (self) |
MutableMapping[Union[str, int], Union[str, int]] | defect_id_map (self) |
Set[int] | virtual_defect_ids (self) |
Set[str] | virtual_defect_names (self) |
MutableMapping[Union[str, int], Union[str, int]] | virtual_defect_id_map (self) |
int | defect_chan_as_id (self, Union[str, int] channel, bool primary_only=False) |
List[int] | defect_names_as_ids (self, Iterable[Union[str, int]] channels) |
Tuple[Set[int], Set[str], Mapping[Union[str, int], Union[str, int]]] | get_channels (self) |
Tuple[Set[int], Set[str], Mapping[Union[str, int], Union[str, int]]] | get_virtual_channels (self) |
MutableMapping[Union[str, int], str] | get_channel_descriptions (self, Iterable[Union[str, int]] channels) |
MutableMapping[Union[str, int], str] | get_virtual_channel_descriptions (self, Iterable[Union[str, int]] channels) |
Mapping[Union[str, int], str] | all_defect_descriptions (self) |
None | set_channel_description (self, Union[str, int] channel, str description) |
bool | defect_is_virtual (self, Union[str, int] defect_id) |
Union[str, List[str]] | normalize_defect_names (self, Union[str, Iterable[str]] defect_id) |
Public Attributes | |
connection_string | |
logics_tag | |
logics_tag | |
Private Member Functions | |
None | _create_defect_with_id (self, int did, str name, str description) |
None | _insert_iov (self, IOVType iov, str tag) |
None | _insert (self, Union[str, int] defect_id, Union[int, Tuple[int, int], RunLumi] since, Union[int, Tuple[int, int], RunLumi] until, str comment, str added_by, bool present=True, bool recoverable=False, str tag='HEAD') |
def | _insert_multiple_flask (self, Iterable[IOVType] defect_list, str tag, str flask_cool_target, Mapping[str, str] flask_auth, str flask_db, str flask_uri) |
None | _update_virtual_defect (self, str defect_name, str clauses, Optional[str] comment=None, Optional[str] tag=None) |
List[DefectLogic] | _resolve_evaluation_order (self, Optional[Iterable[str]] defects=None) |
Mapping[str, DefectLogic] | _get_virtual_defect_logics (self, str tag) |
bool | _virtual_defect_consistency_check (self) |
None | _tag_head_and_lock (self, cool.IFolder folder, str name, str description) |
None | _clear_connections (self) |
Tuple[cool.IFolder, cool.Record] | _load_folder (self, folder, create_function) |
None | _load_defects_folder (self) |
cool.IFolder | _create_defects_folder (self, cool.IDatabase db) |
None | _load_defect_logic_folder (self) |
cool.IFolder | _create_defect_logic_folder (self, cool.IDatabase db) |
None | _populate_defect_ids (self) |
None | _populate_virtual_defect_ids (self) |
None | _new_defect (self, int did, str dname) |
None | _new_virtual_defect (self, int did, str dname) |
Implementation is split into mixins. DefectsDBIDsNamesMixin: Defines functions for dealing with defect IDs DefectsDBFolderMixin: Logic for loading or creating the COOL folder/database DefectsDBFoldersMixin: Functions for managing tags DefectsDBVirtualDefectsMixin: Internal code for managing and computing virutal defects Public interface is nominally defined in this class (DefectsDB).
Definition at line 38 of file DQDefects/python/db.py.
None python.db.DefectsDB.__init__ | ( | self, | |
str | connection_string = DEFAULT_CONNECTION_STRING , |
||
bool | read_only = True , |
||
bool | create = False , |
||
Union[str, Tuple] | tag = "HEAD" |
||
) |
Create a new DefectsDB instance. The COOL folder resides at `DEFECTS_FOLDER`, which is a module-level varaiable in this module. Parameters: `connection_string` : A COOL connection string, or a string ending in .db. In the latter case, the database is assumed to be a sqlite database at that path. `read_only` : Indicates whether insertions will be disallowed on this connection. (Default: True) `create` : If True, attempt to create the database if it doesn't exist. (Default: False) `tag` : The COOL tag(s) to use. Either a single string used for both defects and virtual defect logic, or a 2-tuple (defecttag, logictag). The default is to use HEAD for both defects and logic. Either folder-level or hierarchical tags can be given.
Definition at line 61 of file DQDefects/python/db.py.
None python.db.DefectsDB.__del__ | ( | self | ) |
Ideally we would use inheritance to call destructors, but this isn't possible in the general case with the way we (ab)use mixins, so we just do it here.
Definition at line 113 of file DQDefects/python/db.py.
|
privateinherited |
Definition at line 29 of file folders.py.
|
privateinherited |
Creates the COOL database/folder for virtual defect logic, if they don't exist. Internal - use create=True in the constructor to create the COOL folder.
Definition at line 115 of file folders.py.
|
private |
Create a new type of defect, specifying the defect ID. See also: `create_defect`, `new_system_defect`. Parameters: `did` : defect_id `name` : name of the defect `description` : a human-readable description of the defect
Definition at line 136 of file DQDefects/python/db.py.
|
privateinherited |
Creates the COOL database/folder for defects, if they don't exist. Internal - use create=True in the constructor to create the COOL folder.
Definition at line 82 of file folders.py.
|
privateinherited |
Definition at line 233 of file virtual_mixin.py.
|
private |
Implementation of insert, allows tag specification for internal functions
Definition at line 328 of file DQDefects/python/db.py.
|
private |
Helper function for inserting IOV objects, since record order doesn't match function argument order
Definition at line 320 of file DQDefects/python/db.py.
|
private |
Definition at line 371 of file DQDefects/python/db.py.
|
privateinherited |
Internal function for populating the self._defect_logic_folder variable
Definition at line 107 of file folders.py.
|
privateinherited |
Internal function for populating the self._defects_folder variable
Definition at line 74 of file folders.py.
|
privateinherited |
|
privateinherited |
Internal function used to keep defect IDs/names uptodate.
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
Returns a list of DefectLogic objects that need to be evaluated, in the correct order for them to be consistent. `defects` should be a list of names
Definition at line 184 of file virtual_mixin.py.
|
privateinherited |
|
privateinherited |
Definition at line 63 of file virtual_mixin.py.
|
privateinherited |
When called, uses an assertion to check that there are no missing defects. This is a database consistency check which should never be violated (but was when DQDefects was new).
Definition at line 266 of file virtual_mixin.py.
|
inherited |
|
inherited |
Create a new type of defect; tries to figure out system ID from the defect name. See also: `create_defect_with_id`, `new_system_defect`. Parameters: `name` : name of the defect `description` : a human-readable description of the defect Returns: the ID number of the new defect
Definition at line 121 of file DQDefects/python/db.py.
|
inherited |
Returns the defect ID for a virtual defect. Accepts a `channel` as an integer/string and returns it as an integer. Will raise DefectUnknownError if `channel` is an unknown ID or string. This function first checks against non-virtual defects, then virutal defects. Thus virtual-defects are lazily loaded.
Definition at line 203 of file ids.py.
|
inherited |
|
inherited |
Gives the set of defect IDs that exist in COOL
|
inherited |
|
inherited |
Returns the folder containing the virtual defect logic, loading it if necessary
Definition at line 100 of file folders.py.
Gives the set of defect names that exist in COOL
|
inherited |
|
inherited |
Returns the folder containing the defects, loading it if necessary
Definition at line 67 of file folders.py.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Return channel IDs, names, and dict relating the two
|
inherited |
Returns primary defects that are depended on by a virtual defect if old_primary_only == True, only return those depended on by a virtual defect with no _ in the name ignores virtual defects in exclude list accepts regexes in exclude list
Definition at line 248 of file virtual_mixin.py.
|
inherited |
|
inherited |
Return channel IDs, names, and dict relating the two
None python.db.DefectsDB.insert | ( | self, | |
Union[str, int] | defect_id, | ||
int | since, | ||
int | until, | ||
str | comment, | ||
str | added_by, | ||
bool | present = True , |
||
bool | recoverable = False |
||
) |
Insert a new defect into the database. Parameters: `defect_id` : The name or channel identifier for the deect `since`, `until` : The COOL IoV for the range `comment` : String255 arbitrary text comment `added_by` : The user name or "sys:"-prefixed string of the application that inserted the defect `present` : The state of the flag (Default: True) `recoverable` : Indicates whether there is any possibility to set present=False in the future (Default: False)
Definition at line 302 of file DQDefects/python/db.py.
def python.db.DefectsDB.insert_multiple | ( | self, | |
Iterable[IOVType] | defect_list, | ||
str | tag = 'HEAD' , |
||
bool | use_flask = False , |
||
str | flask_cool_target = 'oracle://ATONR_COOLOFL_GPN/ATLAS_COOLOFL_GLOBAL' , |
||
Mapping[str, str] | flask_auth = {} , |
||
str | flask_db = 'CONDBR2' , |
||
str | flask_uri = 'https://cool-proxy-app.cern.ch/cool/multi_iovs' |
||
) |
Definition at line 352 of file DQDefects/python/db.py.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Clones the current DEFECTS tag (specified in the constructor) to a new one If iovranges != None, does the slower thing of copying IOVs one by one Parameters: `name` : Name of the new tag `description` : Description of the contents of this tag
|
inherited |
|
inherited |
Create a new virtual defect
Definition at line 149 of file virtual_mixin.py.
|
inherited |
Gives the next available DEFECTLOGICS tag
|
inherited |
Returns correct name(s) of defects, given name(s) that possibly differ from the correct ones by case. Raises if an input name doesn't map to any existing defect. You can pass either a string or an iterable object as `defect_id`.
|
inherited |
Lazy-loads parent folderset (useful for heirarchical tag manipulation)
Definition at line 36 of file folders.py.
|
inherited |
Rename a defect (primary or virtual). Will keep data and channel ID. Will fix up all virtual defect dependencies in all tags.
Definition at line 84 of file virtual_mixin.py.
|
inherited |
Determine which primary flags are used for a given list of input `virtual_defect_names`.
Definition at line 209 of file virtual_mixin.py.
IOVSet python.db.DefectsDB.retrieve | ( | self, | |
Optional[Union[int, Tuple[int,int], RunLumi]] | since = None , |
||
Optional[Union[int, Tuple[int,int], RunLumi]] | until = None , |
||
Optional[Iterable[Union[str,int]]] | channels = None , |
||
bool | nonpresent = False , |
||
bool | primary_only = False , |
||
Optional[Collection[str]] | ignore = None , |
||
bool | with_primary_dependencies = False , |
||
bool | intersect = False , |
||
bool | with_time = False , |
||
bool | evaluate_full = True |
||
) |
Retrieve defects from the database. Parameters: `since`, `until` : IoV range to query (Default: All) `channels` : A list of channels to query. Can contain a mixture of defect names and ids. (Default: None means all channels, including all virtual) `nonpresent` : Only return IoVs which are currently "present" `primary_only` : Only return primary IoVs, no virtual ones. `ignore` : Set of defects which won't be treated as bad. `with_primary_dependencies` : When querying virtual flags, also get primary flags which went into the calculation. `intersect` : Intersect the result with the query range so that no iov spans outside the query range `with_time` : Also retrieves the time the defect was inserted ~2x slower queries, doesn't work for virtual defects `evaluate_full` : If specified, also compute the `comment` and `recoverable` fields of virtual defects. Causes a ~0.6x slowdown
Definition at line 159 of file DQDefects/python/db.py.
|
inherited |
def python.db.DefectsDB.storage_buffer | ( | self | ) |
Gives a new context manager for use with the with statement, e.g.: with ddb.storage_buffer: for d in many_defects: ddb.insert(...defect...)
Definition at line 276 of file DQDefects/python/db.py.
|
inherited |
|
inherited |
|
inherited |
Definition at line 56 of file virtual_mixin.py.
|
inherited |
Definition at line 49 of file virtual_mixin.py.
|
inherited |
|
inherited |
Returns the set of existing virtual defect IDs
|
inherited |
Returns all virtual defects in the form {"defect_name" : DefectLogic()} for the tag DefectDB was constructed on.
Definition at line 221 of file virtual_mixin.py.
Returns the set of existing virtual defect names
|
private |
Definition at line 103 of file DQDefects/python/db.py.
|
privateinherited |
Definition at line 26 of file folders.py.
|
private |
Definition at line 84 of file DQDefects/python/db.py.
|
privateinherited |
Definition at line 109 of file virtual_mixin.py.
|
privateinherited |
|
privateinherited |
Definition at line 24 of file folders.py.
|
privateinherited |
Definition at line 113 of file folders.py.
|
privateinherited |
Definition at line 108 of file virtual_mixin.py.
|
privateinherited |
Definition at line 80 of file folders.py.
|
privateinherited |
Definition at line 23 of file folders.py.
|
privateinherited |
Definition at line 110 of file virtual_mixin.py.
|
privateinherited |
Definition at line 25 of file folders.py.
|
private |
Definition at line 83 of file DQDefects/python/db.py.
|
private |
Definition at line 86 of file DQDefects/python/db.py.
|
privateinherited |
Definition at line 103 of file virtual_mixin.py.
|
privateinherited |
|
privateinherited |
Definition at line 46 of file virtual_mixin.py.
|
privateinherited |
|
privateinherited |
Definition at line 102 of file virtual_mixin.py.
|
privateinherited |
Definition at line 105 of file virtual_mixin.py.
python.db.DefectsDB.connection_string |
Definition at line 82 of file DQDefects/python/db.py.
|
inherited |
Definition at line 59 of file virtual_mixin.py.