tiledbsoma.io.upgrade_experiment_shapes

tiledbsoma.io.upgrade_experiment_shapes(uri: str, *, verbose: bool = False, check_only: bool = False, context: ~tiledbsoma.options._soma_tiledb_context.SOMATileDBContext | None = None, output_handle: ~_io.TextIOWrapper | ~_io.StringIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) bool

For each dataframe contained within the SOMA Experiment pointed to by the given URI, sets the domain to match the dataframe’s current non_empty_domain. For each N-D array, sets the shape to match the array’s current used_shape. If verbose is set to True, an activity log is printed. If check_only is true, only does a dry run and reports any reasons the upgrade would fail.

This makes an experiment created before TileDB-SOMA 1.15 look like an experiment created by TileDB-SOMA 1.15 or later. You can use tiledbsoma.io.show_experiment_shapes before and after to see the difference.

Parameters:
  • uri – The URI of a SOMA Experiment.

  • verbose – If True, produce per-array output as the upgrade runs.

  • check_only – If True, don’t apply the upgrades, but show what would be attempted, and show why each one would fail.

  • context – Optional SOMATileDBContext.

Example:

>>> tiledbsoma.io.upgrade_experiment_shapes('pbmc3k_unprocessed_old', check_only=True)
[DataFrame] obs
  URI file:///data/pbmc3k_unprocessed_old/obs
  Dry run for: tiledbsoma_upgrade_soma_joinid_shape(2700)
  OK
[DataFrame] ms/RNA/var
  URI file:///data/pbmc3k_unprocessed_old/ms/RNA/var
  Dry run for: tiledbsoma_upgrade_soma_joinid_shape(13714)
  OK
[SparseNDArray] ms/RNA/X/data
  URI file:///data/pbmc3k_unprocessed_old/ms/RNA/X/data
  Dry run for: tiledbsoma_upgrade_shape((2700, 13714))
  OK