PathLoader¶
PathLoader
¶
Data loader for STOUT campaign management system.
Provides methods to load flight data paths and associated metadata from the STOUT database and file system.
Attributes:
| Name | Type | Description |
|---|---|---|
campaign_service |
Service
|
Service for accessing campaign and flight data |
base_data_path |
Optional[Path]
|
Base path where all campaign data is stored |
Initialize the PathLoader.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_data_path
|
Union[str, Path, None]
|
Base path for data storage. Accepts string or Path object. |
required |
Source code in pils/loader/path.py
load_all_flights
¶
Load all flights from all campaigns.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of flight dictionaries containing flight metadata and paths. Each flight dict includes: flight_id, flight_name, campaign_id, takeoff_datetime, landing_datetime, and folder paths. |
Source code in pils/loader/path.py
load_all_campaign_flights
¶
load_all_campaign_flights(campaign_name: str | None = None, campaign_id=None) -> dict[str, Any] | None
Load data for a single flight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
campaign_name
|
Optional[str]
|
Flight name to load (alternative to flight_id) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Flight dictionary with metadata and paths, or None if not found. |
Source code in pils/loader/path.py
load_single_flight
¶
load_single_flight(flight_id: str | None = None, flight_name: str | None = None) -> dict[str, Any] | None
Load data for a single flight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flight_id
|
Optional[str]
|
Flight ID to load |
None
|
flight_name
|
Optional[str]
|
Flight name to load (alternative to flight_id) |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, Any]]
|
Flight dictionary with metadata and paths, or None if not found. |