Skip to content

Commit

Permalink
Store SOMA encoding version number as array/group metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Jun 21, 2022
1 parent c9bb1f7 commit 019aeb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apis/python/src/tiledbsc/tiledb_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def _set_soma_object_type_metadata(self) -> None:
A.meta[
tiledbsc.util.SOMA_OBJECT_TYPE_METADATA_KEY
] = self.__class__.__name__
A.meta[
tiledbsc.util.SOMA_ENCODING_VERSION_METADATA_KEY
] tiledbsc.util.SOMA_ENCODING_VERSION

def show_metadata(self, recursively=True, indent=""):
"""
Expand Down
3 changes: 3 additions & 0 deletions apis/python/src/tiledbsc/tiledb_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def _set_soma_object_type_metadata(self):
G.meta[
tiledbsc.util.SOMA_OBJECT_TYPE_METADATA_KEY
] = self.__class__.__name__
G.meta[
tiledbsc.util.SOMA_ENCODING_VERSION_METADATA_KEY
] = SOMA_ENCODING_VERSION

def _set_soma_object_type_metadata_recursively(self):
"""
Expand Down
2 changes: 2 additions & 0 deletions apis/python/src/tiledbsc/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# that start at the SOMACollection level) confidently navigate with a minimum of introspection on
# group contents.
SOMA_OBJECT_TYPE_METADATA_KEY = "soma_object_type"
SOMA_ENCODING_VERSION_METADATA_KEY = "soma_encoding_version"
SOMA_ENCODING_VERSION = "1"

# ----------------------------------------------------------------
def is_soma(uri: str, ctx: Optional[tiledb.Ctx] = None) -> bool:
Expand Down

0 comments on commit 019aeb4

Please sign in to comment.