Skip to content

Commit

Permalink
refactor: future annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Jul 6, 2023
1 parent c943a8f commit bb2968e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions popmon/analysis/apply_func.py
Expand Up @@ -16,10 +16,9 @@
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import annotations

import warnings
from typing import Optional

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -147,8 +146,8 @@ def add_apply_func(
def transform(
self,
apply_to_data: dict,
assign_to_data: Optional[dict] = None,
apply_funcs: Optional[list] = None,
assign_to_data: dict | None = None,
apply_funcs: list | None = None,
):
"""
Apply functions to specified feature and metrics
Expand Down
6 changes: 3 additions & 3 deletions popmon/base/module.py
Expand Up @@ -17,11 +17,11 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from __future__ import annotations

import logging
from abc import ABCMeta
from functools import wraps
from typing import Optional, Tuple


def datastore_helper(func):
Expand Down Expand Up @@ -89,8 +89,8 @@ def combine_classes(*args):
class Module(metaclass=combine_classes(ABCMeta, ModuleMetaClass)):
"""Abstract base class used for modules in a pipeline."""

_input_keys: Optional[Tuple[str, ...]] = None
_output_keys: Optional[Tuple[str, ...]] = None
_input_keys: tuple[str, ...] | None = None
_output_keys: tuple[str, ...] | None = None

def __init__(self) -> None:
"""Module initialization"""
Expand Down

0 comments on commit bb2968e

Please sign in to comment.