treble_tsdk.collections.ir_info

Functions

compute_ir_unique_id(source_id, receiver_id)

Compute the canonical unique id for an IR.

Classes

DeviceRenderParams

Parameters describing how to render an IR through a device.

IRInfo

IRInfo(source: 'Source', receiver: 'Receiver', simulation: 'Simulation', device: 'DeviceObj | None' = None, device_orientation: 'Rotation | None' = None, processing: 'ProcessingRecipe | None' = None, ir_processing_info: 'IRProcessingInfo | None' = None, dataframe_row: 'dict | None' = None)

IRProcessingInfo

IRProcessingInfo(ir_id: 'str', task_id: 'str')

ProcessingRecipe

ProcessingRecipe(filters: 'list[FilterDefinition]' = None, filter_structs: 'list[dict]' = None)

class treble_tsdk.collections.ir_info.DeviceRenderParams

Parameters describing how to render an IR through a device.

Parameters:
  • device (DeviceObj) – The device to render the IR through.

  • device_orientation (Rotation) – The orientation of the device.

__init__(device: DeviceObj, device_orientation: Rotation) None
device: DeviceObj
device_orientation: Rotation
class treble_tsdk.collections.ir_info.IRInfo

IRInfo(source: ‘Source’, receiver: ‘Receiver’, simulation: ‘Simulation’, device: ‘DeviceObj | None’ = None, device_orientation: ‘Rotation | None’ = None, processing: ‘ProcessingRecipe | None’ = None, ir_processing_info: ‘IRProcessingInfo | None’ = None, dataframe_row: ‘dict | None’ = None)

__init__(source: Source, receiver: Receiver, simulation: Simulation, device: DeviceObj | None = None, device_orientation: Rotation | None = None, processing: ProcessingRecipe | None = None, ir_processing_info: IRProcessingInfo | None = None, dataframe_row: dict | None = None) None
get_device_ir(data_loader: IRDataLoader | None = None, apply_filters: bool = True, include_spatial_ir: bool = False) DeviceIR

Get DeviceIR object from IRInfo. If apply_filters is True, the filters are applied to the resulting IR. :param data_loader: Optional but recommended. IRDataLoader object to use for loading the IR data to/from cache. If None, a new lazy IRDataLoader will be created which will load data to a temporary directory. :param apply_filters: If True, the filters are applied to the resulting IR. Defaults to True. :param include_spatial_ir: If set and IR has been processed remotely the spatial IR part can be skipped. If IR needs to be rendered on-the-fly the SpatialIR is always included.

get_mono_ir(data_loader: IRDataLoader | None = None, apply_filters: bool = True) MonoIR

Get MonoIR object from IRInfo. If apply_filters is True, the filters are applied to the resulting IR. :param data_loader: Optional but recommended. IRDataLoader object to use for loading the IR data to/from cache. If None, a new lazy IRDataLoader will be created which will load data to a temporary directory. :param apply_filters: If True, the filters are applied to the resulting IR. Defaults to True.

get_moving_ir(data_loader: IRDataLoader | None = None) MovingIR

Get MovingIR object from IRInfo. :param data_loader: Optional but recommended. IRDataLoader object to use for loading the IR data to/from cache. If None, a new lazy IRDataLoader will be created which will load data to a temporary directory.

get_spatial_ir(data_loader: IRDataLoader | None = None, apply_filters: bool = True) SpatialIR

Get SpatialIR object from IRInfo. If apply_filters is True, the filters are applied to the resulting IR. :param data_loader: Optional but recommended. IRDataLoader object to use for loading the IR data to/from cache. If None, a new lazy IRDataLoader will be created which will load data to a temporary directory. :param apply_filters: If True, the filters are applied to the resulting IR. Defaults to True.

dataframe_row: dict | None = None
device: DeviceObj | None = None
device_orientation: Rotation | None = None
property id: str
ir_processing_info: IRProcessingInfo | None = None
property ir_type: IRType

Get the IRType of the IR.

processing: ProcessingRecipe | None = None
receiver: Receiver
simulation: Simulation
source: Source
class treble_tsdk.collections.ir_info.IRProcessingInfo

IRProcessingInfo(ir_id: ‘str’, task_id: ‘str’)

__init__(ir_id: str, task_id: str) None
static dtype() polars.Struct
classmethod from_struct(s: dict[str, str | None]) IRProcessingInfo
static pl_empty() polars.Expr

Return a pl.Expr that represents an empty IRProcessingInfo.

to_struct() dict[str, str | None]
ir_id: str
task_id: str
class treble_tsdk.collections.ir_info.ProcessingRecipe

ProcessingRecipe(filters: ‘list[FilterDefinition]’ = None, filter_structs: ‘list[dict]’ = None)

__init__(filters: list[FilterDefinition] | None = None, filter_structs: list[dict] | None = None) None
get_filters() list[FilterDefinition] | None

Return the live filter definitions, reconstructing them from filter_structs if they haven’t been populated yet. Returns None when no filters are specified.

filters is only set when filters are prescribed in-memory; a recipe rebuilt from a dataframe only carries filter_structs. This back-fills filters from those structs so both stay in sync.

filter_structs: list[dict] = None
filters: list[FilterDefinition] = None
treble_tsdk.collections.ir_info.compute_ir_unique_id(source_id: str, receiver_id: str, device_id: str | None = None, device_orientation: Rotation | list[float] | None = None, filter_structs: list[dict] | None = None) str

Compute the canonical unique id for an IR.

Single source of truth for hashing an IR’s identifying fields into a stable string id.

Parameters:
  • source_id (str) – The id of the source.

  • receiver_id (str) – The id of the receiver.

  • device_id (str | None) – The id of the device, if any.

  • device_orientation (Rotation | list[float] | None) – The device orientation. Lists are converted to Rotation so the id is stable regardless of the input shape.

  • filter_structs (list[dict] | None) – The processing filter chain, if any.

Return str:

The hex MD5 digest used as the IR’s stable id.