💽 Data Pipeline API¶
The node_fdm.data namespace handles the transformation of raw flight records into training-ready tensors.
Its primary responsibilities include applying architecture-specific preprocessing hooks via the Flight Processor, normalizing features using robust statistics, and managing efficient sequence loading from disk through the Dataset and Loader utilities.
📘 Class Reference¶
Flight Processor¶
flight_processor
¶
Flight preprocessing pipeline for converting raw data into model-ready columns.
FlightProcessor
¶
Flexible flight data processor with a customizable post-processing hook.
Source code in src/node_fdm/data/flight_processor.py
__init__(model_cols, custom_processing_fn=None)
¶
Initialize the processor with model column configuration and hooks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_cols
|
Tuple[Any, Any, Any, Any, Any]
|
Tuple of model column groups (state, control, env, etc.). |
required |
custom_processing_fn
|
Optional[Callable[[Any], Any]]
|
Optional callable applied after base processing; uses Any for flexibility with DataFrame-like inputs. |
None
|
Source code in src/node_fdm/data/flight_processor.py
process_flight(df)
¶
Run the main flight preprocessing pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
Any
|
DataFrame-like object containing raw flight data. Uses Any for flexibility across wrappers. |
required |
Returns:
| Type | Description |
|---|---|
DataFrameWrapper
|
Processed DataFrameWrapper filtered to model-relevant columns. |
Source code in src/node_fdm/data/flight_processor.py
Dataset¶
dataset
¶
Dataset utilities for loading and segmenting flight data sequences.
SeqDataset
¶
Bases: Dataset
Sequence dataset that loads flight segments for model training.
Source code in src/node_fdm/data/dataset.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | |
__getitem__(idx)
¶
Return tensors for a specific sequence index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
Index of the sequence to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[Tensor, Tensor, Tensor, Tensor]
|
Tuple of tensors for state, control, environment, and derivative slices. |
Source code in src/node_fdm/data/dataset.py
__init__(flights_path_list, model_cols, seq_len=60, shift=60, n_jobs=35, load_parallel=True, custom_fn=(None, None))
¶
Initialize the dataset with flight paths and model column definitions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flights_path_list
|
Sequence[str]
|
Iterable of flight parquet file paths. |
required |
model_cols
|
Tuple[Any, Any, Any, Any, Any]
|
Tuple containing model column groups (state, control, env, etc.). |
required |
seq_len
|
int
|
Sequence length to extract from each flight. |
60
|
shift
|
int
|
Step size when sliding the sequence window. |
60
|
n_jobs
|
int
|
Number of parallel workers to use when loading flights. |
35
|
load_parallel
|
bool
|
Whether to load flights concurrently. |
True
|
custom_fn
|
Tuple[Optional[Callable[[DataFrame], DataFrame]], Optional[Callable[..., bool]]]
|
Tuple of optional processing and segment-filtering callables. |
(None, None)
|
Source code in src/node_fdm/data/dataset.py
__len__()
¶
Return number of available sequences.
Returns:
| Type | Description |
|---|---|
int
|
Count of cached flight sequences. |
get_full_flight(flight_idx)
¶
Return full arrays for a specific flight index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flight_idx
|
int
|
Index of the flight in the provided flight list. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[ndarray, ndarray, ndarray, ndarray, DataFrame]
|
Tuple of state, control, environment, derivative arrays, and the full DataFrame. |
Source code in src/node_fdm/data/dataset.py
init_flight_date()
¶
Load all flights, build sequence cache, and compute aggregate statistics.
Populates internal sequence list and per-column statistics used for normalization.
Source code in src/node_fdm/data/dataset.py
process_one_flight(flight_path)
¶
Process a single flight file into clean, nan-free sequences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flight_path
|
str
|
Path to a flight parquet file. |
required |
Returns:
| Type | Description |
|---|---|
List[Tuple[ndarray, ndarray, ndarray, ndarray]]
|
List of tuples containing state, control, environment, and derivative arrays. |
Source code in src/node_fdm/data/dataset.py
read_flight(flight_path)
¶
Read a flight parquet file and apply base processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flight_path
|
str
|
Path to a parquet file containing flight data. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Processed DataFrame with standardized columns. |
Source code in src/node_fdm/data/dataset.py
Loader¶
loader
¶
Helper for building train/validation datasets.
get_train_val_data(data_df, model_cols, shift=60, seq_len=60, custom_fn=(None, None), load_parallel=True, train_val_num=(5000, 500))
¶
Create training and validation datasets from a labeled file list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_df
|
DataFrame
|
DataFrame containing file paths with a |
required |
model_cols
|
Tuple containing model column groups. |
required | |
shift
|
int
|
Window shift used when generating sequences. |
60
|
seq_len
|
int
|
Sequence length for each sample. |
60
|
custom_fn
|
Tuple[Optional[Callable[[DataFrame], DataFrame]], Optional[Callable[..., bool]]]
|
Tuple of optional processing and segment-filtering callables. |
(None, None)
|
load_parallel
|
bool
|
Whether to load flights concurrently. |
True
|
train_val_num
|
Tuple[int, int]
|
Maximum number of train and validation files to load. |
(5000, 500)
|
Returns:
| Type | Description |
|---|---|
Tuple[SeqDataset, SeqDataset]
|
Tuple of training and validation SeqDataset instances. |