Skip to content

[c++/python/r] Pushdown SOMA object management to C++#4436

Open
XanthosXanthopoulos wants to merge 33 commits intomainfrom
xan/pushdown_object_management
Open

[c++/python/r] Pushdown SOMA object management to C++#4436
XanthosXanthopoulos wants to merge 33 commits intomainfrom
xan/pushdown_object_management

Conversation

@XanthosXanthopoulos
Copy link
Copy Markdown
Collaborator

@XanthosXanthopoulos XanthosXanthopoulos commented Mar 17, 2026

Issue and/or context: Push SOMA object lifetime management to C++

Changes:
This PR introduces the following changes:

  • SOMACollection caches handles to its member when first accessed. These handles are now used to construct the Python and R wrapper objects to avoid reopening or implementing the caching in the API side.
  • Metadata handling is now utilizing a variant to hold the decoded TileDB metadata. This change removes the constraint to hold an open reference a TileDB array/group in order to read the metadata.
  • Metadata caching is now part of the common C++ implementation for SOMAGroup and SOMAArray. Both Python and R APIs can now access the metadata in the same way and their metadata caches are now removed.
  • The close method now accepts an optional argument to define whether members of a group should be closed once a group is closed.
  • Reopening a SOMAObject now does not recreate the C++ handle but rather it reinitialized the same handle (but can and will make member objects invalid)

Notes for Reviewer:
The R devel error is not related to these changes.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 69.43574% with 195 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.90%. Comparing base (1ba587f) to head (0abb3c9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4436      +/-   ##
==========================================
- Coverage   85.27%   84.90%   -0.37%     
==========================================
  Files         136      136              
  Lines       21263    21344      +81     
==========================================
- Hits        18132    18123       -9     
- Misses       3131     3221      +90     
Flag Coverage Δ
python 88.19% <96.55%> (-0.25%) ⬇️
r 83.13% <65.15%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 88.19% <96.55%> (-0.25%) ⬇️
libtiledbsoma ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@XanthosXanthopoulos XanthosXanthopoulos changed the title [WIP][c++/python/r] Pushdown SOMA object management to C++ [c++/python/r] Pushdown SOMA object management to C++ Apr 16, 2026
@XanthosXanthopoulos XanthosXanthopoulos marked this pull request as ready for review April 16, 2026 15:56
@jp-dark
Copy link
Copy Markdown
Collaborator

jp-dark commented Apr 17, 2026

The CI should be fixed by a rebase or merge on main.

Copy link
Copy Markdown
Collaborator

@jp-dark jp-dark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't finished reviewing this yet, but so far it is looking good. I have a couple small comments. As discussed offline, I'd also like to see some unit tests directly on the new metadata class.

Comment thread libtiledbsoma/src/common/metadata/metadata.h
Comment thread libtiledbsoma/src/common/metadata/utils.h
Comment thread libtiledbsoma/src/common/metadata/metadata.cc Outdated
Comment thread libtiledbsoma/src/soma/soma_collection_base.h Outdated
Comment thread libtiledbsoma/src/soma/soma_collection_base.h
Comment thread libtiledbsoma/src/soma/soma_collection_base.h
Comment thread libtiledbsoma/src/common/metadata/utils.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants