Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/input_requirement.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Each variable declares the following properties:
| `max_nan` | `int` | both | The model's **tolerance**: max NaNs it can cope with in the series (must be >= 0). **SAP3 enforces this as a pre-`predict` gate** — if exceeded, the model is not called and the station is failed (`DATA_AVAILABILITY`); within tolerance, residual NaNs are delivered **as-is** for the model to handle (decision 1.13). |
| `ensemble_mode`| `EnsembleMode` | future_known | Whether ensemble or single traces are needed (`single` or `ensemble`, default: `single`) |
| `unit` | `Unit` | both | **Required.** The physical unit the model expects this variable in (e.g. `Unit.MM_PER_DAY`). The delivered series is tagged with its unit and delivered **in the declared unit, or rejected loudly at integration** — no data without units. (Automatic unit conversion is a future adapter feature.) |
| `aggregation` | `AggregationMethod \| None` | both | **Optional.** `SUM` or `MEAN`, used when the declared resolution is coarser than the delivered data. Defaults to the per-parameter convention (precipitation / reference_et = `SUM`; state variables = `MEAN`); declare only to override. |
| `aggregation` | `AggregationMethod \| None` | both | **Optional.** `SUM`, `MEAN` or `MAX`, used when the declared resolution is coarser than the delivered data. Defaults to the per-parameter convention (precipitation / reference_et = `SUM`; state variables = `MEAN`); declare only to override. |

---

Expand All @@ -112,7 +112,7 @@ These three are a single coherent concern (mirroring SAP3's `ParameterDefinition

**Units.** Every input variable declares the `unit` it expects (see properties table); outputs declare units via `TargetSpec` / `VariableMetadata`. The `Unit` enum must cover every parameter's unit and is a **sync contract with SAP3's `ParameterDefinition` units** — extended as needed (current additions for forcing: `PERCENT`, `M_PER_S`, `DEGREE`, `W_PER_M2`, `MM_PER_HOUR`).

**Aggregation.** When a model declares a variable at a resolution coarser than the delivered data, SAP3 aggregates with `SUM` or `MEAN`. Default follows the per-parameter convention (precipitation / reference_et = `SUM`; temperature, discharge, SWE and other state variables = `MEAN`); override via the optional `aggregation` property only for a non-default rule.
**Aggregation.** When a model declares a variable at a resolution coarser than the delivered data, SAP3 aggregates with `SUM`, `MEAN` or `MAX` (`MAX` for peak channels, e.g. a window-max discharge a flood threshold is set on). Default follows the per-parameter convention (precipitation / reference_et = `SUM`; temperature, discharge, SWE and other state variables = `MEAN`); override via the optional `aggregation` property only for a non-default rule.

## Static Inputs

Expand Down
2 changes: 1 addition & 1 deletion forecast_interface/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.18"
__version__ = "0.1.19"

from .common import AggregationMethod
from .input import (
Expand Down
1 change: 1 addition & 0 deletions forecast_interface/common/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
class AggregationMethod(Enum):
SUM = "sum"
MEAN = "mean"
MAX = "max"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "forecastinterface"
version = "0.1.18"
version = "0.1.19"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
Expand All @@ -25,7 +25,7 @@ init_typed = true
warn_required_dynamic_aliases = true

[tool.bumpversion]
current_version = "0.1.18"
current_version = "0.1.19"
commit = false
tag = false
allow_dirty = true
Expand Down
3 changes: 2 additions & 1 deletion tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ class TestAggregationMethod:
def test_members_exist(self) -> None:
assert AggregationMethod.SUM.value == "sum"
assert AggregationMethod.MEAN.value == "mean"
assert AggregationMethod.MAX.value == "max"

def test_member_count(self) -> None:
assert len(AggregationMethod) == 2
assert len(AggregationMethod) == 3


class TestVariableStatus:
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading