quantities
LcQuantity
Bases: LcEntity
__hash__()
This needs to be explicit, even though it is identical to the parent class, because otherwise the type is considered unhashable
Returns:
Type | Description |
---|---|
|
cf(flow, locale='GLO', **kwargs)
The semantics here may be confusing, but cf is flow-centered. It converts reports the amount in self that corresponds to a unit of the flow's reference quantity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flow |
|
required | |
locale |
|
'GLO'
|
|
kwargs |
|
{}
|
Returns:
Type | Description |
---|---|
|
new(name, ref_unit, **kwargs)
classmethod
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
the name of the quantity |
required | |
ref_unit |
the string representation of the reference unit for the quantity |
required |
Returns:
Type | Description |
---|---|
|
profile(flow, **kwargs)
This is a ridiculous hack because the profile doesn't depend on self at all. So let's make it non-ridiculous by defaulting to self as ref_quantity, so it's not TOTALLY ridiculous
Parameters:
Name | Type | Description | Default |
---|---|---|---|
flow |
|
required | |
kwargs |
|
{}
|
Returns:
Type | Description |
---|---|
|
set_qi(qi)
Configures the quantity to access its native term manager. Can only be set once; otherwise ignored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qi |
|
required |
Returns:
Type | Description |
---|---|
|
LcUnit
Bases: object
Dummy class to store a reference to a unit definition Design decision: even though ILCD unitgroups have assigned UUIDs, we are not maintaining unitgroups