Skip to content

Commit

Permalink
__future__.annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
karibbov committed Sep 5, 2023
1 parent 8b15558 commit 7809190
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/neps/optimizers/multi_fidelity/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from typing import Any, Dict, List, Sequence, Tuple, Union
from __future__ import annotations

from typing import Any, Sequence

import pandas as pd

Expand All @@ -21,8 +23,8 @@ class MFObservedData:

def __init__(
self,
columns: Union[List[str], None] = None,
index_names: Union[List[str], None] = None,
columns: list[str] | None = None,
index_names: list[str] | None = None,
):
if columns is None:
columns = [self.default_config_col, self.default_perf_col]
Expand Down Expand Up @@ -51,7 +53,7 @@ def error_condition(self):
return self.df[self.perf_col] == "error"

@property
def seen_config_ids(self) -> List:
def seen_config_ids(self) -> list:
return self.df.index.levels[0].to_list()

@property
Expand All @@ -66,8 +68,8 @@ def next_config_id(self) -> int:

def add_data(
self,
data: Union[List[Any], List[List[Any]]],
index: Union[Tuple[int, ...], Sequence[Tuple[int, ...]], Sequence[int], int],
data: list[Any] | list[list[Any]],
index: tuple[int, ...] | Sequence[tuple[int, ...]] | Sequence[int] | int,
error: bool = False,
):
"""
Expand All @@ -92,8 +94,8 @@ def add_data(

def update_data(
self,
data_dict: Dict[str, List[Any]],
index: Union[Tuple[int, ...], Sequence[Tuple[int, ...]], Sequence[int], int],
data_dict: dict[str, list[Any]],
index: tuple[int, ...] | Sequence[tuple[int, ...]] | Sequence[int] | int,
error: bool = False,
):
"""
Expand Down

0 comments on commit 7809190

Please sign in to comment.