Row-context bindings¶
Annotate bound values with observation requirements, not function types.
RowContextBinding
dataclass
¶
time
¶
time(value: T, *, dimension: Dimension | Reference | str, before: str = '0s', after: str = '0s') -> RowContextBinding[T]
Bind a value with preceding/following fixed-time requirements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
T
|
The original argument, without conversion to a duration. |
required |
dimension
|
Dimension | Reference | str
|
Datetime dimension along which the window is measured. |
required |
before
|
str
|
Required preceding duration, or |
'0s'
|
after
|
str
|
Required following duration, or |
'0s'
|
Returns:
| Type | Description |
|---|---|
RowContextBinding[T]
|
A binding annotation that is unwrapped during Spec conversion. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If an extent is not a supported fixed duration. |
steps
¶
steps(value: T, *, dimension: Dimension | Reference | str, before: CountExtent = 0, after: CountExtent = 0) -> RowContextBinding[T]
Bind a value with integer-coordinate distances, not observation counts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
T
|
The unchanged function argument. |
required |
dimension
|
Dimension | Reference | str
|
Integer dimension along which distance is measured. |
required |
before
|
CountExtent
|
Preceding coordinate distance, or |
0
|
after
|
CountExtent
|
Following coordinate distance, or |
0
|
Returns:
| Type | Description |
|---|---|
RowContextBinding[T]
|
The argument annotated with its context requirements. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a bound is not a nonnegative integer or |
rows
¶
Bind a value with ordered observation-count requirements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
T
|
The unchanged function argument. |
required |
before
|
CountExtent
|
Preceding observation count, or |
0
|
after
|
CountExtent
|
Following observation count, or |
0
|
Returns:
| Type | Description |
|---|---|
RowContextBinding[T]
|
The argument annotated with its context requirements. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a bound is not a nonnegative integer or |
current
¶
Declare that only the current observation is required.
all_rows
¶
Declare that all observations in the input profile are required.