Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump black from 23.12.1 to 24.1.1 #53

Merged
merged 2 commits into from
Feb 6, 2024
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
2 changes: 1 addition & 1 deletion dev_requirements/requirements-formatting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile requirements-formatting.in
#
black==23.12.1
black==24.1.1
# via -r dev_requirements/requirements-formatting.in
click==8.1.3
# via black
Expand Down
1 change: 1 addition & 0 deletions src/pvframework/analysis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains functionality to analyze the result of a validation process
"""

import itertools
from typing import TYPE_CHECKING, Generic, Optional

Expand Down
1 change: 1 addition & 0 deletions src/pvframework/errors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains functionality to handle all the ValidationErrors and creating error IDs.
"""

import asyncio
import hashlib
import logging
Expand Down
1 change: 1 addition & 0 deletions src/pvframework/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Here is the main stuff. The ValidationManager bundles several mapped validators and can validate data sets onto
these.
"""

import asyncio
import csv
import logging
Expand Down
1 change: 1 addition & 0 deletions src/pvframework/mapped_validators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains some usable the mapped validators.
"""

from .path_map import PathMappedValidator
from .query_map import Query, QueryMappedValidator
from .query_parallel_map import ParallelQueryMappedValidator
1 change: 1 addition & 0 deletions src/pvframework/mapped_validators/path_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Contains a PathMappedValidator which gets the values from the data set in a very simple way. If you need a more
customizable MappedValidator you may be interested in the `QueryMappedValidator`.
"""

from typing import Any, Generator

from frozendict import frozendict
Expand Down
1 change: 1 addition & 0 deletions src/pvframework/mapped_validators/query_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Contains logic to retrieve the data from the data sets in a more complex and more general manner than the
PathMappedValidator. With this it is e.g. possible to iterate through lists and execute the validator for each element.
"""

import itertools
from collections import OrderedDict
from typing import Any, Callable, Generator, Iterable, Iterator, Optional, Self, TypeAlias
Expand Down
1 change: 1 addition & 0 deletions src/pvframework/mapped_validators/query_parallel_map.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the ParallelQueryMappedValidator class.
"""

from typing import Any, Iterator, Optional

from pvframework.types import DataSetT, ValidatorFunctionT
Expand Down
4 changes: 2 additions & 2 deletions src/pvframework/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains the types used in the validation framework
"""

from typing import TYPE_CHECKING, Any, Callable, Coroutine, Protocol, TypeAlias, TypeVar

if TYPE_CHECKING:
Expand All @@ -12,8 +13,7 @@ class Hashable(Protocol):
A protocol that defines the __hash__ method.
"""

def __hash__(self) -> int:
...
def __hash__(self) -> int: ...


DataSetT = TypeVar("DataSetT", bound=Hashable)
Expand Down
1 change: 1 addition & 0 deletions src/pvframework/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
This module contains utility functions that can be used inside validator functions.
"""

from .frame_functions import param
from .query_object import optional_field, required_field
1 change: 1 addition & 0 deletions src/pvframework/utils/frame_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains some useful utility functions to be used in validator functions.
"""

import inspect
from typing import Optional

Expand Down
9 changes: 5 additions & 4 deletions src/pvframework/utils/query_object.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains some useful utility functions to be used in validator functions.
"""

from typing import TYPE_CHECKING, Any, Optional, TypeVar, overload

from typeguard import TypeCheckError, check_type
Expand All @@ -26,13 +27,13 @@ def optional_field(obj: Any, attribute_path: str, attribute_type: type[AttrT]) -
@overload
def required_field(
obj: Any, attribute_path: str, attribute_type: type[AttrT], param_base_path: Optional[str] = None
) -> AttrT:
...
) -> AttrT: ...


@overload
def required_field(obj: Any, attribute_path: str, attribute_type: Any, param_base_path: Optional[str] = None) -> Any:
...
def required_field(
obj: Any, attribute_path: str, attribute_type: Any, param_base_path: Optional[str] = None
) -> Any: ...


def required_field(obj: Any, attribute_path: str, attribute_type: Any, param_base_path: Optional[str] = None) -> Any:
Expand Down
7 changes: 3 additions & 4 deletions src/pvframework/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Contains functionality to build up a box of information around a validator function before registering it to a
ValidationManager. This reduces complexity inside the ValidationManager.
"""

import asyncio
import inspect
import logging
Expand Down Expand Up @@ -174,15 +175,13 @@ def is_async(self) -> bool:
@overload
def is_async(
validator: "MappedValidatorT",
) -> TypeGuard["MappedValidator[Any, AsyncValidatorFunction]"]:
...
) -> TypeGuard["MappedValidator[Any, AsyncValidatorFunction]"]: ...


@overload
def is_async(
validator: "ValidatorT",
) -> TypeGuard["Validator[Any, AsyncValidatorFunction]"]:
...
) -> TypeGuard["Validator[Any, AsyncValidatorFunction]"]: ...


def is_async(
Expand Down