Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args:
Expand Down Expand Up @@ -44,22 +44,22 @@ repos:
args:
- --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.12
rev: v0.13.3
hooks:
- id: ruff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated

- id: ruff-format
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.19.1
rev: 1.20.0
hooks:
- id: blacken-docs
additional_dependencies:
- black
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.2
rev: v0.24.3
hooks:
- id: toml-sort-fix
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.5.3
rev: v3.6.2
hooks:
- id: prettier
- repo: https://github.com/igorshubovych/markdownlint-cli
Expand All @@ -77,7 +77,7 @@ repos:
hooks:
- id: actionlint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.0
rev: v1.18.2
hooks:
- id: mypy
files: ^glass/
Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/density.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
" axis=1,\n",
" return_counts=True,\n",
" )\n",
" cube[*indices] += count"
" cube[tuple(indices)] += count"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion glass/_array_api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class Generator:
__slots__ = ("rng",)

def __init__(
self, seed: int | bool | NDArray[np.int_ | np.bool] | None = None
self,
seed: int | bool | NDArray[np.int_ | np.bool] | None = None, # noqa: FBT001
) -> None:
self.rng = numpy.random.default_rng(seed=seed) # type: ignore[arg-type]

Expand Down
8 changes: 4 additions & 4 deletions glass/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

def deprecated(msg: str, /) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: # type: ignore[no-redef]
"""Backport of Python's warnings.deprecated()."""
from functools import wraps
from warnings import warn
from functools import wraps # noqa: PLC0415
from warnings import warn # noqa: PLC0415

def decorator(func: Callable[_P, _R], /) -> Callable[_P, _R]:
@wraps(func)
Expand Down Expand Up @@ -1102,9 +1102,9 @@ def regularized_spectra(
# regularise the cov matrix using the chosen method
cov_method: Callable[..., NDArray[Any]]
if method == "clip":
from glass.algorithm import cov_clip as cov_method
from glass.algorithm import cov_clip as cov_method # noqa: PLC0415
elif method == "nearest":
from glass.algorithm import cov_nearest as cov_method
from glass.algorithm import cov_nearest as cov_method # noqa: PLC0415
else:
msg = f"unknown method '{method}'" # type: ignore[unreachable]
raise ValueError(msg)
Expand Down
4 changes: 2 additions & 2 deletions glass/grf/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def dispatch(
def add(
impl: Callable[[TransformationT, TransformationT, NDArray[Any]], NDArray[Any]],
) -> Callable[[TransformationT, TransformationT, NDArray[Any]], NDArray[Any]]:
from inspect import signature
from typing import get_type_hints
from inspect import signature # noqa: PLC0415
from typing import get_type_hints # noqa: PLC0415

sig = signature(impl)
if len(sig.parameters) != 3:
Expand Down
2 changes: 1 addition & 1 deletion glass/shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def partition_restrict(
The partition.

"""
part = np.empty((len(shells),) + np.shape(fz)[:-1])
part = np.empty((len(shells), *np.shape(fz)[:-1]))
for i, w in enumerate(shells):
zr, fr = restrict(z, fz, w)
part[i] = np.trapezoid(fr, zr, axis=-1)
Expand Down
2 changes: 1 addition & 1 deletion glass/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def write_catalog(
The writer object.

"""
import fitsio
import fitsio # noqa: PLC0415

with fitsio.FITS(filename, "rw", clobber=True) as fits:
fits.write(None)
Expand Down
Loading