Skip to content

Commit

Permalink
Update classes to match the new tatami interface, improve caching. (#10)
Browse files Browse the repository at this point in the history
The Extractor interface updates allow users to directly pass an oracle during
construction, which eliminates the messy work required to choose between the
with- and without-oracle behavior after construction. We also use the new
SparsifiedWrapper classes for efficiently dense output from a sparse matrix.

We improve chunk caching by accepting arbitrary chunkGrids rather than being
limited to regular chunk intervals. We simplify cache management by not
considering R-allocated memory in the cache size limit, which allows us to copy
over the data into our own slab cache managers from tatami_chunked. This
allows us to actually use the LRU and oracular caches to their full extent.

We also remove the COO matrix parser, on the understanding that this is superceded
by the SVT matrices in the latest versions of DelayedArray. (Nonetheless, we add
an R-side fallback to convert COO to SVT just in case.)

Finally, we greatly enhanced the scale of the tests to cover the new code.
  • Loading branch information
LTLA committed May 9, 2024
1 parent 024eebe commit 4199455
Show file tree
Hide file tree
Showing 33 changed files with 2,838 additions and 1,723 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/check-install.yaml
Expand Up @@ -23,6 +23,13 @@ jobs:
cmake -S . -B build -DTATAMI_TESTS=OFF
sudo cmake --install build
- name: Install tatami-chunked
run: |
git clone https://github.com/tatami-inc/tatami_chunked dep-tatami_chunked --depth=1
cd dep-tatami_chunked
cmake -S . -B build -DTATAMI_CHUNKED_TESTS=OFF
sudo cmake --install build
- name: Install manticore
run: |
git clone https://github.com/tatami-inc/manticore dep-manticore --depth=1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
name: Run tests
runs-on: ubuntu-latest
container: bioconductor/bioconductor_docker:devel
container: bioconductor/bioconductor_docker:RELEASE_3_19
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -18,7 +18,7 @@ else()
find_package(tatami_manticore CONFIG REQUIRED)
endif()

target_link_libraries(tatami_r INTERFACE tatami::tatami tatami::manticore)
target_link_libraries(tatami_r INTERFACE tatami::tatami tatami::tatami_chunked tatami::manticore)

# Switch between include directories depending on whether the downstream is
# using the build directly or is using the installed package.
Expand Down
1 change: 1 addition & 0 deletions cmake/Config.cmake.in
Expand Up @@ -2,6 +2,7 @@

include(CMakeFindDependencyMacro)
find_dependency(tatami_tatami CONFIG REQUIRED)
find_dependency(tatami_tatami_chunked CONFIG REQUIRED)
find_dependency(tatami_manticore CONFIG REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/tatami_tatami_rTargets.cmake")
8 changes: 7 additions & 1 deletion extern/CMakeLists.txt
Expand Up @@ -6,7 +6,11 @@ FetchContent_Declare(
GIT_TAG master
)

FetchContent_MakeAvailable(tatami)
FetchContent_Declare(
tatami_chunked
GIT_REPOSITORY https://github.com/tatami-inc/tatami_chunked
GIT_TAG master
)

FetchContent_Declare(
manticore
Expand All @@ -15,3 +19,5 @@ FetchContent_Declare(
)

FetchContent_MakeAvailable(manticore)
FetchContent_MakeAvailable(tatami)
FetchContent_MakeAvailable(tatami_chunked)
205 changes: 0 additions & 205 deletions include/tatami_r/COO_SparseMatrix.hpp

This file was deleted.

82 changes: 0 additions & 82 deletions include/tatami_r/SVT_SparseMatrix.hpp

This file was deleted.

42 changes: 0 additions & 42 deletions include/tatami_r/SimpleMatrix.hpp

This file was deleted.

0 comments on commit 4199455

Please sign in to comment.