Commit 137cc5e9 authored by Florian Fischer's avatar Florian Fischer
Browse files

use types from typing to be compatible with older python versions

parent 2c184885
Pipeline #67477 failed with stage
in 24 seconds
......@@ -7,7 +7,7 @@ from pathlib import Path
import os
import subprocess
import sys
from typing import Sequence, Union
from typing import Dict, List, Sequence, Union
from .client import CLIENT_DIR, CLIENT_EXE
from .globalvars import ROOT_DIR
......@@ -43,8 +43,8 @@ BUF_SEL_CHECKOUT = 'muhq/buffer-selection'
SQPOLL_CHECKOUT = 'muhq/sqpoll'
FlavorDesc = dict[str, Union[list[str], str]]
Flavors = dict[str, FlavorDesc]
FlavorDesc = Dict[str, Union[List[str], str]]
Flavors = Dict[str, FlavorDesc]
FLAVORS: Flavors = {
'vanilla': {},
......@@ -415,7 +415,7 @@ def select_flavors(selectors: Sequence[str]) -> Flavors:
def prepare_flavors(data_dir: Path,
selectors: Sequence[str] = None,
fetch=True) -> dict[str, str]:
fetch=True) -> Dict[str, str]:
"""Prepare a emper flavor defined in FLAVORS to be evaluated"""
checkout_and_fetch_repo(fetch=fetch)
......
......@@ -6,7 +6,7 @@ import csv
import fnmatch
import io
from pathlib import Path
from typing import Iterable, Mapping, Optional, Sequence, Union
from typing import Dict, Iterable, List, Mapping, Optional, Sequence, Union
import numpy as np
......@@ -19,10 +19,10 @@ def to_number(string: str) -> Number:
return f if '.' in string else int(f)
DataPoint = Union[list[Number], Number]
ExperimentData = dict[str, DataPoint]
ImplData = dict[int, list[ExperimentData]]
EvaluationResults = dict[str, ImplData]
DataPoint = Union[List[Number], Number]
ExperimentData = Dict[str, DataPoint]
ImplData = Dict[int, List[ExperimentData]]
EvaluationResults = Dict[str, ImplData]
def collect_results(result_dir: Union[Path, str],
......@@ -114,10 +114,10 @@ def collect_results(result_dir: Union[Path, str],
return data
Stats = dict[str, float]
ConnectionStats = dict[str, Stats]
ImplStats = dict[int, ConnectionStats]
EvaluationStats = dict[str, ImplStats]
Stats = Dict[str, float]
ConnectionStats = Dict[str, Stats]
ImplStats = Dict[int, ConnectionStats]
EvaluationStats = Dict[str, ImplStats]
def calculate_stats(data: EvaluationResults, warn=False) -> EvaluationStats:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment