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

latest: datetime

Alias for field number 0

station: Station

Alias for field number 1

app.tasks.category_mapping(value, mapping, right=True) ndarray[tuple[Any, ...], dtype[str_]][source]

Maps a value array to categories.

Taken from: https://github.com/CenterForTheBuiltEnvironment/pythermalcomfort/blob/496f3799de287737f2ea53cc6a8c900052a29aaa/pythermalcomfort/utilities.py#L378-L397

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:
Return type:

datetime | None

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:
Return type:

DeploymentInfo

Returns:

A named tuple with the latest date with data, the station object and the deployments that are relevant.

app.tasks.reduce_pressure(p, alt) float | pd.Series[float][source]

Correct barometric pressure in hPa to sea level Wallace, J.M. and P.V. Hobbes. 197725 Atmospheric Science: An Introductory Survey. Academic Press

app.tasks.setup_periodic_tasks(sender, **kwargs) None[source]
Return type:

None