Skip to content

Commit

Permalink
Merge branch 'main' into kerl/python-3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl authored Oct 17, 2024
2 parents c71fcf2 + aba232b commit 513963b
Show file tree
Hide file tree
Showing 24 changed files with 2,270 additions and 80 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/python-somacore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
format-check:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.8"
PYTHON_VERSION: "3.9"
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: python-spec/requirements-py${{ env.PYTHON_VERSION }}-lint.txt
cache-dependency-path: "python-spec/requirements-py${{ env.PYTHON_VERSION }}*.txt"

- name: Install static analysis packages
run: |
pip install -r python-spec/requirements-py${{ env.PYTHON_VERSION }}-lint.txt
working-directory: python-spec
run: pip install -r requirements-py${PYTHON_VERSION}.txt -r requirements-py${PYTHON_VERSION}-lint.txt

- name: Restore pre-commit cache
uses: actions/cache@v3
Expand All @@ -45,14 +45,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# setuptools-scm needs a deep clone so it can look through history
# to find a relevant tag.
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand All @@ -78,8 +78,8 @@ jobs:
&& startsWith(github.event.release.tag_name, 'python-')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: python-spec/requirements-py3.10.txt
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ dependencies = [
# Remove this once we can specify a recent pyarrow.
"pyarrow-hotfix",
"scipy",
"shapely",
"typing-extensions>=4.1", # For LiteralString (py3.11)
]
requires-python = "~=3.8"
requires-python = ">=3.9"
urls = { repository = "https://github.com/single-cell-data/SOMA.git" }
classifiers = ["License :: OSI Approved :: MIT License"]

Expand All @@ -43,7 +44,7 @@ tag_regex = '^python-(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$'

[tool.ruff]
lint.extend-select = ["I"]
target-version = "py38"
target-version = "py39"

[tool.ruff.lint.isort]
force-single-line = true
Expand All @@ -54,13 +55,13 @@ single-line-exclusions = ["typing", "typing_extensions"]
check_untyped_defs = true
enable_error_code = ["ignore-without-code"]
warn_redundant_casts = true
python_version = 3.8
python_version = 3.9
# We want to enable this but it won't work when running locally due to the
# presence of _version.py (which invalidates the ignore, which causes an error).
#
# warn_unused_ignores = true

[[tool.mypy.overrides]]
# These dependencies do not currently have canonical type stubs.
module = ["anndata", "pyarrow", "pyarrow_hotfix", "scipy"]
module = ["anndata", "pyarrow", "pyarrow.compute", "pyarrow_hotfix", "scipy", "shapely"]
ignore_missing_imports = true
1 change: 1 addition & 0 deletions python-spec/requirements-py3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pyarrow-hotfix==0.6
python-dateutil==2.9.0.post0
pytz==2024.1
scipy==1.13.1
shapely==2.0.4
six==1.16.0
typing_extensions==4.12.2
tzdata==2024.1
1 change: 1 addition & 0 deletions python-spec/requirements-py3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pyarrow==16.1.0
pyarrow-hotfix==0.6
python-dateutil==2.9.0.post0
pytz==2024.1
shapely==2.0.4
scipy==1.13.1
six==1.16.0
typing_extensions==4.12.2
Expand Down
1 change: 1 addition & 0 deletions python-spec/requirements-py3.12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ python-dateutil==2.9.0.post0
pytz==2024.1
scipy==1.13.1
setuptools==70.0.0
shapely==2.0.4
six==1.16.0
typing_extensions==4.12.2
tzdata==2024.1
Expand Down
38 changes: 0 additions & 38 deletions python-spec/requirements-py3.8-lint.txt

This file was deleted.

19 changes: 0 additions & 19 deletions python-spec/requirements-py3.8.txt

This file was deleted.

3 changes: 3 additions & 0 deletions python-spec/requirements-py3.9-lint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mypy==1.11.2
pandas-stubs==2.2.2.240807 # last version which supports Python 3.9
pre-commit==3.8.0
1 change: 1 addition & 0 deletions python-spec/requirements-py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pytz==2024.1
rsa==4.7.2
s3transfer==0.6.0
scipy==1.13.1
shapely==2.0.4
six==1.16.0
typing_extensions==4.12.2
tzdata==2024.1
26 changes: 26 additions & 0 deletions python-spec/src/somacore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

from .base import SOMAObject
from .collection import Collection
from .coordinates import AffineTransform
from .coordinates import Axis
from .coordinates import CoordinateSpace
from .coordinates import CoordinateTransform
from .coordinates import IdentityTransform
from .coordinates import ScaleTransform
from .coordinates import UniformScaleTransform
from .data import DataFrame
from .data import DenseNDArray
from .data import NDArray
Expand All @@ -30,6 +37,12 @@
from .query import AxisColumnNames
from .query import AxisQuery
from .query import ExperimentAxisQuery
from .scene import Scene
from .spatial import GeometryDataFrame
from .spatial import ImageProperties
from .spatial import MultiscaleImage
from .spatial import PointCloudDataFrame
from .spatial import SpatialRead
from .types import ContextBase

try:
Expand All @@ -52,13 +65,26 @@
"ReadIter",
"SparseNDArray",
"SparseRead",
"SpatialRead",
"Experiment",
"Measurement",
"Scene",
"ImageProperties",
"MultiscaleImage",
"GeometryDataFrame",
"PointCloudDataFrame",
"BatchSize",
"IOfN",
"ResultOrder",
"AxisColumnNames",
"AxisQuery",
"ExperimentAxisQuery",
"ContextBase",
"Axis",
"CoordinateSpace",
"CoordinateTransform",
"AffineTransform",
"ScaleTransform",
"UniformScaleTransform",
"IdentityTransform",
)
12 changes: 11 additions & 1 deletion python-spec/src/somacore/collection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import abc
from typing import Any, MutableMapping, Optional, Sequence, Type, TypeVar, overload
from typing import (
Any,
MutableMapping,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
overload,
)

import pyarrow as pa
from typing_extensions import Final, Self
Expand Down Expand Up @@ -145,6 +154,7 @@ def add_new_dataframe(
uri: Optional[str] = None,
schema: pa.Schema,
index_column_names: Sequence[str] = (options.SOMA_JOINID,),
domain: Optional[Sequence[Optional[Tuple[Any, Any]]]] = None,
platform_config: Optional[options.PlatformConfig] = None,
) -> data.DataFrame:
"""Creates a new DataFrame as a child of this collection.
Expand Down
Loading

0 comments on commit 513963b

Please sign in to comment.