Skip to content

Commit

Permalink
Merge pull request #16 from HiDiHlabs/dev
Browse files Browse the repository at this point in the history
Update zarr from dev
  • Loading branch information
niklasmueboe authored Oct 24, 2024
2 parents 908bd2b + 7c39875 commit a6cd8e4
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'

- uses: actions-rust-lang/setup-rust-toolchain@v1

Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
skip: [fmt, cargo-check]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
exclude_types: ["jupyter"]
Expand All @@ -18,7 +18,7 @@ repos:
- id: no-commit-to-branch
args: [--branch=main]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
rev: v0.7.0
hooks:
- id: ruff
args: [--fix]
Expand All @@ -27,11 +27,11 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -49,10 +49,10 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/google/yamlfmt
rev: v0.12.1
rev: v0.13.0
hooks:
- id: yamlfmt
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.18
hooks:
- id: mdformat
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"
rust: "1.78"
sphinx:
configuration: docs/source/conf.py
Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ crate-type = ["cdylib"]

[dependencies]
bincode = { version = "1.3" }
indexmap = { version = "2.1.0", features = ["rayon"] }
indexmap = { version = ">= 2.1, < 2.6", features = ["rayon"] }
itertools = { version = "0.12.1" }
ndarray = { version = "0.15.6", features = ["rayon"] }
ndarray-stats = { version = "0.5.1" }
num = { version = "0.4.1" }
numpy = { version = "0.21.0" }
numpy = { version = "0.21" }
polars = { version = "0.41", features = ["partition_by", "dtype-categorical"] }
polars-arrow = { version = "0.41" }
pyo3 = { version = "0.21.0", features = ["extension-module"] }
pyo3-polars = { version = "0.15.0" }
rayon = { version = "1.8.0" }
pyo3 = { version = "0.21", features = ["extension-module"] }
pyo3-polars = { version = "0.15" }
rayon = { version = "1.8" }
serde_json = { version = "1" }
sprs = { version = "0.11.1", features = ["serde"] }
sprs = { version = "= 0.11.1", features = ["serde"] }
zarrs = { version = "0.16.4", features = ["ndarray", "gzip"] }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ conda install bioconda::sainsc
```

For detailed installation instructions please refer to the
[documentation](https://sainsc.readthedocs.io/en/stable/installation.html).
[documentation](https://sainsc.readthedocs.io/page/installation.html).

## Documentation

Expand Down
27 changes: 13 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@ name = "sainsc"
description = "Segmentation-free Analysis of In Situ Capture data"
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
requires-python = ">=3.10"
requires-python = ">=3.11"
dynamic = ["version"]

authors = [
{ name = "Niklas Müller-Bötticher", email = "[email protected]" },
]
dependencies = [
"anndata>=0.9",
"matplotlib",
"matplotlib>=3.7",
"matplotlib-scalebar",
"numba>=0.44",
"numpy>=1.21",
"pandas",
"numpy>=1.24",
"pandas>=2.0",
"polars[pandas]>=1",
"scikit-image>=0.18",
"scipy>=1.9",
"scikit-image>=0.20",
"scipy>=1.10",
"seaborn>=0.11",
"typing-extensions>=4",
]
classifiers = [
"Intended Audience :: Science/Research",
Expand Down Expand Up @@ -53,10 +52,10 @@ data = ["pooch>=1"]
dev = ["sainsc[data,docs,spatialdata]", "pre-commit"]

[project.urls]
homepage = "https://github.com/HiDiHlabs/sainsc"
documentation = "https://sainsc.readthedocs.io"
repository = "https://github.com/HiDiHlabs/sainsc"

Homepage = "https://github.com/HiDiHlabs/sainsc"
Documentation = "https://sainsc.readthedocs.io"
Repository = "https://github.com/HiDiHlabs/sainsc"
Issues = "https://github.com/HiDiHlabs/sainsc/issues"

[tool]

Expand All @@ -75,16 +74,16 @@ target = "sainsc._utils_rust"
profile = "black"

[tool.black]
target-version = ["py310", "py311", "py312"]
target-version = ["py311", "py312", "py313"]

[tool.ruff]
target-version = "py310"
target-version = "py311"

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"]

[tool.mypy]
python_version = "3.10"
python_version = "3.11"
ignore_missing_imports = true
warn_no_return = false
packages = "sainsc"
Expand Down
3 changes: 2 additions & 1 deletion sainsc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

del PackageNotFoundError, version

from . import io, lazykde, utils
from ._utils_rust import GridCounts
from .lazykde import LazyKDE

__all__ = ["GridCounts", "LazyKDE"]
__all__ = ["io", "lazykde", "utils", "GridCounts", "LazyKDE"]
2 changes: 1 addition & 1 deletion sainsc/_utils_rust.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pathlib import Path
from typing import Self

import numpy as np
from numpy.typing import NDArray
from polars import DataFrame
from typing_extensions import Self

from ._typealias import _Csx, _CsxArray

Expand Down
1 change: 0 additions & 1 deletion sainsc/io/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def read_Xenium(
:py:attr:`sainsc.io.XENIUM_CTRLS` by default.
For Xenium v3 parquet files the data is automatically filtered with the
'is_gene' column, as well.
column.
n_threads : int | None, optional
Number of threads used for reading file and processing. If `None` or 0 this will
default to the number of available CPUs.
Expand Down
7 changes: 3 additions & 4 deletions sainsc/lazykde/_LazyKDE.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from collections.abc import Iterable
from itertools import chain
from pathlib import Path
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Self

import matplotlib.pyplot as plt
import numpy as np
Expand All @@ -19,7 +19,6 @@
from numpy.typing import NDArray
from scipy.sparse import coo_array, csc_array, csr_array
from skimage.feature import peak_local_max
from typing_extensions import Self

from .._typealias import _Cmap, _Csx, _CsxArray, _Local_Max, _PathLike, _RangeTuple2D
from .._utils import _raise_module_load_error, _validate_n_threads, validate_threads
Expand All @@ -30,7 +29,7 @@
kde_at_coord,
sparse_kde_csx_py,
)
from ._kernel import gaussian_kernel
from ..utils import gaussian_kernel
from ._utils import (
SCALEBAR_PARAMS,
CosineCelltypeCallable,
Expand Down Expand Up @@ -1281,7 +1280,7 @@ def celltype_map(self) -> NDArray[np.signedinteger] | None:
"""
return self._celltype_map

def __str__(self) -> str:
def __repr__(self) -> str:
repr = [
f"LazyKDE ({self.n_threads} threads)",
f"genes: {len(self.genes)}",
Expand Down
3 changes: 1 addition & 2 deletions sainsc/lazykde/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
This module contains functionality for performing the various analysis steps of sainsc.
"""

from ._kernel import epanechnikov_kernel, gaussian_kernel
from ._LazyKDE import LazyKDE
from ._utils import SCALEBAR_PARAMS

__all__ = ["SCALEBAR_PARAMS", "LazyKDE", "epanechnikov_kernel", "gaussian_kernel"]
__all__ = ["SCALEBAR_PARAMS", "LazyKDE"]
3 changes: 2 additions & 1 deletion sainsc/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This module contains additional utility functionality supporting the analysis.
"""

from ._kernel import epanechnikov_kernel, gaussian_kernel
from ._signatures import celltype_signatures

__all__ = ["celltype_signatures"]
__all__ = ["celltype_signatures", "epanechnikov_kernel", "gaussian_kernel"]
File renamed without changes.
2 changes: 1 addition & 1 deletion src/gridcounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl GridCounts {
Ok(((HashMap::new(),), HashMap::new()))
}

fn __str__(&self) -> String {
fn __repr__(&self) -> String {
let mut repr = vec![
format!("GridCounts ({} threads)", self.n_threads),
format!("genes: {}", self.counts.len()),
Expand Down

0 comments on commit a6cd8e4

Please sign in to comment.