Skip to content

Commit

Permalink
support somacore>=1.0.24 / tiledbsoma>=1.15.0rc4 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-williams authored Dec 19, 2024
1 parent 68a8fa2 commit c440fea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/python-tilledbsoma-ml-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- "tiledbsoma~=1.12.0"
- "tiledbsoma~=1.13.0"
- "tiledbsoma~=1.14.0"
- "tiledbsoma~=1.15.0rc4"

runs-on: ${{ matrix.os }}

Expand Down
8 changes: 7 additions & 1 deletion src/tiledbsoma_ml/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import scipy.sparse as sparse
import tiledbsoma as soma
import torch
from somacore.query._eager_iter import EagerIterator as _EagerIterator

from tiledbsoma_ml._csr import CSR_IO_Buffer
from tiledbsoma_ml._distributed import (
Expand All @@ -37,6 +36,13 @@
from tiledbsoma_ml._experiment_locator import ExperimentLocator
from tiledbsoma_ml._utils import NDArrayNumber, batched, splits

try:
# somacore<1.0.24 / tiledbsoma<1.15
from somacore.query._eager_iter import EagerIterator as _EagerIterator
except ImportError:
# somacore>=1.0.24 / tiledbsoma>=1.15
from tiledbsoma._eager_iter import EagerIterator as _EagerIterator

logger = logging.getLogger("tiledbsoma_ml.pytorch")

NDArrayJoinId = npt.NDArray[np.int64]
Expand Down
1 change: 1 addition & 0 deletions tests/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def add_dataframe(coll: CollectionBase, key: str, value_range: range) -> None:
]
),
index_column_names=["soma_joinid"],
domain=((value_range.start, value_range.stop),),
)
df.write(
pa.Table.from_pydict(
Expand Down

0 comments on commit c440fea

Please sign in to comment.