diff --git a/apis/python/src/tiledbsoma/io/ingest.py b/apis/python/src/tiledbsoma/io/ingest.py index 230e3424e8..25a426ceed 100644 --- a/apis/python/src/tiledbsoma/io/ingest.py +++ b/apis/python/src/tiledbsoma/io/ingest.py @@ -2030,6 +2030,36 @@ def _chunk_is_contained_in_axis( return True +def update_uns( + exp: Experiment, + new_data: Mapping[str, object], + measurement_name: str, + *, + context: Optional[SOMATileDBContext] = None, + platform_config: Optional[PlatformConfig] = None, +) -> None: + """ + TODO: WRITE ME + """ + if exp.closed or exp.mode != "w": + raise SOMAError(f"Experiment must be open for write: {exp.uri}") + if measurement_name not in exp.ms: + raise SOMAError( + f"Experiment {exp.uri} has no measurement named {measurement_name}" + ) + m = exp.ms[measurement_name] + + _ingest_uns_dict( + m, + "uns", + new_data, + platform_config=platform_config, + context=context, + ingestion_params=IngestionParams("update", label_mapping=None), + use_relative_uri=None, + ) + + def _maybe_ingest_uns( m: Measurement, uns: Mapping[str, object],