Skip to content

Commit

Permalink
[python] update_uns feature
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Oct 9, 2023
1 parent 9d4c0a0 commit cebd565
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apis/python/src/tiledbsoma/io/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit cebd565

Please sign in to comment.