skytracker.storage.queries.state.LatestBatchQuery#

class skytracker.storage.queries.state.LatestBatchQuery(limit: int = 0, lat_min: float | None = None, lat_max: float | None = None, lon_min: float | None = None, lon_max: float | None = None, fields: list[str] = None)#

Bases: TableQuery[State]

Query to select the latest aircraft states (with optional bounding box)

Properties

allows_cache

Methods

__init__

Initialize query with optional arguments

from_cache

Filter a cached list of states using stored settings

from_server

Query a list of states from server database

parse_table_row

Parse raw table data into a State

__init__(limit: int = 0, lat_min: float | None = None, lat_max: float | None = None, lon_min: float | None = None, lon_max: float | None = None, fields: list[str] = None) None#

Initialize query with optional arguments

Parameters:
  • limit (int, optional) – maximum number of states to get (0=all). Defaults to 0.

  • lat_min (float, optional) – minimum latitude. Defaults to None.

  • lat_max (float, optional) – maximum latitude. Defaults to None.

  • lon_min (float, optional) – minimum longitude. Defaults to None.

  • lon_max (float, optional) – maximum longitude. Defaults to None.

  • fields (list[str], optional) – names of fields in flattened table. Defaults to None.

async from_cache(states: list[State]) list[State]#

Filter a cached list of states using stored settings

Parameters:

states (list[State]) – cached list of states

Returns:

filtered list of states

Return type:

list[State]

async from_server(table: str, db: DatabaseManager) list[State]#

Query a list of states from server database

Parameters:
  • table (str) – name of database table

  • db (DatabaseManager) – database manager instance

Returns:

selected list of states

Return type:

list[State]

parse_table_row(raw_entry: tuple) State#

Parse raw table data into a State

Parameters:

raw_entry (tuple) – raw table data

Returns:

corresponding State

Return type:

State