treble_tsdk.collections.postprocessing_collection

Functions

cancel_ir_collection_processing(ir_collection)

Cancel remote IR processing for the collection.

get_ir_collection_processing_cost(ir_collection)

Quote the cost of remotely processing the collection's pending IRs.

get_rendering_cost_for_ambisonics_order(...)

print_ir_collection_processing_cost(cost)

set_filters_for_irs(ir_collection, filters)

Set filters for a set of IRs within the IR collection and update it in place.

start_ir_collection_processing(ir_collection)

Ship the collection's pending IRs to the remote processor and update the collection in place.

Classes

IRCollectionProcessingCost

Cost quote for remotely processing an IR collection.

class treble_tsdk.collections.postprocessing_collection.IRCollectionProcessingCost

Cost quote for remotely processing an IR collection.

Variables:
  • cost – Total token cost of the work that will actually be shipped.

  • ir_count – Number of IRs that will be processed (reused/already processed IRs are excluded).

  • device_render_count – Number of device renders that will be performed.

  • batch_count – Number of batches (worker nodes) the work is split into.

__init__(cost: Decimal, ir_count: int, device_render_count: int, batch_count: int) None
batch_count: int
cost: Decimal
device_render_count: int
ir_count: int
treble_tsdk.collections.postprocessing_collection.cancel_ir_collection_processing(ir_collection: IRCollection)

Cancel remote IR processing for the collection.

Compiles the set of remote processing task ids tied to the collection and asks the server to cancel them; any task that has not already completed is marked as cancelled (completed tasks are left untouched server-side).

Task ids are read from the ir_processing_info column when present. When that column is unavailable (or carries no task ids), the collection’s content hash is used to look up the task group and cancel its tasks instead.

treble_tsdk.collections.postprocessing_collection.get_ir_collection_processing_cost(ir_collection: IRCollection, optimize_mono_download: bool = False) IRCollectionProcessingCost

Quote the cost of remotely processing the collection’s pending IRs.

Each batch (worker node) carries a flat _BATCH_BASE_COST plus the cost of every device render it performs. Rows that are already processed or reused from an existing task group are excluded, so the quote reflects only the work that start_remote_processing would actually ship.

Parameters:

optimize_mono_download (bool) – Must match the flag passed to start_remote_processing so the quote covers the same work. When True the no-work (mono) group’s batches are shipped too, and the base cost is summed across both groups’ batches.

treble_tsdk.collections.postprocessing_collection.get_rendering_cost_for_ambisonics_order(render_ambisonics_order: int) Decimal
treble_tsdk.collections.postprocessing_collection.print_ir_collection_processing_cost(cost: IRCollectionProcessingCost)
treble_tsdk.collections.postprocessing_collection.set_filters_for_irs(ir_collection: IRCollection, filters: list[FilterDefinition] | list[list[FilterDefinition]] | dict[str, list[FilterDefinition] | list[list[FilterDefinition]]], ir_subset: pl.DataFrame | None = None)

Set filters for a set of IRs within the IR collection and update it in place.

A single filter chain assigns that chain to each affected base IR (rewriting it in place), while a list of chains fans the base IR out into one new row per chain. The base IR is always consumed; for a fan-out of N chains each affected row is replaced by N filtered variants.

Parameters:
  • ir_collection (IRCollection) – The IR collection to set the filters for.

  • filters

    The filters to apply.

    • list[FilterDefinition] – broadcast a single chain to every affected base IR.

    • list[list[FilterDefinition]] – broadcast a fan-out: every affected base IR is expanded into one variant per chain.

    • dict[str, list[FilterDefinition] | list[list[FilterDefinition]]] – per-id mapping keyed by IRInfo.id; each value may itself be a single chain or a fan-out. ir_subset must be None.

  • ir_subset (pl.DataFrame | None) – A subset of the IR collection to set the filters for. Only valid in broadcast mode. Defaults to None, which means all IRs.

treble_tsdk.collections.postprocessing_collection.start_ir_collection_processing(ir_collection: IRCollection, optimize_mono_download: bool = False)

Ship the collection’s pending IRs to the remote processor and update the collection in place. The collection will have a new column “ir_processing_info” that records, per row, which remote task will process it.

If a task group with the same content hash already exists, the IRs it has already processed are reused (mapped to their existing task ids) and only the remaining IRs are shipped.

Parameters:

optimize_mono_download (bool) – When True the collection is split along the processing predicate into a processable group and a no-work (mono) group, each hashed and shipped independently so the mono IRs are materialized cloud-side and reusable across collections on their own. Defaults to False (a single group over the whole collection, only the processable rows shipped).