Skip to content

Commit

Permalink
Fix from_visium to use Scene class and _factory to read Scene
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-dark committed Apr 25, 2024
1 parent 36d9c1e commit dda6862
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions apis/python/src/tiledbsoma/_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
_dense_nd_array,
_experiment,
_measurement,
_scene,
_sparse_nd_array,
_tdb_handles,
_tiledb_object,
Expand Down Expand Up @@ -219,12 +220,13 @@ def _type_name_to_cls(type_name: str) -> Type[AnyTileDBObject]:
_experiment.Experiment,
_measurement.Measurement,
_sparse_nd_array.SparseNDArray,
_scene.Scene,
)
}
try:
return type_map[type_name.lower()]
except KeyError as ke:
options = sorted(type_map)
_options = sorted(type_map)
raise SOMAError(
f"{type_name!r} is not a recognized SOMA type; expected one of {options}"
f"{type_name!r} is not a recognized SOMA type; expected one of {_options}"
) from ke
4 changes: 1 addition & 3 deletions apis/python/src/tiledbsoma/experimental/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ def from_visium(
experiment, "spatial", spatial, use_relative_uri=use_relative_uri
)
scene_uri = f"{spatial_uri}/{scene_name}"
with _create_or_open_collection(
Collection[Collection[AnyTileDBObject]], scene_uri, **ingest_ctx
) as scene:
with _create_or_open_collection(Scene, scene_uri, **ingest_ctx) as scene:

Check warning on line 156 in apis/python/src/tiledbsoma/experimental/ingest.py

View check run for this annotation

Codecov / codecov/patch

apis/python/src/tiledbsoma/experimental/ingest.py#L156

Added line #L156 was not covered by tests
_maybe_set(
spatial, scene_name, scene, use_relative_uri=use_relative_uri
)
Expand Down

0 comments on commit dda6862

Please sign in to comment.