Configuration
pyBADA Common configuration module Developped @EUROCONTROL (EIH) 2024
- pyBADA.configuration.getAircraftList(badaFamily, badaVersion)[source]
Retrieve a list of available aircraft for a given BADA family and version.
This function checks if the specified BADA family and version directory exists, and if so, determines whether the aircraft data is stored in XML format or as standard ASCII files (like OPF, APF, PTD, or PTF). It then returns a list of available aircraft.
- Parameters:
badaFamily (str.) – The BADA family (e.g., BADA3, BADA4) for which aircraft are being retrieved.
badaVersion (str.) – The specific version of the BADA family (e.g., 3.10, 4.2).
- Returns:
List of available aircraft names.
- Return type:
list of str.
- pyBADA.configuration.getAircraftPath()[source]
Get the path to the ‘aircraft’ resource directory.
This function locates the ‘aircraft’ directory within the pyBADA package and returns its absolute path.
- Returns:
The absolute path to the ‘aircraft’ resource directory.
- Return type:
str.
- pyBADA.configuration.getBadaFamilyPath(badaFamily)[source]
Get the full path to the specified BADA family directory.
- Parameters:
badaFamily (str.) – The BADA family (e.g., BADA3, BADA4) for which the path is required.
- Returns:
The path to the BADA family directory.
- Return type:
str.
- pyBADA.configuration.getBadaVersionPath(badaFamily, badaVersion)[source]
Get the full path to the specified BADA version directory.
- Parameters:
badaFamily (str.) – The BADA family (e.g., BADA3, BADA4) for which the path is required.
badaVersion (str.) – The specific version of the BADA family.
- Returns:
The path to the BADA version directory.
- Return type:
str.
- pyBADA.configuration.getDataPath()[source]
Get the path to the ‘data’ resource directory.
This function locates the ‘data’ directory within the pyBADA package and returns its absolute path.
- Returns:
The absolute path to the ‘data’ resource directory.
- Return type:
str.
- pyBADA.configuration.getVersionsList(badaFamily)[source]
Retrieve a list of available BADA versions for a given BADA family.
This function scans the directory corresponding to the specified BADA family and returns a list of all subdirectories (which represent different versions of BADA).
- Parameters:
badaFamily (str.) – The BADA family (e.g., BADA3, BADA4) for which versions are being retrieved.
- Returns:
List of available BADA versions.
- Return type:
list of str.
- pyBADA.configuration.list_subfolders(folderPath)[source]
Lists all subfolders within a specified directory.
- Parameters:
folderPath (str) – Path to the directory where subfolders are to be listed.
- Returns:
A list of subfolder names within the specified directory.
- Return type:
list of str
This function retrieves all entries in the given directory and filters out the ones that are not directories. Only the names of the subfolders are returned.
- pyBADA.configuration.safe_get(df, column_name, default_value=None)[source]
Safely retrieves a column’s value from a DataFrame, returning a default value if the column does not exist or if the value is NaN.
- Parameters:
df (pd.DataFrame) – DataFrame to retrieve the value from.
column_name (str) – Name of the column to retrieve.
default_value (any) – Value to return if the column does not exist. Default is None.
- Returns:
The value from the specified column or the default value if the column is missing.
- Return type:
any