emmi.preprocessing.process_drivaer_and_ahmed_volumetric

Converts raw DrivAerML or AhmedML dataset into subsampled pytorch files

Attributes

Classes

Functions

parse_args()

assert_same_length(*arrays)

Checks that all arrays have the same length.

time_block(run_folder, label)

A context manager to measure execution time of a code block.

merge_vtu_parts(folder)

Merge .part VTU fragments into a full .vtu file in the specified folder.

process_run(run_folder, src, dst, data_field_keymap, ...)

main(dataset, src, dst, subsample_factor, ...)

Module Contents

class emmi.preprocessing.process_drivaer_and_ahmed_volumetric.DataFieldKeyMap
stl_prefix: str
vtp_pressure: str
vtp_wallshearstress: str
vtu_pressure: str
vtu_velocity: str
vtu_totalp: str
vtu_vorticity: str | None
emmi.preprocessing.process_drivaer_and_ahmed_volumetric.dataset_keymaps
emmi.preprocessing.process_drivaer_and_ahmed_volumetric.parse_args()
emmi.preprocessing.process_drivaer_and_ahmed_volumetric.assert_same_length(*arrays)

Checks that all arrays have the same length.

Parameters:

*arrays (numpy.ndarray | torch.Tensor) – any number of arrays.

Return type:

None

emmi.preprocessing.process_drivaer_and_ahmed_volumetric.time_block(run_folder, label)

A context manager to measure execution time of a code block.

Parameters:
  • run_folder – The name of the run folder. Will be printed.

  • label (str) – The name of the process/algorithm/code executed within the with block. Will be printed.

Usage:
with time_block(“some task”):

# code

emmi.preprocessing.process_drivaer_and_ahmed_volumetric.merge_vtu_parts(folder)

Merge .part VTU fragments into a full .vtu file in the specified folder.

This function is required for DrivAerML on Huggingface, where the volume data is split into two .part files. See files in https://huggingface.co/datasets/neashton/drivaerml/tree/main/run_1.

Parameters:

folder (str | Path) – Path to the run_i directory containing .part files.

Raises:

NotADirectoryError – If the provided folder path is not a directory.

emmi.preprocessing.process_drivaer_and_ahmed_volumetric.process_run(run_folder, src, dst, data_field_keymap, subsample_factor, compute_surface_distance_via_trimesh)
Parameters:
Return type:

None

emmi.preprocessing.process_drivaer_and_ahmed_volumetric.main(dataset, src, dst, subsample_factor, compute_surface_distance_via_trimesh, num_workers)
Parameters:
  • dataset (str)

  • src (str)

  • dst (str)

  • subsample_factor (int)

  • compute_surface_distance_via_trimesh (bool)

  • num_workers (int)

Return type:

None