nos.data package

Submodules

nos.data.transmission_loss module

class nos.data.transmission_loss.TLDataset(path: Path, n_samples: int = -1, v_transform: Literal['quantile', 'min_max', 'normalize'] = 'quantile')

Bases: OperatorDataset

class nos.data.transmission_loss.TLDatasetCompact(path: Path, n_samples: int = -1, v_transform: Literal['quantile', 'min_max', 'normalize'] = 'quantile')

Bases: OperatorDataset

Transmission loss dataset, with bigger evaluation space.

nos.data.transmission_loss.get_min_max_transform(src: Tensor) Transform
nos.data.transmission_loss.get_n_unique(df: DataFrame, n_samples: int = -1)
nos.data.transmission_loss.get_normalize_transform(src: Tensor) Transform
nos.data.transmission_loss.get_tl_compact(path: Path, n_samples: int = -1)
nos.data.transmission_loss.get_tl_frame(path: Path, n_samples: int = -1)
nos.data.transmission_loss.get_tl_from_path(path: Path)
nos.data.transmission_loss.get_unique_crystals(df: DataFrame) DataFrame

nos.data.xdmf_to_torch module

nos.data.xdmf_to_torch.get_array(data_dir: Path, element: Element) tensor

Gets the first DataItem from a given element.

Parameters:
  • data_dir – directory in which both the xdmf and h5 files are located

  • element – parent

Returns:

array of all elements stored in the first DataItem for the given element.

nos.data.xdmf_to_torch.xdmf_to_torch(file: Path) dict

Converts a xdmf file to a dictionary with all values stored within it.

Parameters:

file – path to the xdmf file (h5 file needs to be located in the same dir).

Returns:

Dictionary containing topology, geometry, frequencies, and complex values.

Module contents

class nos.data.TLDataset(path: Path, n_samples: int = -1, v_transform: Literal['quantile', 'min_max', 'normalize'] = 'quantile')

Bases: OperatorDataset

class nos.data.TLDatasetCompact(path: Path, n_samples: int = -1, v_transform: Literal['quantile', 'min_max', 'normalize'] = 'quantile')

Bases: OperatorDataset

Transmission loss dataset, with bigger evaluation space.