From 204f0c8208d9160cd9d901cc771e5c6fe0b39486 Mon Sep 17 00:00:00 2001 From: Julia Dark <24235303+jp-dark@users.noreply.github.com> Date: Fri, 10 May 2024 09:55:38 -0400 Subject: [PATCH 1/6] Fix write from array that is not row or column order (#2542) When writing to a dense array, if the input numpy array is neither row or column order, cast the array to row order. --- apis/python/src/tiledbsoma/_dense_nd_array.py | 14 +++++--- apis/python/tests/test_regression.py | 35 +++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 apis/python/tests/test_regression.py diff --git a/apis/python/src/tiledbsoma/_dense_nd_array.py b/apis/python/src/tiledbsoma/_dense_nd_array.py index cb1a25d8aa..a29ac3c14d 100644 --- a/apis/python/src/tiledbsoma/_dense_nd_array.py +++ b/apis/python/src/tiledbsoma/_dense_nd_array.py @@ -265,6 +265,7 @@ def write( clib_dense_array = self._handle._handle + # Compute the coordinates for the dense array. new_coords: List[Union[int, Slice[int], None]] = [] for c in coords: if isinstance(c, slice) and isinstance(c.stop, int): @@ -272,14 +273,17 @@ def write( else: new_coords.append(c) + # Convert data to a numpy array. dtype = self.schema.field("soma_data").type.to_pandas_dtype() input = np.array(values, dtype=dtype) - order = ( - clib.ResultOrder.colmajor - if input.flags.f_contiguous - else clib.ResultOrder.rowmajor - ) + # Set the result order. If neither row nor col major, set to be row major. + if input.flags.f_contiguous: + order = clib.ResultOrder.colmajor + else: + if not input.flags.contiguous: + input = np.ascontiguousarray(input) + order = clib.ResultOrder.rowmajor clib_dense_array.reset(result_order=order) self._set_reader_coords(clib_dense_array, new_coords) diff --git a/apis/python/tests/test_regression.py b/apis/python/tests/test_regression.py new file mode 100644 index 0000000000..f78aeb4a3d --- /dev/null +++ b/apis/python/tests/test_regression.py @@ -0,0 +1,35 @@ +"""Testing module for regression tests""" + + +import numpy as np +import pyarrow as pa + +import tiledbsoma as soma + + +def test_nd_dense_non_contiguous_write(tmp_path): + """Test regression dected in GitHub Issue #2537""" + # Create data. + data = ( + np.arange(np.product(24), dtype=np.uint8) + .reshape((4, 3, 2)) + .transpose((2, 0, 1)) + ) + coords = tuple(slice(0, dim_len) for dim_len in data.shape) + tensor = pa.Tensor.from_numpy(data) + + # Create array and write data to it. + with soma.DenseNDArray.create( + tmp_path.as_posix(), type=pa.uint8(), shape=data.shape + ) as array: + array.write(coords, tensor) + + # Check the data is correct when we read it back. + with soma.DenseNDArray.open(tmp_path.as_posix()) as array: + result = array.read(coords) + np.testing.assert_equal(data, result.to_numpy()) + + # Check the data is correct when we read it back. + with soma.DenseNDArray.open(tmp_path.as_posix()) as array: + result = array.read(coords, result_order="column-major") + np.testing.assert_equal(data.transpose(), result.to_numpy()) From e913b9f6d32e4ab5e6b89a08b0e9a0cf0e440997 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 10 May 2024 13:27:52 -0400 Subject: [PATCH 2/6] Restrict R/Python GHAs from running on irrelevant `{.github,doc}` changes (#2543) --- .github/workflows/python-ci-minimal.yml | 10 ++++++++-- .github/workflows/r-ci.yml | 10 +++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-ci-minimal.yml b/.github/workflows/python-ci-minimal.yml index 30a100661b..8eaad1ad4b 100644 --- a/.github/workflows/python-ci-minimal.yml +++ b/.github/workflows/python-ci-minimal.yml @@ -12,8 +12,14 @@ on: branches: - main - 'release-*' - paths-ignore: - - 'apis/r/**' + paths: + - '**' + - '!**.md' + - '!apis/r/**' + - '!docs/**' + - '!.github/**' + - '.github/workflows/python-ci-minimal.yml' + - '.github/workflows/python-ci-single.yml' workflow_dispatch: jobs: diff --git a/.github/workflows/r-ci.yml b/.github/workflows/r-ci.yml index c107f05d18..3f52aee025 100644 --- a/.github/workflows/r-ci.yml +++ b/.github/workflows/r-ci.yml @@ -2,9 +2,13 @@ name: TileDB-SOMA R CI on: pull_request: - paths-ignore: - - "apis/python/**" - - ".pre-commit-config.yaml" + paths: + - '**' + - '!**.md' + - '!apis/python/**' + - '!docs/**' + - '!.github/**' + - '.github/workflows/r-ci.yml' push: branches: - main From 5e5dc25f6192f2c49748617cbce34443576adbf2 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 10 May 2024 14:48:14 -0400 Subject: [PATCH 3/6] update doc/ README/deps, fix warnings, `from_h5ad` formatting (#2538) also seems to fix #2474; best guess is newer sphinx allows missing newline before `Lifecycle:`? --- apis/python/src/tiledbsoma/io/ingest.py | 31 ++++++++---- doc/README.md | 30 +++++++----- doc/local-build.sh | 60 ++++++++++-------------- doc/requirements_doc.txt | 21 +++++---- doc/source/conf.py | 4 +- doc/source/python-tiledbsoma-io.rst | 6 +-- doc/source/python-tiledbsoma-logging.rst | 6 +-- 7 files changed, 84 insertions(+), 74 deletions(-) diff --git a/apis/python/src/tiledbsoma/io/ingest.py b/apis/python/src/tiledbsoma/io/ingest.py index f123f0f4de..100826abf0 100644 --- a/apis/python/src/tiledbsoma/io/ingest.py +++ b/apis/python/src/tiledbsoma/io/ingest.py @@ -261,22 +261,27 @@ def from_h5ad( context: Optional :class:`SOMATileDBContext` containing storage parameters, etc. platform_config: Platform-specific options used to create this array, provided in the form - ``{"tiledb": {"create": {"sparse_nd_array_dim_zstd_level": 7}}}`` nested keys. + ``{\"tiledb\": {\"create\": {\"sparse_nd_array_dim_zstd_level\": 7}}}``. - obs_id_name and var_id_name: Which AnnData ``obs`` and ``var`` columns, respectively, to use - for append mode: values of this column will be used to decide which obs/var rows in appended - inputs are distinct from the ones already stored, for the assignment of ``soma_joinid``. If - this column exists in the input data, as a named index or a non-index column name, it will - be used. If this column doesn't exist in the input data, and if the index is nameless or - named ``index``, that index will be given this name when written to the SOMA experiment's - ``obs`` / ``var``. NOTE: it is not necessary for this column to be the index-column - name in the input AnnData objects ``obs``/``var``. + obs_id_name/var_id_name: Which AnnData ``obs`` and ``var`` columns, respectively, to use + for append mode. + + Values of this column will be used to decide which obs/var rows in appended + inputs are distinct from the ones already stored, for the assignment of ``soma_joinid``. If + this column exists in the input data, as a named index or a non-index column name, it will + be used. If this column doesn't exist in the input data, and if the index is nameless or + named ``index``, that index will be given this name when written to the SOMA experiment's + ``obs`` / ``var``. + + NOTE: it is not necessary for this column to be the index-column + name in the input AnnData objects ``obs``/``var``. X_layer_name: SOMA array name for the AnnData's ``X`` matrix. raw_X_layer_name: SOMA array name for the AnnData's ``raw/X`` matrix. ingest_mode: The ingestion type to perform: + - ``write``: Writes all data, creating new layers if the SOMA already exists. - ``resume``: Adds data to an existing SOMA, skipping writing data that was previously written. Useful for continuing after a partial @@ -286,12 +291,14 @@ def from_h5ad( multiple H5AD files to a single SOMA. X_kind: Which type of matrix is used to store dense X data from the - H5AD file: ``DenseNDArray`` or ``SparseNDArray``. + H5AD file: ``DenseNDArray`` or ``SparseNDArray``. registration_mapping: Does not need to be supplied when ingesting a single H5AD/AnnData object into a single :class:`Experiment`. When multiple inputs are to be ingested into a single experiment, there are two steps. First: + .. code-block:: python + import tiledbsoma.io rd = tiledbsoma.io.register_h5ads( experiment_uri, @@ -305,6 +312,8 @@ def from_h5ad( Once that's been done, the data ingests per se may be done in any order, or in parallel, via for each ``h5ad_file_name``: + .. code-block:: python + tiledbsoma.io.from_h5ad( experiment_uri, h5ad_file_name, @@ -321,6 +330,8 @@ def from_h5ad( This is a coarse-grained mechanism for setting key-value pairs on all SOMA objects in an ``Experiment`` hierarchy. Metadata for particular objects is more commonly set like: + .. code-block:: python + with soma.open(uri, 'w') as exp: exp.metadata.update({"aaa": "BBB"}) exp.obs.metadata.update({"ccc": 123}) diff --git a/doc/README.md b/doc/README.md index 784672f676..782ee69a31 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,19 +1,27 @@ # Basic on-laptop setup -``` -pip install . +Build the docs with: +```bash +./local-build.sh ``` -This is very important -- _for developers_, the nominal use-mode is `python setup.py develop` as documented in our [../apis/python/README.md](../apis/python/README.md). But this local build _will not find_ `tiledbsoma-py` from this local install. You must install `pip install apis/python so it can find Python source for document autogen, _and_ you must re-run `pip install apis/python after each and every source-file edit, even if you're just doing an edit-build-preview iteration loop in a sandbox checkout. +The first time you run this, it will: +1. Create and activate a virtualenv (`venv/`) +2. Install [`requirements_doc.txt`](requirements_doc.txt) +3. Install `..apis/python` (editable) +4. Build the docs (output to `doc/html/`) -``` -#!/bin/bash -set -euo pipefail -sphinx-build -E -T -b html -d foo/doctrees -D language=en doc/source doc/html -``` +Subsequent runs will only perform the 4th step (unless `-r`/`--reinstall` is passed). +Once the docs are built, you can: + +```bash +open source/_build/html/index.html ``` -#!/bin/bash -set -euo pipefail -open doc/html/python-api.html +or e.g.: +```bash +http-server source/_build/html & +open http://localhost:8080/ ``` + +and inspect them. diff --git a/doc/local-build.sh b/doc/local-build.sh index 01b074ff03..8e7f8ed5c0 100755 --- a/doc/local-build.sh +++ b/doc/local-build.sh @@ -17,57 +17,45 @@ die() { echo "$@" 1>&2 ; popd 2>/dev/null; exit 1 } -arg() { - echo "$1" | sed "s/^${2-[^=]*=}//" | sed "s/:/;/g" -} - # Display bootstrap usage usage() { -echo ' -Usage: '"$0"' [] -Options: [defaults in brackets after descriptions] -Configuration: - --help print this message -' + echo ' + Usage: '"$0"' [-r/--reinstall] [--help] + Options: [defaults in brackets after descriptions] + Configuration: + -r, --reinstall reinstall dependencies + --help print this message + ' exit 10 } # Parse arguments +reinstall= while test $# != 0; do case "$1" in + -r|--reinstall) reinstall=1 ;; --help) usage ;; *) die "Unknown option: $1" ;; esac shift done -setup_venv() { - if [ ! -d "${venv_dir}" ]; then - python -m virtualenv "${venv_dir}" || die "could not create virtualenv" - fi - source "${venv_dir}/bin/activate" || die "could not activate virtualenv" - pip install 'Sphinx==1.6.7' \ - 'breathe' \ - 'sphinx_rtd_theme' \ - -r requirements_doc.txt || die "could not install doc dependencies" -} +made_venv= +if [ ! -d "${venv_dir}" ]; then + python -m virtualenv "${venv_dir}" || die "could not create virtualenv" + made_venv=1 +fi -build_ext() { - pushd "${ext_dir}" - pip install apis/python || die "could not install tiledbsoma-py" - popd -} +source "${venv_dir}/bin/activate" || die "could not activate virtualenv" -build_site() { - sphinx-build -E -T -b html -d ${build_dir}/doctrees -D language=en ${source_dir} ${build_dir}/html || \ - die "could not build sphinx site" -} +if [ -n "${reinstall}" ] || [ -n "${made_venv}" ]; then + pip install -r requirements_doc.txt || die "could not install doc dependencies" + pushd "${ext_dir}" + pip install -e . || die "could not install tiledbsoma-py" + popd +fi -run() { - setup_venv - build_ext - build_site - echo "Build complete. Open '${build_dir}/html/index.html' in your browser." -} +sphinx-build -E -T -b html -d ${build_dir}/doctrees -D language=en ${source_dir} ${build_dir}/html || \ + die "could not build sphinx site" -run +echo "Build complete. Open '${build_dir}/html/index.html' in your browser." diff --git a/doc/requirements_doc.txt b/doc/requirements_doc.txt index 5ad6a63a0c..008433b842 100644 --- a/doc/requirements_doc.txt +++ b/doc/requirements_doc.txt @@ -1,10 +1,13 @@ -sphinx==4.5.0 -sphinx-rtd-theme==1.0.0 -docutils < 0.18 +breathe==4.35.0 +cmake==3.29.2 +docutils==0.20.1 +ipython==8.24.0 jinja2==3.1.4 -setuptools >= 18.0, <= 59.5.0 -setuptools_scm >= 1.5.4 -wheel >= 0.30 -cmake >= 3.21 -pybind11 >= 2.10.0 -nbsphinx +nbsphinx==0.9.3 +pandoc==2.3 +pybind11==2.12.0 +setuptools==69.5.1 +setuptools-scm==8.1.0 +sphinx==7.3.7 +sphinx-rtd-theme==2.0.0 +wheel==0.43.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 816da9cdd0..3d6e317241 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -80,7 +80,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -188,4 +188,4 @@ def setup(app): - app.add_stylesheet("custom.css") + app.add_css_file("custom.css") diff --git a/doc/source/python-tiledbsoma-io.rst b/doc/source/python-tiledbsoma-io.rst index 212ac1749f..a91aed3085 100644 --- a/doc/source/python-tiledbsoma-io.rst +++ b/doc/source/python-tiledbsoma-io.rst @@ -1,5 +1,5 @@ The tiledbsoma.io module -===================== +======================== .. currentmodule:: tiledbsoma.io @@ -7,7 +7,7 @@ The tiledbsoma.io module Functions -------- +--------- .. autosummary:: :toctree: _autosummary/ @@ -19,4 +19,4 @@ Functions tiledbsoma.io.add_matrix_to_collection tiledbsoma.io.create_from_matrix tiledbsoma.io.to_h5ad - tiledbsoma.io.to_anndata \ No newline at end of file + tiledbsoma.io.to_anndata diff --git a/doc/source/python-tiledbsoma-logging.rst b/doc/source/python-tiledbsoma-logging.rst index a00cb948fc..ae52a23c37 100644 --- a/doc/source/python-tiledbsoma-logging.rst +++ b/doc/source/python-tiledbsoma-logging.rst @@ -1,5 +1,5 @@ The tiledbsoma.logging module -===================== +============================= .. currentmodule:: tiledbsoma.logging @@ -7,7 +7,7 @@ The tiledbsoma.logging module Functions -------- +--------- .. autosummary:: :toctree: _autosummary/ @@ -15,4 +15,4 @@ Functions tiledbsoma.logging.info tiledbsoma.logging.debug - tiledbsoma.logging.warning \ No newline at end of file + tiledbsoma.logging.warning From 18c3e6cb9230d3cabe8b946364c2f0b9f850d521 Mon Sep 17 00:00:00 2001 From: Paul Hoffman Date: Fri, 10 May 2024 14:57:46 -0400 Subject: [PATCH 4/6] [r/ci] Add check to disable BSPM in R CI (#2546) * [r/ci] Add check to disable BSPM in R CI bspm does not respect the `repos` argument in `install.packages()`; this is an issue where the valid version of tiledb-r is on R-universe, but not on CRAN. In this situation, bspm will still install from APT rather than the repository specified in `install.pacakges(repos =` To get around this, I've added a check that asks - is bspm installed - is the valid tiledb-r avaialble only on alternate repos If both of those are true, disable bspm for installing tiledb-r; bspm is still used for upstream dependencies of tiledb-r * Port tiledb-r resolving to R/Python interop CI --- .github/workflows/r-ci.yml | 1 - .github/workflows/r-python-interop-testing.yml | 15 ++++++++++++++- apis/r/tools/install-tiledb-r.R | 9 +++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r-ci.yml b/.github/workflows/r-ci.yml index 3f52aee025..e2f53c76b6 100644 --- a/.github/workflows/r-ci.yml +++ b/.github/workflows/r-ci.yml @@ -77,7 +77,6 @@ jobs: - name: Install BioConductor package SingleCellExperiment run: cd apis/r && tools/r-ci.sh install_bioc SingleCellExperiment - # Uncomment these next two stanzas as needed whenever we've just released a new tiledb-r for # which source is available but CRAN releases (and hence update r2u binaries) are not yet: # diff --git a/.github/workflows/r-python-interop-testing.yml b/.github/workflows/r-python-interop-testing.yml index a47dfa371c..99284c0b02 100644 --- a/.github/workflows/r-python-interop-testing.yml +++ b/.github/workflows/r-python-interop-testing.yml @@ -32,8 +32,21 @@ jobs: - name: Bootstrap run: cd apis/r && tools/r-ci.sh bootstrap + - name: Set additional repositories (Linux) + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + rversion <- paste(strsplit(as.character(getRversion()), split = '\\.')[[1L]][1:2], collapse = '.') + codename <- system('. /etc/os-release; echo ${VERSION_CODENAME}', intern = TRUE) + repo <- "https://tiledb-inc.r-universe.dev" + (opt <- sprintf('options(repos = c("%s/bin/linux/%s/%s", "%s", getOption("repos")))', repo, codename, rversion, repo)) + cat(opt, "\n", file = "~/.Rprofile", append = TRUE) + shell: Rscript {0} + + - name: Install tiledb-r + run: cd apis/r && Rscript tools/install-tiledb-r.R + - name: Dependencies - run: cd apis/r && tools/r-ci.sh install_all + run: cd apis/r && Rscript -e "remotes::install_deps(dependencies = TRUE, upgrade = FALSE)" - name: CMake uses: lukka/get-cmake@latest diff --git a/apis/r/tools/install-tiledb-r.R b/apis/r/tools/install-tiledb-r.R index d7421448ab..b6dc0a1952 100644 --- a/apis/r/tools/install-tiledb-r.R +++ b/apis/r/tools/install-tiledb-r.R @@ -42,4 +42,13 @@ ctb <- contrib.url(getOption("repos")) names(ctb) <- getOption("repos") dbr <- db[idx[valid], 'Repository'] (repos <- names(ctb[ctb %in% dbr])) + +# BSPM doesn't respect `repos` +# Check to see if any repo w/ valid tiledb-r is CRAN +# If not, turn of BSPM +cran <- getOption("repos")['CRAN'] +cran[is.na(cran)] <- "" +if (requireNamespace("bspm", quietly = TRUE) && !any(dbr %in% cran)) { + bspm::disable() +} utils::install.packages("tiledb", repos = repos) From 4ad8f257177ee45a7badd1c3d839d7123357f4bd Mon Sep 17 00:00:00 2001 From: John Kerl Date: Fri, 10 May 2024 17:55:28 -0400 Subject: [PATCH 5/6] Use core 2.23.0, TileDB-Py 0.29.0, TileDB-R 0.27.0 (#2548) --- .github/workflows/python-ci-packaging.yml | 8 +++--- apis/python/setup.py | 2 +- apis/r/DESCRIPTION | 2 +- apis/r/tools/get_tarball.R | 6 ++-- .../cmake/Modules/FindTileDB_EP.cmake | 28 +++++++++---------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python-ci-packaging.yml b/.github/workflows/python-ci-packaging.yml index 9a0945caba..65be47b968 100644 --- a/.github/workflows/python-ci-packaging.yml +++ b/.github/workflows/python-ci-packaging.yml @@ -74,7 +74,7 @@ jobs: run: | mkdir -p external # Please do not edit manually -- let scripts/update-tiledb-version.py update this - wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-linux-x86_64-2.22.0-52e981e.tar.gz + wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-linux-x86_64-2.23.0-152093b.tar.gz tar -C external -xzf tiledb-linux-x86_64-*.tar.gz ls external/lib/ echo "LD_LIBRARY_PATH=$(pwd)/external/lib" >> $GITHUB_ENV @@ -169,7 +169,7 @@ jobs: run: | mkdir -p external # Please do not edit manually -- let scripts/update-tiledb-version.py update this - wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-x86_64-2.22.0-52e981e.tar.gz + wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-x86_64-2.23.0-152093b.tar.gz tar -C external -xzf tiledb-macos-x86_64-*.tar.gz ls external/lib/ echo "DYLD_LIBRARY_PATH=$(pwd)/external/lib" >> $GITHUB_ENV @@ -260,10 +260,10 @@ jobs: if [ `uname -s` == "Darwin" ]; then # Please do not edit manually -- let scripts/update-tiledb-version.py update this - wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-x86_64-2.22.0-52e981e.tar.gz + wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-x86_64-2.23.0-152093b.tar.gz else # Please do not edit manually -- let scripts/update-tiledb-version.py update this - wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-linux-x86_64-2.22.0-52e981e.tar.gz + wget --quiet https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-linux-x86_64-2.23.0-152093b.tar.gz fi tar -C external -xzf tiledb-*.tar.gz ls external/lib/ diff --git a/apis/python/setup.py b/apis/python/setup.py index 5cfe70762e..176584a04e 100644 --- a/apis/python/setup.py +++ b/apis/python/setup.py @@ -331,7 +331,7 @@ def run(self): "scipy", # Note: the somacore version is in .pre-commit-config.yaml too "somacore==1.0.11", - "tiledb~=0.28.0", + "tiledb~=0.29.0", "typing-extensions", # Note "-" even though `import typing_extensions` ], extras_require={ diff --git a/apis/r/DESCRIPTION b/apis/r/DESCRIPTION index 9817e7d70c..ccc69a73e8 100644 --- a/apis/r/DESCRIPTION +++ b/apis/r/DESCRIPTION @@ -34,7 +34,7 @@ Imports: Matrix, stats, bit64, - tiledb (>= 0.26.0), tiledb (<= 0.26.99), + tiledb (>= 0.27.0), tiledb (<= 0.27.99), arrow, utils, fs, diff --git a/apis/r/tools/get_tarball.R b/apis/r/tools/get_tarball.R index 66d7480e6f..7626a67faa 100644 --- a/apis/r/tools/get_tarball.R +++ b/apis/r/tools/get_tarball.R @@ -14,14 +14,14 @@ isLinux <- Sys.info()["sysname"] == "Linux" if (isMac) { arch <- system('uname -m', intern = TRUE) if (arch == "x86_64") { - url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-x86_64-2.22.0-52e981e.tar.gz" + url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-x86_64-2.23.0-152093b.tar.gz" } else if (arch == "arm64") { - url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-arm64-2.22.0-52e981e.tar.gz" + url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-arm64-2.23.0-152093b.tar.gz" } else { stop("Unsupported Mac architecture. Please have TileDB Core installed locally.") } } else if (isLinux) { - url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-linux-x86_64-2.22.0-52e981e.tar.gz" + url <- "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-linux-x86_64-2.23.0-152093b.tar.gz" } else { stop("Unsupported platform for downloading artifacts. Please have TileDB Core installed locally.") } diff --git a/libtiledbsoma/cmake/Modules/FindTileDB_EP.cmake b/libtiledbsoma/cmake/Modules/FindTileDB_EP.cmake index 544e126d18..652b0cd6a6 100644 --- a/libtiledbsoma/cmake/Modules/FindTileDB_EP.cmake +++ b/libtiledbsoma/cmake/Modules/FindTileDB_EP.cmake @@ -58,8 +58,8 @@ else() # NB When updating the pinned URLs here, please also update in file apis/r/tools/get_tarball.R if(DOWNLOAD_TILEDB_PREBUILT) if (WIN32) # Windows - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-windows-x86_64-2.22.0-52e981e.zip") - SET(DOWNLOAD_SHA1 "7c1852c1c916be650cf7f75b238844104370cb1f") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-windows-x86_64-2.23.0-152093b.zip") + SET(DOWNLOAD_SHA1 "ea83e8482b84244407d73f72dfeec0efb0d1ef8c") elseif(APPLE) # OSX # Status quo as of 2023-05-18: @@ -76,22 +76,22 @@ else() # o CMAKE_SYSTEM_PROCESSOR is x86_64 if (CMAKE_OSX_ARCHITECTURES STREQUAL x86_64) - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-x86_64-2.22.0-52e981e.tar.gz") - SET(DOWNLOAD_SHA1 "a0b6b91a448aefae351cbe96c5cc2c8867eb2b07") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-x86_64-2.23.0-152093b.tar.gz") + SET(DOWNLOAD_SHA1 "b0aeef67e1e7d6a8037c4a6e088c910d692b0615") elseif (CMAKE_OSX_ARCHITECTURES STREQUAL arm64) - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-arm64-2.22.0-52e981e.tar.gz") - SET(DOWNLOAD_SHA1 "838ab13090f0832e3858b88aa3aa9b38bde7c7cb") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-arm64-2.23.0-152093b.tar.gz") + SET(DOWNLOAD_SHA1 "6414e23bd89eb023283b9bea37b2b65deff4b769") elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)") - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-x86_64-2.22.0-52e981e.tar.gz") - SET(DOWNLOAD_SHA1 "a0b6b91a448aefae351cbe96c5cc2c8867eb2b07") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-x86_64-2.23.0-152093b.tar.gz") + SET(DOWNLOAD_SHA1 "b0aeef67e1e7d6a8037c4a6e088c910d692b0615") elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-macos-arm64-2.22.0-52e981e.tar.gz") - SET(DOWNLOAD_SHA1 "838ab13090f0832e3858b88aa3aa9b38bde7c7cb") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-macos-arm64-2.23.0-152093b.tar.gz") + SET(DOWNLOAD_SHA1 "6414e23bd89eb023283b9bea37b2b65deff4b769") endif() else() # Linux - SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.22.0/tiledb-linux-x86_64-2.22.0-52e981e.tar.gz") - SET(DOWNLOAD_SHA1 "292fdd4d4034ef7e4686da04b1ffc9e7976f1601") + SET(DOWNLOAD_URL "https://github.com/TileDB-Inc/TileDB/releases/download/2.23.0/tiledb-linux-x86_64-2.23.0-152093b.tar.gz") + SET(DOWNLOAD_SHA1 "afcedf7eac59d8ccb357fce8bcf0cfb24ff8c329") endif() ExternalProject_Add(ep_tiledb @@ -113,8 +113,8 @@ else() else() # Build from source ExternalProject_Add(ep_tiledb PREFIX "externals" - URL "https://github.com/TileDB-Inc/TileDB/archive/2.22.0.zip" - URL_HASH SHA1=edce787da60547b8a3043248f1f44e86fcffc3eb + URL "https://github.com/TileDB-Inc/TileDB/archive/2.23.0.zip" + URL_HASH SHA1=2acca37618f0a6192ca648930138231476422b96 DOWNLOAD_NAME "tiledb.zip" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EP_INSTALL_PREFIX} From e90f55563d06fd04c805b04e824588211a9a582c Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 10 May 2024 19:41:54 -0400 Subject: [PATCH 6/6] export `tiledbsoma.SparseNDArrayRead`, include in module doc site (#2544) fixes #2502 --- apis/python/src/tiledbsoma/__init__.py | 3 ++- apis/python/src/tiledbsoma/_sparse_nd_array.py | 3 ++- doc/source/python-tiledbsoma.rst | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apis/python/src/tiledbsoma/__init__.py b/apis/python/src/tiledbsoma/__init__.py index 946f9cba40..7476d5de15 100644 --- a/apis/python/src/tiledbsoma/__init__.py +++ b/apis/python/src/tiledbsoma/__init__.py @@ -165,7 +165,7 @@ ) from ._indexer import IntIndexer, tiledbsoma_build_index from ._measurement import Measurement -from ._sparse_nd_array import SparseNDArray +from ._sparse_nd_array import SparseNDArray, SparseNDArrayRead from .options import SOMATileDBContext, TileDBCreateOptions from .pytiledbsoma import ( tiledbsoma_stats_disable, @@ -205,6 +205,7 @@ "SOMAError", "SOMATileDBContext", "SparseNDArray", + "SparseNDArrayRead", "TileDBCreateOptions", "tiledbsoma_build_index", "tiledbsoma_stats_disable", diff --git a/apis/python/src/tiledbsoma/_sparse_nd_array.py b/apis/python/src/tiledbsoma/_sparse_nd_array.py index bd0cc3f832..6e7ebcc592 100644 --- a/apis/python/src/tiledbsoma/_sparse_nd_array.py +++ b/apis/python/src/tiledbsoma/_sparse_nd_array.py @@ -506,7 +506,8 @@ def __init__( class SparseNDArrayRead(_SparseNDArrayReadBase): - """Intermediate type to choose result format when reading a sparse array. + """:class:`SparseNDArrayRead` is an intermediate type which supports multiple eventual result formats + when reading a sparse array. Results returned by `coos` and `tables` iterate over COO coordinates in the user-specified result order, but with breaks between iterator steps at arbitrary coordinates (i.e., any given result may split a row or diff --git a/doc/source/python-tiledbsoma.rst b/doc/source/python-tiledbsoma.rst index 242ecef3e1..c9bc2b123a 100644 --- a/doc/source/python-tiledbsoma.rst +++ b/doc/source/python-tiledbsoma.rst @@ -18,9 +18,10 @@ Classes tiledbsoma.DataFrame tiledbsoma.SparseNDArray + tiledbsoma.SparseNDArrayRead tiledbsoma.DenseNDArray - tiledbsoma.ResultOrder + tiledbsoma.ResultOrder tiledbsoma.AxisColumnNames tiledbsoma.AxisQuery @@ -56,4 +57,4 @@ Functions tiledbsoma.tiledbsoma_stats_disable tiledbsoma.tiledbsoma_stats_dump tiledbsoma.tiledbsoma_stats_enable - tiledbsoma.tiledbsoma_stats_reset \ No newline at end of file + tiledbsoma.tiledbsoma_stats_reset