Skip to content

Commit c14e44f

Browse files
[pre-commit.ci] pre-commit autoupdate (#204)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.8.6](astral-sh/ruff-pre-commit@v0.6.9...v0.8.6) - [github.com/psf/black: 24.8.0 → 24.10.0](psf/black@24.8.0...24.10.0) - [github.com/adamchainz/blacken-docs: 1.18.0 → 1.19.1](adamchainz/blacken-docs@1.18.0...1.19.1) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.14.1](pre-commit/mirrors-mypy@v1.11.2...v1.14.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ci: make fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nathaniel Starkman <[email protected]>
1 parent 07195c1 commit c14e44f

File tree

9 files changed

+2473
-12
lines changed

9 files changed

+2473
-12
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,26 @@ repos:
3535
- id: text-unicode-replacement-char
3636

3737
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: "v0.6.9"
38+
rev: "v0.8.6"
3939
hooks:
4040
- id: ruff
4141
args:
4242
- --fix
4343

4444
- repo: https://github.com/psf/black
45-
rev: 24.8.0
45+
rev: 24.10.0
4646
hooks:
4747
- id: black
4848
additional_dependencies: [toml]
4949

5050
- repo: https://github.com/adamchainz/blacken-docs
51-
rev: 1.18.0
51+
rev: 1.19.1
5252
hooks:
5353
- id: blacken-docs
5454
additional_dependencies: [black]
5555

5656
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: "v1.11.2"
57+
rev: "v1.14.1"
5858
hooks:
5959
- id: mypy
6060
additional_dependencies:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ ignore = [
163163

164164
# ruff (RUF)
165165
"RUF009", # do not perform function call in dataclass defaults
166+
"RUF022",
166167

167168
# flake8-todo (TD) # TODO: fix these
168169
"TD",

src/stream_mapper/pytorch/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from stream_mapper.core import ModelBase as CoreModelBase
1414
from stream_mapper.core._connect.nn_namespace import NN_NAMESPACE
1515
from stream_mapper.core._connect.xp_namespace import XP_NAMESPACE
16-
from stream_mapper.core.typing import ArrayNamespace # noqa: TCH001
16+
from stream_mapper.core.typing import ArrayNamespace # noqa: TC001
1717
from stream_mapper.core.utils.dataclasses import ArrayNamespaceReprMixin
1818
from stream_mapper.core.utils.scale import names_intersect
1919

src/stream_mapper/pytorch/_connect/data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _from_tensor_to_tensor(data: Data[xp.Tensor], /, **kwargs: Any) -> Data[xp.T
2525

2626

2727
def _from_ndarray_to_tensor(
28-
data: Data[np.ndarray[Any, Any]], /, **kwargs: Any
28+
data: Data[np.ndarray[Any, Any]], /, **kwargs: Any # type: ignore[type-var]
2929
) -> Data[xp.Tensor]:
3030
"""Convert from numpy.ndarray to torch.Tensor."""
3131
return replace(data, array=xp.asarray(data.array, **kwargs))
@@ -36,7 +36,7 @@ def _from_ndarray_to_tensor(
3636

3737
def _from_tensor_to_ndarray(
3838
data: Data[xp.Tensor], /, **kwargs: Any
39-
) -> Data[np.ndarray[Any, Any]]:
39+
) -> Data[np.ndarray[Any, Any]]: # type: ignore[type-var]
4040
"""Convert from torch.Tensor to numpy.ndarray."""
4141
return replace(data, array=np.asarray(data.array, **kwargs))
4242

@@ -51,7 +51,7 @@ def _from_tensor_to_ndarray(
5151
else:
5252

5353
def _from_ndarraytype_to_tensor(
54-
data: Data[np.ndarray[Any, Any]], /, **kwargs: Any
54+
data: Data[np.ndarray[Any, Any]], /, **kwargs: Any # type: ignore[type-var]
5555
) -> Data[xp.Tensor]:
5656
"""Convert from numpy.ndarray to torch.Tensor."""
5757
array = np.array(data.array, copy=True, subok=False)

src/stream_mapper/pytorch/builtin/compat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from stream_mapper.pytorch.builtin.compat.nflow import NFlowModel
55
from stream_mapper.pytorch.builtin.compat.zuko import ZukoFlowModel
66

7-
__all__ = ("ZukoFlowModel", "NFlowModel", "KDEModel")
7+
__all__ = ("KDEModel", "NFlowModel", "ZukoFlowModel")

src/stream_mapper/pytorch/builtin/compat/kde.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__all__: tuple[str, ...] = ()
66

7-
from collections.abc import Callable # noqa: TCH003
7+
from collections.abc import Callable # noqa: TC003
88
from dataclasses import KW_ONLY, dataclass
99
from typing import TYPE_CHECKING
1010

src/stream_mapper/pytorch/prior.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from stream_mapper.core.prior import * # noqa: F403
99
from stream_mapper.core.prior._track import ControlRegions as CoreControlRegions
1010
from stream_mapper.core.prior._weight import HardThreshold as CoreHardThreshold
11-
from stream_mapper.core.typing import ArrayNamespace # noqa: TCH001
11+
from stream_mapper.core.typing import ArrayNamespace # noqa: TC001
1212

1313
from stream_mapper.pytorch.typing import Array
1414

src/stream_mapper/pytorch/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Pytorch type hints."""
22

3-
__all__ = ("Array", "NNModel", "ArrayNamespace")
3+
__all__ = ("Array", "ArrayNamespace", "NNModel")
44

55
from torch import Tensor as Array
66
from torch.nn import Module as NNModel

uv.lock

Lines changed: 2460 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)