utils package

Submodules

utils.Metadata module

class utils.Metadata.Metadata[source]

Bases: object

add_nested_field(parent_key, key, value)[source]
add_repeating_block(block_name, block_data)[source]
generate_next_model_name(base_name, csv_filename='metadata.csv')[source]
save_to_csv(filename='metadata.csv')[source]
set_field(key, value)[source]

utils.aerodynamics module

utils.aerodynamics.lift_drag_coeff(alpha, normals, Sref=80, CoefPressure=None, CoefSkinFriction=None)[source]

Calculate lift and drag coefficients from pressure and skin friction coefficients.

Parameters:
  • alpha (float) – Angle of attack in degrees.

  • normals (np.ndarray) – Array of shape (n,3) with the normal vectors of the surface.

  • Sref (float, optional) – Reference area to calculate the lift and drag coefficients (default: 80).

  • CoefPressure (np.ndarray, optional) – Array of shape (n,1) with the pressure coefficients of the surface. If None, the pressure contribution is ignored (default: None).

  • CoefSkinFriction (np.ndarray, optional) – Array of shape (n,3) with the skin friction coefficients of the surface. If None, the skin friction contribution is ignored (default: None).

Returns:

Lift and drag coefficients.

Return type:

Tuple[float, float]

utils.lift-drag module

utils.nastran_reader module

utils.path_manager module

class utils.path_manager.PathManager(dataset_dir=None, case_dir=None)[source]

Bases: object

Class to manage paths that will be used by the pipeline. It is used to create directories and check if they exist.

Parameters:
  • dataset_dir (str)

  • case_dir (str)

static create_directory(path)[source]
Parameters:

path (Path)

utils.setseed module

utils.setseed.set_seed(seed=42, deterministic=True)[source]
Parameters:
  • seed (int)

  • deterministic (bool)

utils.splitting module

utils.zone_metrics module

utils.zone_metrics.zone_metrics_calculation(model, dataset, evaluators=[], savedir=None)[source]

Evaluate the model on a dataset using a custom analysis.

Parameters:
  • dataset (BaseDataset) – The dataset to evaluate the model on.

  • evaluators (List, optional) – The evaluators to use for evaluating the model. Default is [].

  • model (Model)

  • savedir (str)

Returns:

The metrics evaluated on the dataset.

Return type:

metrics (Dict[str, float])

utils.zone_metrics.zone_metrics_plotter(metrics_flight, metrics_coord, savedir=None)[source]
Parameters:
  • metrics_flight (List[Dict])

  • metrics_coord (List[Dict])

  • savedir (str)

Module contents