single-cell-data / TileDB-SOMA

Python and R SOMA APIs using TileDB’s cloud-native format. Ideal for single-cell data at any scale.
MIT License
79 stars 21 forks source link

[python] Release GIL where necessary in pybind11 code #2733

Open nguyenv opened 3 weeks ago

nguyenv commented 3 weeks ago

Issue and/or context:

This issue was internally reported by @bkmartinjr:

I am using the latest Python SOMA, and seeing some really weird serialization of my API requests that "feel" like the GIL is not being released for some I/O operations.

For example: soma.DataFrame.count. If I'm reading the code right, it calls the underlying nnz method without releasing it.

Changes:

Just as we do for clib.SOMAArray.nnz, we need to release the GIL for clib.SOMADataFrame.count.

Converting to draft for now as there are additional areas that need the GIL released.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.91%. Comparing base (eab6557) to head (b9b8676).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2733 +/- ## ======================================= Coverage 89.91% 89.91% ======================================= Files 37 37 Lines 4026 4026 ======================================= Hits 3620 3620 Misses 406 406 ``` | [Flag](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2733/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | Coverage Δ | | |---|---|---| | [python](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | `89.91% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2733/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | Coverage Δ | | |---|---|---| | [python_api](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2733/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | `89.91% <ø> (ø)` | | | [libtiledbsoma](https://app.codecov.io/gh/single-cell-data/TileDB-SOMA/pull/2733/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=single-cell-data) | `∅ <ø> (∅)` | |
nguyenv commented 3 weeks ago

[sc-49550]