module tasks
¶
The tasks performing data downloading and calculations
- class app.tasks.DeploymentInfo(latest, station, deployments)[source]¶
-
deployments:
Sequence
[SensorDeployment
]¶ Alias for field number 2
-
deployments:
- app.tasks.category_mapping(value, mapping, right=True) ndarray[tuple[Any, ...], dtype[str_]] [source]¶
Maps a value array to categories.
- Parameters:
value – The numeric value to map
mapping – A dictionary with the mapping of the values to categories
right – Indicating whether the intervals include the right or the left bin edge. (default:
True
)
- Returns:
The category the value(s) fit(s) into
- async app.tasks.get_latest_data(station, con) datetime | None [source]¶
Get the latest date of data for a station.
- Parameters:
station (
Station
) – The station objectcon (
AsyncSession
) – The database connection
- Return type:
- Returns:
The latest date with data for the station
- async app.tasks.get_station_deployments(station_id, target_table, con) DeploymentInfo [source]¶
Get the deployments for a station and the latest data for that station.
- Parameters:
station_id (
str
) – The station idtarget_table (
type
[BiometData
|TempRHData
]) – The target table to check for the latest datacon (
AsyncSession
) – The database connection
- Return type:
- Returns:
A named tuple with the latest date with data, the station object and the deployments that are relevant.