Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial steps toward a torch.utils.data.IterableDataset (PR 3 of N) #6

Merged
merged 25 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ffb7ff8
initial cut at a torch.utils.data.IterDataset
bkmartinjr Sep 23, 2024
ec181fd
Fix GHA PR trigger
ryan-williams Sep 25, 2024
9325a4f
add GHA workflows for basic CI (PR 4 of N) (#7)
bkmartinjr Sep 25, 2024
d9c0ef4
trigger `python-tilledbsoma-ml-compat.yml` GHA on all PR branches
ryan-williams Sep 25, 2024
9d9e20d
cleanup based on PR feedback
bkmartinjr Oct 1, 2024
1ca11e1
use 3.11 in precommit tools
ryan-williams Oct 1, 2024
0031292
type tweaks
ryan-williams Oct 1, 2024
db26af4
docstr/comment nits
ryan-williams Oct 1, 2024
579727a
f-string debugging
ryan-williams Oct 1, 2024
35c1925
docstring updates, attempt to make `shape`/`len` more precise
ryan-williams Oct 2, 2024
9c70271
test parametrize `use_eager_fetch`
ryan-williams Oct 2, 2024
a2ad150
reindex batches
ryan-williams Oct 3, 2024
66e99de
comment updates
ryan-williams Oct 3, 2024
bfbe849
rm deprecated `typing.List` usages
ryan-williams Oct 3, 2024
85ec492
`XValueGen`, `Path` type aliases
ryan-williams Oct 3, 2024
0353bf1
`s/PipeClassImplementation/PipeClasses/g`
ryan-williams Oct 3, 2024
d41af0e
update `test_non_batched`, rm redundant `test_sparse_output__non_batc…
ryan-williams Oct 3, 2024
7e8bb6f
update `test_uneven_soma_and_result_batches`
ryan-williams Oct 3, 2024
fc768fd
update `test_batching__all_batches_full_size`, rm redundant `test_spa…
ryan-williams Oct 3, 2024
9cd03db
update `test_soma_joinids`, rm redundant `test__X_tensor_dtype_matche…
ryan-williams Oct 3, 2024
b8e2c83
update `test_batching__partial_final_batch_size`
ryan-williams Oct 3, 2024
a46e10a
update `test_batching__exactly_one_batch`
ryan-williams Oct 3, 2024
0f76f03
update var names: `batch`/`batches`
ryan-williams Oct 3, 2024
ffaccdd
update `test_distributed_and_multiprocessing__returns_data_partition_…
ryan-williams Oct 3, 2024
7801854
add `test_splits` case
ryan-williams Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 62 additions & 3 deletions .github/workflows/python-tiledbsoma-ml.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,69 @@
name: python-tiledbsoma-ml
name: python-tiledbsoma-ml CI

on:
pull_request:
branches: ["**"]
paths-ignore: ['scripts/**']
push:
branches: [main]
paths-ignore: ['scripts/**']
workflow_dispatch:

jobs:
job:
lint:
runs-on: ubuntu-latest
steps:
# Empty job; placeholder GHA
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Restore pre-commit cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install pre-commit
run: pip -v install pre-commit

- name: Run pre-commit hooks on all files
run: pre-commit run -v -a

tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install prereqs
run: |
pip install --upgrade pip wheel pytest pytest-cov setuptools
pip install .

- name: Run tests
run: pytest -v --cov=src --cov-report=xml tests

build:
# for now, just do a test build to ensure that it works
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Do build
run: |
pip install --upgrade build pip wheel setuptools setuptools-scm
python -m build .
44 changes: 41 additions & 3 deletions .github/workflows/python-tilledbsoma-ml-compat.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,47 @@
name: python-tiledbsoma-ml past tiledbsoma compat # Latest tiledbsoma version covered by another workflow

on:
pull_request:
branches: ["**"]
paths-ignore:
- "scripts/**"
- "notebooks/**"
push:
branches: [main]
paths-ignore:
- "scripts/**"
- "notebooks/**"
workflow_dispatch:

jobs:
job:
runs-on: ubuntu-latest
unit_tests:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"] # could add 'macos-latest', but the matrix is already huge...
python-version: ["3.9", "3.10", "3.11"] # TODO: add 3.12 when tiledbsoma releases wheels for it.
pkg-version:
- "tiledbsoma~=1.9.0 'numpy<2.0.0'"
- "tiledbsoma~=1.10.0 'numpy<2.0.0'"
- "tiledbsoma~=1.11.0"
- "tiledbsoma~=1.12.0"
- "tiledbsoma~=1.13.0"
- "tiledbsoma~=1.14.0"

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

steps:
# Empty job; placeholder GHA
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install prereqs
run: |
pip install --upgrade pip pytest setuptools
pip install ${{ matrix.pkg-version }} .

- name: Run tests
run: pytest -v tests
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ repos:
rev: "24.8.0"
hooks:
- id: black
exclude: 'apis/'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
hooks:
- id: ruff
name: "ruff for tiledbsoma_ml"
args: ["--config=pyproject.toml"]
exclude: 'apis/'

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
Expand All @@ -23,4 +21,3 @@ repos:
- attrs
- numpy
- pandas-stubs>=2
exclude: 'apis/'
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ show_error_codes = true
ignore_missing_imports = true
warn_unreachable = true
strict = true
python_version = 3.9
python_version = '3.11'
plugins = "numpy.typing.mypy_plugin"

[tool.ruff]
lint.select = ["E", "F", "B", "I"]
lint.ignore = ["E501"] # line too long
lint.extend-select = ["I001"] # unsorted-imports
fix = true
target-version = "py39"
target-version = "py311"
line-length = 120
10 changes: 10 additions & 0 deletions src/tiledbsoma_ml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@

"""An API to support machine learning applications built on SOMA."""

from .pytorch import (
ExperimentAxisQueryIterableDataset,
ExperimentAxisQueryIterDataPipe,
)

__version__ = "0.1.0-dev"

__all__ = [
"ExperimentAxisQueryIterDataPipe",
"ExperimentAxisQueryIterableDataset",
]
Loading