genericconfig¶
Generic data model for configuration attributes.
AttrDict
¶
Bases: BaseModel
, Mapping
An object whose attributes can also be accessed through subscription, like with a dictionary.
Source code in oteapi/models/genericconfig.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
Config
¶
Class for configuration of pydantic models.
Source code in oteapi/models/genericconfig.py
14 15 16 17 |
|
extra = 'allow'
class-attribute
¶
__contains__(self, name)
¶
Enable using the 'in' operator on this object.
Source code in oteapi/models/genericconfig.py
19 20 21 |
|
__delitem__(self, key)
¶
Enable deletion access through subscription.
Source code in oteapi/models/genericconfig.py
23 24 25 26 27 28 29 30 31 |
|
__getitem__(self, key)
¶
Enable read access through subscription.
Source code in oteapi/models/genericconfig.py
33 34 35 36 37 |
|
__iter__(self)
¶
Enable **unpacking.
Source code in oteapi/models/genericconfig.py
57 58 59 |
|
__len__(self)
¶
Return number of items.
Source code in oteapi/models/genericconfig.py
53 54 55 |
|
__ne__(self, other)
¶
Source code in oteapi/models/genericconfig.py
77 78 79 80 |
|
__setattr__(self, name, value)
¶
Extend BaseModel.setattr with type-checking.
Source code in oteapi/models/genericconfig.py
39 40 41 42 43 44 45 46 47 |
|
__setitem__(self, key, value)
¶
Enable write access through subscription.
Source code in oteapi/models/genericconfig.py
49 50 51 |
|
get(self, key, default=None)
¶
Mapping get
-method.
Source code in oteapi/models/genericconfig.py
73 74 75 |
|
items(self)
¶
Return a view of all (key, value) pairs.
Source code in oteapi/models/genericconfig.py
61 62 63 |
|
keys(self)
¶
Return a view of all keys.
Source code in oteapi/models/genericconfig.py
65 66 67 |
|
update(self, other=None, **kwargs)
¶
MutableMapping update
-method.
Source code in oteapi/models/genericconfig.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
values(self)
¶
Return a view of all values.
Source code in oteapi/models/genericconfig.py
69 70 71 |
|
GenericConfig
¶
Bases: BaseModel
Generic class for configuration objects.
Source code in oteapi/models/genericconfig.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
configuration: AttrDict = Field(AttrDict(), description='Model-specific configuration options which can either be given as key/value-pairs or set as attributes.')
class-attribute
¶
description: str = Field(__doc__, description='A description of the configuration model.')
class-attribute
¶
__init_subclass__(cls)
¶
Initialize subclass descriptions with their docstrings.
Source code in oteapi/models/genericconfig.py
116 117 118 119 |
|