Items data
This script provides dataclasses that represent the relational data components in the server.
Aircraft
dataclass
Bases: BoundedItem
, CoreItem
Aircraft instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model | str | Aircraft model and ID | required |
seat_capacity | int | Seat capacity | required |
Source code in src/rmlab/data/items.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
Airline
dataclass
Bases: BoundedItem
, CoreItem
Airline instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | Airline name and ID | required |
type | str | Airline type (Either 'low-cost' or 'legacy') | 'undefined' |
Source code in src/rmlab/data/items.py
41 42 43 44 45 46 47 48 49 50 51 |
|
Airport
dataclass
Bases: BoundedItem
, CoreItem
Airport instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | Full airport name | required |
city_id | str | City ID of the airport | required |
iata | str | IATA code of the airport | required |
icao | str | ICAO code of the airport | 'undefined' |
altitude | int | Location altitude in MAMSL | 0 |
latitude | int | Location latitude | 0 |
longitude | int | Location longitude | 0 |
Source code in src/rmlab/data/items.py
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 |
|
City
dataclass
Bases: BoundedItem
, CoreItem
City instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | City name and ID | required |
country_id | str | Country ID of the city | required |
Source code in src/rmlab/data/items.py
87 88 89 90 91 92 93 94 95 96 97 |
|
CityRoute
dataclass
Bases: BoundedItem
, DerivedItem
, CustomersModelHolder
, AirlineLocation
Pair of cities with unspecified direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
first_id | str | First city ID of the pair in alphabetical order | required |
second_id | str | Second city ID of the pair in alphabetical order | required |
Source code in src/rmlab/data/items.py
113 114 115 116 117 118 119 120 121 122 123 |
|
CitySector
dataclass
Bases: BoundedItem
, DerivedItem
, CustomersModelHolder
, AirlineLocation
Pair of cities with specified direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
origin_id | str | Departure city ID | required |
destination_id | str | Arrival city ID | required |
Source code in src/rmlab/data/items.py
100 101 102 103 104 105 106 107 108 109 110 |
|
Country
dataclass
Bases: BoundedItem
, CoreItem
Country instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name | str | Country name and ID | required |
currency | CurrencyKind | Country currency | required |
Source code in src/rmlab/data/items.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
Flight
dataclass
Bases: UnboundedItem
, DerivedItem
, PricingModelHolder
Flight instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seat_capacity | int | Seat capacity | required |
schedule_id | str | Schedule ID | required |
sector_id | str | Sector ID | required |
citysector_id | str | CitySector ID | required |
airline_id | str | Airline ID | required |
aircraft_id | str | Aircraft ID | required |
flight_number | str | Flight number identifier | required |
onsale_date_time | datetime | Flight is put on sale this date, upto days (year-month-day) | required |
departure_date_time | datetime | Departure date and time, upto minutes (year-month-day-hour-minute) | required |
fares | List[str] | List of fare identifiers | required |
lowest_pps | int | Price per seat of the lowest fare in cents | required |
highest_pps | int | Price per seat of the highest fare in cents | required |
Source code in src/rmlab/data/items.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
|
PModel
dataclass
Bases: BoundedItem
, CoreItem
Item holding a set of parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename | str | Name of file storing the parameters | required |
hash | str | MD5 hash of the content | required |
cnt | str | Model content | required |
Source code in src/rmlab/data/items.py
26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
Route
dataclass
Bases: BoundedItem
, DerivedItem
, AirlineLocation
Pair of airports with unspecified direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
first_id | str | First airport ID of the pair in alphabetical order | required |
second_id | str | Second airport ID of the pair in alphabetical order | required |
Source code in src/rmlab/data/items.py
168 169 170 171 172 173 174 175 176 177 178 179 |
|
Schedule
dataclass
Bases: UnboundedItem
, CoreItem
Schedule instance. Template generator for flights in an airline with common aircraft, sector and days of week.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
airline_id | str | Airline ID | required |
aircraft_id | str | Aircraft ID | required |
origin_id | str | Departure airport ID | required |
destination_id | str | Arrival airport ID | required |
days_of_week | List[DayOfWeek] | Days of week | required |
departure_time | timedelta | Departure time upto minutes (hour-minutes) | required |
duration | timedelta | Flight duration upto minutes (hour-minutes) | required |
flight_number | int | Flight number identifier | required |
sell_before_days | int | Flights are put on sale these days before departure day | required |
from_date | datetime | Start date of the range of flight departures, upto days (year-month-day) | required |
to_date | datetime | End date of the range of flight departures, up to days (year-month-day) | required |
sector_id | str | Sector ID | required |
citysector_id | str | CitySector ID | required |
route_id | str | Route ID | required |
cityroute_id | str | CityRoute ID | required |
from_date_load | datetime | Start date of the selling period, upto days (year-month-day) | required |
to_date_load | datetime | End date of the selling period, upto days (year-month-day) | required |
from_date_departure | datetime | Date of the first departure, upto days (year-month-day) | required |
to_date_departure | datetime | Date of the last departure, up to days (year-month-day) | required |
Source code in src/rmlab/data/items.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
Sector
dataclass
Bases: BoundedItem
, DerivedItem
, AirlineLocation
Pair of airports with specified direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
origin_id | str | Departure airport ID | required |
destination_id | str | Arrival airport ID | required |
Source code in src/rmlab/data/items.py
154 155 156 157 158 159 160 161 162 163 164 165 |
|