Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed May 2, 2024
2 parents 1ba9b94 + 6750916 commit 04a9657
Show file tree
Hide file tree
Showing 72 changed files with 3,292 additions and 1,092 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/r-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ jobs:
- name: Bootstrap
run: cd apis/r && tools/r-ci.sh bootstrap

- name: Set pkgType to binary (macOS)
if: ${{ matrix.os == 'macOS-latest' }}
run: cat("\noptions(pkgType = 'binary')\n", file = "~/.Rprofile", append = TRUE)
shell: Rscript {0}

- name: Install BioConductor package SingleCellExperiment
run: cd apis/r && tools/r-ci.sh install_bioc SingleCellExperiment

Expand Down Expand Up @@ -89,12 +84,12 @@ jobs:
- name: Dependencies
run: cd apis/r && tools/r-ci.sh install_all

- name: Install dataset packages from source (macOS)
if: ${{ matrix.os == 'macOS-latest' }}
run: cd apis/r && _CI_PKG_TYPE_=both _CI_USE_BIOC_=true Rscript tools/install_missing_deps.R
# - name: Install dataset packages from source (macOS)
# if: ${{ matrix.os == 'macOS-latest' }}
# run: cd apis/r && _CI_PKG_TYPE_=both _CI_USE_BIOC_=true Rscript tools/install_missing_deps.R

- name: CMake
uses: lukka/get-cmake@latest
# - name: CMake
# uses: lukka/get-cmake@latest

#- name: MkVars
# run: mkdir ~/.R && echo "CXX17FLAGS=-Wno-deprecated-declarations -Wno-deprecated" > ~/.R/Makevars
Expand All @@ -106,8 +101,8 @@ jobs:
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: sudo ldconfig
#
- name: Update Packages
run: Rscript -e 'update.packages(ask=FALSE)'
# - name: Update Packages
# run: Rscript -e 'update.packages(ask=FALSE)'

# - name: Build Package
# run: cd apis/r && R CMD build --no-build-vignettes --no-manual .
Expand All @@ -126,7 +121,7 @@ jobs:
run: cd apis/r && tools/r-ci.sh run_tests

- name: Coverage
if: ${{ matrix.os == 'ubuntu-latest' && matrix.covr == 'yes' }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.covr == 'yes' && github.event_name == 'workflow_dispatch' }}
run: apis/r/tools/r-ci.sh coverage

- name: View Logs
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: mypy
additional_dependencies:
- "pandas-stubs==1.5.3.230214"
- "somacore==1.0.10"
- "somacore==1.0.11"
- "types-setuptools==67.4.0.3"
args: ["--config-file=apis/python/pyproject.toml", "apis/python/src", "apis/python/devtools"]
pass_filenames: false
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ help:
# install
# -------------------------------------------------------------------

# set default variable values, if non-null
# Set default variable values, if non-null
# * build=Debug creates binary artifacts with symbols, e.g. for gdb
# * cmake_verbose=true creates Makefiles that produce full compile lines when executed
build ?= Release
cmake_verbose ?= false

.PHONY: install
install: clean
@./scripts/bld --prefix=${prefix} --tiledb=${tiledb} --build=${build}
@./scripts/bld --prefix=${prefix} --tiledb=${tiledb} --build=${build} --cmake-verbose=${cmake_verbose}
@TILEDB_PATH=${tiledb} pip install -v -e apis/python

.PHONY: r-build
Expand Down
3 changes: 2 additions & 1 deletion apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ def run(self):
"pyarrow>=9.0.0; platform_system!='Darwin'",
"scanpy>=1.9.2",
"scipy",
"somacore==1.0.10",
# Note: the somacore version is in .pre-commit-config.yaml too
"somacore==1.0.11",
"tiledb~=0.28.0",
"typing-extensions", # Note "-" even though `import typing_extensions`
],
Expand Down
8 changes: 7 additions & 1 deletion apis/python/src/tiledbsoma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@
from ._constants import SOMA_JOINID
from ._dataframe import DataFrame
from ._dense_nd_array import DenseNDArray
from ._exception import AlreadyExistsError, DoesNotExistError, SOMAError
from ._exception import (
AlreadyExistsError,
DoesNotExistError,
NotCreateableError,
SOMAError,
)
from ._experiment import Experiment
from ._factory import open
from ._general_utilities import (
Expand Down Expand Up @@ -192,6 +197,7 @@
"get_storage_engine",
"IntIndexer",
"Measurement",
"NotCreateableError",
"open",
"ResultOrder",
"show_package_versions",
Expand Down
18 changes: 10 additions & 8 deletions apis/python/src/tiledbsoma/_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
from ._dense_nd_array import DenseNDArray
from ._exception import (
AlreadyExistsError,
NotCreateableError,
SOMAError,
is_already_exists_error,
is_does_not_exist_error,
is_not_createable_error,
)
from ._funcs import typeguard_ignore
from ._sparse_nd_array import SparseNDArray
Expand Down Expand Up @@ -119,6 +121,8 @@ def create(
Raises:
tiledbsoma.AlreadyExistsError:
If the underlying object already exists at the given URI.
tiledbsoma.NotCreateableError:
If the URI is malformed for a particular storage backend.
TileDBError:
If unable to create the underlying object.
Expand All @@ -137,6 +141,8 @@ def create(
except tiledb.TileDBError as tdbe:
if is_already_exists_error(tdbe):
raise AlreadyExistsError(f"{uri!r} already exists")
if is_not_createable_error(tdbe):
raise NotCreateableError(f"{uri!r} cannot be created")
raise

@classmethod
Expand Down Expand Up @@ -469,14 +475,10 @@ def __getitem__(self, key: str) -> CollectionElementType:
context = self.context
timestamp = self.tiledb_timestamp_ms

try:
clib_type = entry.entry.wrapper_type.clib_type
wrapper = _tdb_handles.open(uri, mode, context, timestamp, clib_type)
entry.soma = _factory.reify_handle(wrapper)
except SOMAError:
entry.soma = _factory._open_internal(
entry.entry.wrapper_type.open, uri, mode, context, timestamp
)
clib_type = entry.entry.wrapper_type.clib_type
wrapper = _tdb_handles.open(uri, mode, context, timestamp, clib_type)
entry.soma = _factory.reify_handle(wrapper)

# Since we just opened this object, we own it and should close it.
self._close_stack.enter_context(entry.soma)
return cast(CollectionElementType, entry.soma)
Expand Down
11 changes: 10 additions & 1 deletion apis/python/src/tiledbsoma/_common_nd_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
import tiledb

from . import _arrow_types, _util
from ._exception import AlreadyExistsError, is_already_exists_error
from ._exception import (
AlreadyExistsError,
NotCreateableError,
is_already_exists_error,
is_not_createable_error,
)
from ._tiledb_array import TileDBArray
from ._types import OpenTimestamp
from .options._soma_tiledb_context import (
Expand Down Expand Up @@ -80,6 +85,8 @@ def create(
If the ``shape`` is unsupported.
tiledbsoma.AlreadyExistsError:
If the underlying object already exists at the given URI.
tiledbsoma.NotCreateableError:
If the URI is malformed for a particular storage backend.
TileDBError:
If unable to create the underlying object.
Expand All @@ -103,6 +110,8 @@ def create(
except tiledb.TileDBError as tdbe:
if is_already_exists_error(tdbe):
raise AlreadyExistsError(f"{uri!r} already exists")
if is_not_createable_error(tdbe):
raise NotCreateableError(f"{uri!r} cannot be created")
raise

@property
Expand Down
Loading

0 comments on commit 04a9657

Please sign in to comment.