ursa.get¶
Phase 1a (M2) — raw path only¶
For each modality with ingestion_status="raw", list the segment
files under ModalityRow.raw_storage_uri (a prefix), fetch each
segment’s bytes, and surface them on the returned Data as a
- class:
ursa.RawBytescarrier underdata.modalities[name]. No parsing, no time domain.data.metadatais the synthesized- class:
RecordingRow(ENG-1090 contract).
All raw formats — including RAW_VIDEO / RAW_AUDIO — materialize
in full. Multi-hour video recordings can easily exceed several GB;
memory-constrained callers should use :func:ursa.download instead.
Phase 1b / M3 — processed path¶
Deferred to ENG-1093. Once a modality has ingestion_status="processed",
the modality field becomes an array-bearing :class:RegularTimeSeries /
- class:
IrregularTimeSeriessubclass.get()currently raises- class:
NotImplementedErrorfor processed inputs as a defensive guard; the runtime path arrives with ENG-1093.
Concat¶
concat=True over multiple recordings would require aligned time
domains, which only the processed path establishes — so the M2 stub
validates alignment (raises :class:ValueError on mismatched modality
sets) and then raises :class:NotImplementedError pointing at
ENG-1093. The single-input case ignores concat (ticket spec:
“single-input ergonomic case … regardless of concat”).
Materialize :class:QueryResult rows into in-memory :class:ursa.Data
objects (ENG-890).
Second verb in the M2 three-verb read API (query → get →
download): query() selects, get() reads bytes into memory,
and download() (ENG-1091) writes them to disk. All filtering lives
in query() — get() accepts a :class:QueryResult (or iterable
of them) plus a single concat flag and nothing else.
Module Contents¶
Functions¶
Materialize |
|
Build a single :class: |
|
Project |
|
Read all segment files under |
|
Raise |
Data¶
API¶
- ursa.get.__all__¶
[‘get’]
- ursa.get._PROCESSED_PATH_TICKET¶
‘ENG-1093’
- ursa.get._RECORDING_ROW_FIELDS: tuple[str, ...]¶
(‘recording_hash’, ‘participant_ids’, ‘start_time’, ‘duration’, ‘device_info’, ‘metadata’)
- ursa.get.get(target: ursa.query.QueryResult | collections.abc.Iterable[ursa.query.QueryResult], *, concat: bool = False) ursa.temporal.Data | list[ursa.temporal.Data][source]¶
Materialize
targetinto in-memory :class:ursa.Dataobjects.Parameters
target A single :class:
QueryResultor any iterable of them. The single-input form returns a single :class:Data; the iterable form returns alist[Data](including a one-element list when the iterable has one item — disambiguation is by type, not by length). concat WhenTrueandtargetis an iterable, concatenate the per-recording outputs along the time axis. M2 only — alignment is validated andNotImplementedErroris raised because raw modalities carry no time domain. Whentargetis a single :class:QueryResult,concatis ignored.Returns
Data or list[Data] Each returned :class:
Datahas itsmetadataslot populated with a :class:RecordingRowsynthesized from the source :class:QueryResult. Modality payloads are accessible asdata.modalities[name]and are :class:ursa.RawBytescarriers in M2.Raises
NotImplementedError If any matched modality has
ingestion_status="processed"(deferred to ENG-1093) or ifconcat=Trueis requested over an aligned iterable. ValueError Ifconcat=Trueis requested over recordings with mismatched modality sets.Notes
All raw formats — including
RAW_VIDEO/RAW_AUDIO— are materialized in full into memory. A multi-hour video recording can easily exceed several GB; callers running on memory-constrained hosts should use :func:ursa.downloadinstead.
- ursa.get._get_one(qr: ursa.query.QueryResult) ursa.temporal.Data[source]¶
Build a single :class:
Datafrom one :class:QueryResult.
- ursa.get._recording_row_from(qr: ursa.query.QueryResult) ursa.catalog.schemas.RecordingRow[source]¶
Project
qronto :class:RecordingRow’s field set.Uses an explicit field tuple so a future :class:
QueryResultschema change breaks here at validation time, not silently inside Pydantic.
- ursa.get._materialize_modality(name: str, mrow: ursa.catalog.schemas.ModalityRow) ursa.raw.RawBytes[source]¶
Read all segment files under
mrow.raw_storage_uriinto a :class:RawBytes.
- ursa.get._validate_alignment(results: list[ursa.temporal.Data]) None[source]¶
Raise
ValueErrorif recordings have mismatched modality sets.