Skip to content

Commit 85bbb93

Browse files
authored
add pre-commit configuration and update HydroErr.py
1 parent e0a80ee commit 85bbb93

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
default_stages: [pre-commit]
2+
3+
repos:
4+
- repo: local
5+
hooks:
6+
- id: ruff-check
7+
name: Ruff Check
8+
entry: uv run ruff check
9+
language: system
10+
types: [python]
11+
12+
- id: ruff-format
13+
name: Ruff Format
14+
entry: uv run ruff format
15+
language: system
16+
types: [python]
17+
18+
- id: type-check
19+
name: Type Check
20+
entry: uv run ty check
21+
language: system
22+
types: [python]
23+
pass_filenames: false

src/HydroErr/HydroErr.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import warnings
44
from collections.abc import Sequence
5-
from typing import Any, Protocol
5+
from typing import Any
66

77
import numpy as np
88
from numpy.typing import NDArray
@@ -3139,8 +3139,7 @@ def kge_2009(
31393139
remove_zero: bool = False,
31403140
return_all: bool = False,
31413141
) -> (
3142-
np.floating[Any]
3143-
| tuple[np.floating[Any], np.floating[Any], np.floating[Any], np.floating[Any]]
3142+
np.floating[Any] | tuple[np.floating[Any], np.floating[Any], np.floating[Any], np.floating[Any]]
31443143
):
31453144
"""Compute the Kling-Gupta efficiency (2009).
31463145
@@ -3279,8 +3278,7 @@ def kge_2012(
32793278
remove_zero: bool = False,
32803279
return_all: bool = False,
32813280
) -> (
3282-
np.floating[Any]
3283-
| tuple[np.floating[Any], np.floating[Any], np.floating[Any], np.floating[Any]]
3281+
np.floating[Any] | tuple[np.floating[Any], np.floating[Any], np.floating[Any], np.floating[Any]]
32843282
):
32853283
"""Compute the Kling-Gupta efficiency (2012).
32863284

0 commit comments

Comments
 (0)