Equation¤
Equation
dataclass
¤
Equation(
value: Evaluable,
uncertainty: Evaluable,
unit: str,
degree_freedom: float = float("inf"),
comment: str = "",
)
Represents the equation element in an equipment register.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Evaluable
|
The equation to evaluate to calculate the corrected value. |
required |
uncertainty
|
Evaluable
|
The equation to evaluate to calculate the standard uncertainty. |
required |
unit
|
str
|
The unit of the measured quantity. |
required |
degree_freedom
|
float
|
The degrees of freedom. |
float('inf')
|
comment
|
str
|
A comment to associate with the equation. |
''
|
comment
class-attribute
instance-attribute
¤
comment: str = ''
A comment associated with the equation.
degree_freedom
class-attribute
instance-attribute
¤
The degrees of freedom.
uncertainty
instance-attribute
¤
uncertainty: Evaluable
The equation to evaluate to calculate the standard uncertainty.
value
instance-attribute
¤
value: Evaluable
The equation to evaluate to calculate the corrected value.
from_xml
classmethod
¤
Evaluable
dataclass
¤
Represents the <value>
and <uncertainty>
XML elements in an equation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
equation
|
str
|
The string representation of the equation to evaluate. |
required |
variables
|
tuple[str, ...]
|
The names of the variables in the equation. |
required |
ranges
|
dict[str, Range]
|
The numeric range for each variable that the |
dict()
|
ranges
class-attribute
instance-attribute
¤
The numeric range for each variable that the equation
is valid for. The keys are the variable names.
variables
instance-attribute
¤
The names of the variables in the equation.
__call__ ¤
Evaluate the equation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
ArrayLike
|
A mapping of variable names to value(s) to evaluate the equation with. |
{}
|
check_range
|
bool
|
Whether to check that the data is within the allowed range(s). |
True
|
Returns:
Type | Description |
---|---|
NDArray[float64]
|
The equation evaluated. |