base_classes
EasyDynamicsBase
Bases: NameMixin, NewBase
Base class for all EasyDynamics classes.
Source code in src/easydynamics/base_classes/easydynamics_base.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 | |
__init__(*args, name='MyEasyDynamicsModel', display_name=None, unique_name=None, **kwargs)
Initialize the EasyDynamicsBase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
object
|
Positional arguments to pass to the parent class. |
()
|
name
|
str
|
Name of the model. |
'MyEasyDynamicsModel'
|
display_name
|
str | None
|
Display name of the model. If None, the name will be used. |
None
|
unique_name
|
str | None
|
Unique name of the model. If None, a unique name will be generated. |
None
|
**kwargs
|
object
|
Additional keyword arguments to pass to the parent class. |
{}
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If name is not a string. |
Source code in src/easydynamics/base_classes/easydynamics_base.py
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 | |
EasyDynamicsModelBase
Bases: NameMixin, ModelBase
Base class for all EasyDynamics models.
Source code in src/easydynamics/base_classes/easydynamics_modelbase.py
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 | |
unit
property
writable
Get the unit of the model.
Returns:
| Type | Description |
|---|---|
str | sc.Unit | None
|
The unit of the model. |
__init__(*args, unit='meV', name='MyEasyDynamicsModel', display_name=None, unique_name=None, **kwargs)
Initialize the EasyDynamicsModelBase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
object
|
Positional arguments to pass to the parent class. |
()
|
unit
|
str | sc.Unit
|
Unit of the model. |
'meV'
|
name
|
str
|
Name of the model. |
'MyEasyDynamicsModel'
|
display_name
|
str | None
|
Display name of the model. If None, the name will be used. |
None
|
unique_name
|
str | None
|
Unique name of the model. If None, a unique name will be generated. |
None
|
**kwargs
|
object
|
Additional keyword arguments to pass to the parent class. |
{}
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If name is not a string. |
Source code in src/easydynamics/base_classes/easydynamics_modelbase.py
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 | |
easydynamics_base
EasyDynamicsBase
Bases: NameMixin, NewBase
Base class for all EasyDynamics classes.
Source code in src/easydynamics/base_classes/easydynamics_base.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 | |
__init__(*args, name='MyEasyDynamicsModel', display_name=None, unique_name=None, **kwargs)
Initialize the EasyDynamicsBase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
object
|
Positional arguments to pass to the parent class. |
()
|
name
|
str
|
Name of the model. |
'MyEasyDynamicsModel'
|
display_name
|
str | None
|
Display name of the model. If None, the name will be used. |
None
|
unique_name
|
str | None
|
Unique name of the model. If None, a unique name will be generated. |
None
|
**kwargs
|
object
|
Additional keyword arguments to pass to the parent class. |
{}
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If name is not a string. |
Source code in src/easydynamics/base_classes/easydynamics_base.py
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 | |
easydynamics_list
EasyDynamicsList
Bases: EasyList[ProtectedType_]
Base class for all EasyDynamics lists.
Source code in src/easydynamics/base_classes/easydynamics_list.py
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
__init__(*args, protected_types=None, display_name=None, unique_name=None, **kwargs)
Initialize the EasyDynamicsList.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
ProtectedType_ | list[ProtectedType_]
|
Initial items to add to the list. Can be a single item or a list of items. Each item must be an instance of one of the protected types. |
()
|
protected_types
|
list[type[ProtectedType_]] | type[ProtectedType_] | None
|
Types that are allowed in the list. Can be a single EasyDynamicsBase or EasyDynamicsModelBase subclass or a list of them. If None, defaults to [EasyDynamicsBase]. |
None
|
display_name
|
str | None
|
Display name of the list. If None, the name will be used. |
None
|
unique_name
|
str | None
|
Unique name of the list. If None, a unique name will be generated. |
None
|
**kwargs
|
object
|
Additional keyword arguments to pass to the EasyList constructor. |
{}
|
Source code in src/easydynamics/base_classes/easydynamics_list.py
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 | |
insert(index, value)
Insert an item into the list at a specific index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
The index at which to insert the item. |
required |
value
|
ProtectedType_
|
The item to insert. Must be an instance of one of the protected types. |
required |
Source code in src/easydynamics/base_classes/easydynamics_list.py
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 | |
append(value)
Append an item to the end of the list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
ProtectedType_
|
The item to append. Must be an instance of one of the protected types. |
required |
Source code in src/easydynamics/base_classes/easydynamics_list.py
91 92 93 94 95 96 97 98 99 100 101 102 | |
pop(index=-1)
Remove and return an item at a specific index or name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | str
|
The index or name at which to pop the item. |
-1
|
Returns:
| Type | Description |
|---|---|
ProtectedType_
|
The item that was popped. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If index is not an int or str. |
KeyError
|
If index is a str and no item with that name is found. |
Source code in src/easydynamics/base_classes/easydynamics_list.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
get_names()
Get a list of the names of all items in the list.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of the names of all items in the list. |
Source code in src/easydynamics/base_classes/easydynamics_list.py
140 141 142 143 144 145 146 147 148 149 | |
get_duplicate_names()
Get a list of duplicate names in the list.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of duplicate names in the list. |
Source code in src/easydynamics/base_classes/easydynamics_list.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
__getitem__(idx)
Get an item by index, slice, or unique_name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int | slice | str
|
|
required |
Returns:
| Type | Description |
|---|---|
ProtectedType_ | EasyDynamicsList[ProtectedType_]
|
The item at the specified index or name, or a new EasyDynamicsList if a slice is provided. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If idx is not an int, slice, or str. |
KeyError
|
If idx is a str and no item with that name is found. |
AmbiguousNameError
|
If idx is a str and multiple items with that name are found. |
Source code in src/easydynamics/base_classes/easydynamics_list.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
easydynamics_modelbase
EasyDynamicsModelBase
Bases: NameMixin, ModelBase
Base class for all EasyDynamics models.
Source code in src/easydynamics/base_classes/easydynamics_modelbase.py
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 | |
unit
property
writable
Get the unit of the model.
Returns:
| Type | Description |
|---|---|
str | sc.Unit | None
|
The unit of the model. |
__init__(*args, unit='meV', name='MyEasyDynamicsModel', display_name=None, unique_name=None, **kwargs)
Initialize the EasyDynamicsModelBase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
object
|
Positional arguments to pass to the parent class. |
()
|
unit
|
str | sc.Unit
|
Unit of the model. |
'meV'
|
name
|
str
|
Name of the model. |
'MyEasyDynamicsModel'
|
display_name
|
str | None
|
Display name of the model. If None, the name will be used. |
None
|
unique_name
|
str | None
|
Unique name of the model. If None, a unique name will be generated. |
None
|
**kwargs
|
object
|
Additional keyword arguments to pass to the parent class. |
{}
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If name is not a string. |
Source code in src/easydynamics/base_classes/easydynamics_modelbase.py
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 | |
name_mixin
NameMixin
Mixin class to add name functionality to EasyDynamics classes.
Source code in src/easydynamics/base_classes/name_mixin.py
5 6 7 8 9 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 | |
name
property
writable
Get the name of the model.
Returns:
| Type | Description |
|---|---|
str
|
The name of the model. |
__init__(*args, name='MyEasyDynamicsModel', **kwargs)
Initialize the NameMixin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
object
|
Positional arguments to pass to the parent class. |
()
|
name
|
str
|
Name of the model. |
'MyEasyDynamicsModel'
|
**kwargs
|
object
|
Keyword arguments to pass to the parent class. |
{}
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If name is not a string. |
Source code in src/easydynamics/base_classes/name_mixin.py
8 9 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 | |