Skip to content

[python] Add new SOMAContext class and deprecate SOMATileDBContext#4363

Merged
jp-dark merged 15 commits intomainfrom
dark/soma-context-clean-up
Feb 4, 2026
Merged

[python] Add new SOMAContext class and deprecate SOMATileDBContext#4363
jp-dark merged 15 commits intomainfrom
dark/soma-context-clean-up

Conversation

@jp-dark
Copy link
Copy Markdown
Collaborator

@jp-dark jp-dark commented Jan 7, 2026

Issue and/or context: Closes SOMA-789

Changes:

Create a new SOMAContext that is more closely aligned with the R and libtiledbsoma SOMAContext objects.

@jp-dark jp-dark force-pushed the dark/soma-context-clean-up branch 2 times, most recently from c9c81de to dce9aa0 Compare January 15, 2026 00:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 91.02564% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.88%. Comparing base (f4ab22f) to head (b19ab1d).
⚠️ Report is 51 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4363      +/-   ##
==========================================
+ Coverage   86.13%   88.88%   +2.74%     
==========================================
  Files         140       63      -77     
  Lines       21141     7304   -13837     
  Branches       17        0      -17     
==========================================
- Hits        18210     6492   -11718     
+ Misses       2931      812    -2119     
Flag Coverage Δ
python 88.88% <91.02%> (-0.16%) ⬇️
r ?

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

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

@jp-dark jp-dark force-pushed the dark/soma-context-clean-up branch from dce9aa0 to e804607 Compare January 15, 2026 15:30
@jp-dark jp-dark marked this pull request as ready for review January 15, 2026 15:40
Copy link
Copy Markdown
Member

@aaronwolen aaronwolen left a comment

Choose a reason for hiding this comment

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

I performed a fairly shallow review and found a couple minor issues that I thought I'd report now. As requested, I'll review the new api more thoroughly next.

Comment thread apis/python/HISTORY.md Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
Comment thread apis/python/src/tiledbsoma/_collection.py
Comment thread apis/python/src/tiledbsoma/io/ingest.py Outdated
@jp-dark jp-dark force-pushed the dark/soma-context-clean-up branch from 2a17083 to 5302c2a Compare January 26, 2026 17:13
Copy link
Copy Markdown
Member

@aaronwolen aaronwolen left a comment

Choose a reason for hiding this comment

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

Looks great.

I suggested a fix for one minor formatting issues and had an implementation question, otherwise it's good to go.

Comment thread apis/python/src/tiledbsoma/_soma_context.py Outdated
self._lock = threading.Lock()
"""A lock to ensure single initialization of ``_tiledb_ctx``."""

self.threadpool = threadpool or ThreadPoolExecutor()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would this allow users to modify the threadpool of a context object?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because it's public? Technically, yes, but I doubt anyone would do that. I copied this from the SOMATileDBContext, and I assume the thinking is to make using the threadpool public.

@jp-dark jp-dark merged commit 4cd8c10 into main Feb 4, 2026
15 checks passed
@jp-dark jp-dark deleted the dark/soma-context-clean-up branch February 4, 2026 17:42
XanthosXanthopoulos added a commit that referenced this pull request May 4, 2026
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