Skip to content

Commit de661a7

Browse files
Merge pull request #151 from alliander-opensource/feature/version-3.7
support for 3.7
2 parents f52f38e + 0348a36 commit de661a7

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ classifiers = [
3333
"Operating System :: MacOS",
3434
"Topic :: Scientific/Engineering :: Physics",
3535
]
36-
requires-python = ">=3.8"
36+
requires-python = ">=3.7"
3737
dependencies = [
3838
"numpy>=1.21.0",
3939
]

src/power_grid_model/validation/rules.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
3636
"""
3737
from enum import Enum
38-
from typing import Any, Dict, List, Protocol, Tuple, Type, TypeVar, Union
38+
from typing import Any, Callable, Dict, List, Tuple, Type, TypeVar, Union
3939

4040
import numpy as np
4141

@@ -68,15 +68,6 @@
6868
CompError = TypeVar("CompError", bound=ComparisonError)
6969

7070

71-
class ComparisonFn(Protocol): # pylint: disable=too-few-public-methods
72-
"""
73-
A protocol defining a function on one or more numpy arrays, resulting in a single numpy array.
74-
"""
75-
76-
def __call__(self, val: np.ndarray, *ref: np.ndarray) -> np.ndarray:
77-
...
78-
79-
8071
def all_greater_than_zero(data: SingleDataset, component: str, field: str) -> List[NotGreaterThanError]:
8172
"""
8273
Check that for all records of a particular type of component, the values in the 'field' column are greater than
@@ -291,7 +282,7 @@ def none_match_comparison(
291282
data: SingleDataset,
292283
component: str,
293284
field: str,
294-
compare_fn: ComparisonFn,
285+
compare_fn: Callable,
295286
ref_value: ComparisonError.RefType,
296287
error: Type[CompError] = ComparisonError, # type: ignore
297288
) -> List[CompError]:

0 commit comments

Comments
 (0)