Index
frequenz.client.common.microgrid ¤
Frequenz microgrid definition.
Classes¤
frequenz.client.common.microgrid.EnterpriseId ¤
Bases: BaseId
A unique identifier for an enterprise account.
Source code in frequenz/client/common/microgrid/__init__.py
Attributes¤
Functions¤
__eq__ ¤
Check if this instance is equal to another object.
Equality is defined as being of the exact same type and having the same underlying ID.
Source code in frequenz/core/id.py
__hash__ ¤
__hash__() -> int
Return the hash of this instance.
The hash is based on the exact type and the underlying ID to ensure that IDs of different types but with the same numeric value have different hashes.
Source code in frequenz/core/id.py
__init__ ¤
__init__(id_: int) -> None
Initialize this instance.
PARAMETER | DESCRIPTION |
---|---|
id_
|
The numeric unique identifier.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the ID is negative. |
Source code in frequenz/core/id.py
__init_subclass__ ¤
Initialize a subclass, set its string prefix, and perform checks.
PARAMETER | DESCRIPTION |
---|---|
str_prefix
|
The string prefix for the ID type (e.g., "MID"). Must be unique across all ID types.
TYPE:
|
allow_custom_name
|
If True, bypasses the check that the class name must end with "Id". Defaults to False.
TYPE:
|
**kwargs
|
Forwarded to the parent's init_subclass.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
TypeError
|
If |
Source code in frequenz/core/id.py
__lt__ ¤
Check if this instance is less than another object.
Comparison is only defined between instances of the exact same type.
Source code in frequenz/core/id.py
__new__ ¤
Create a new instance of the ID class, only if it is a subclass of BaseId.
frequenz.client.common.microgrid.MicrogridId ¤
Bases: BaseId
A unique identifier for a microgrid.
Source code in frequenz/client/common/microgrid/__init__.py
Attributes¤
Functions¤
__eq__ ¤
Check if this instance is equal to another object.
Equality is defined as being of the exact same type and having the same underlying ID.
Source code in frequenz/core/id.py
__hash__ ¤
__hash__() -> int
Return the hash of this instance.
The hash is based on the exact type and the underlying ID to ensure that IDs of different types but with the same numeric value have different hashes.
Source code in frequenz/core/id.py
__init__ ¤
__init__(id_: int) -> None
Initialize this instance.
PARAMETER | DESCRIPTION |
---|---|
id_
|
The numeric unique identifier.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If the ID is negative. |
Source code in frequenz/core/id.py
__init_subclass__ ¤
Initialize a subclass, set its string prefix, and perform checks.
PARAMETER | DESCRIPTION |
---|---|
str_prefix
|
The string prefix for the ID type (e.g., "MID"). Must be unique across all ID types.
TYPE:
|
allow_custom_name
|
If True, bypasses the check that the class name must end with "Id". Defaults to False.
TYPE:
|
**kwargs
|
Forwarded to the parent's init_subclass.
TYPE:
|
RAISES | DESCRIPTION |
---|---|
TypeError
|
If |
Source code in frequenz/core/id.py
__lt__ ¤
Check if this instance is less than another object.
Comparison is only defined between instances of the exact same type.
Source code in frequenz/core/id.py
__new__ ¤
Create a new instance of the ID class, only if it is a subclass of BaseId.