Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiBoether committed Oct 15, 2024
1 parent fa54ff3 commit bc7ed02
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
8 changes: 4 additions & 4 deletions analytics/app/pages/plots/cost_vs_eval_metric_agg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import get_args
from typing import Any, get_args

import pandas as pd
import plotly.express as px
Expand Down Expand Up @@ -32,9 +32,9 @@ class _PageState:

def gen_fig_scatter_num_triggers(
page: str,
eval_handler: str,
dataset_id: str,
metric: str,
eval_handler: str | Any | None,
dataset_id: str | Any | None,
metric: str | Any | None,
agg_func_x: AGGREGATION_FUNCTION,
agg_func_y: EVAL_AGGREGATION_FUNCTION,
stages: list[str],
Expand Down
7 changes: 4 additions & 3 deletions analytics/app/pages/plots/eval_heatmap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass
from typing import Any

import pandas as pd
from dash import Input, Output, callback, dcc, html
Expand Down Expand Up @@ -31,9 +32,9 @@ def gen_figure(
page: str,
multi_pipeline_mode: bool,
patch_yearbook: bool,
eval_handler: str,
dataset_id: str,
metric: str,
eval_handler: str | Any | None,
dataset_id: str | Any | None,
metric: str | Any | None,
) -> go.Figure:
"""Create the cost over time figure with barplot or histogram. Histogram
has nice binning while barplot is precise.
Expand Down
7 changes: 4 additions & 3 deletions analytics/app/pages/plots/eval_over_time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dataclasses import dataclass
from typing import Any

import pandas as pd
import plotly.express as px
Expand Down Expand Up @@ -29,9 +30,9 @@ def gen_figure(
page: str,
multi_pipeline_mode: bool,
patch_yearbook: bool,
eval_handler: str,
dataset_id: str,
metric: str,
eval_handler: str | Any | None,
dataset_id: str | Any | None,
metric: str | Any | None,
) -> go.Figure:
"""Create the evaluation over time figure with a line plot.
Expand Down
10 changes: 5 additions & 5 deletions analytics/app/pages/plots/num_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ class _PageState:
def gen_figure(
page: str,
multi_pipeline_mode: bool,
time_metric: str,
y_axis: YAxis,
use_scatter_size: bool,
time_metric: str | None,
y_axis: YAxis | None,
use_scatter_size: bool | None,
patch_yearbook: bool,
dataset_id: str,
eval_handler: str,
dataset_id: str | None,
eval_handler: str | None,
) -> go.Figure:
"""Create the cost over time figure with barplot or histogram. Histogram
has nice binning while barplot is precise.
Expand Down
6 changes: 3 additions & 3 deletions analytics/app/pages/plots/num_triggers_eval_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class _PageState:
def gen_fig_scatter_num_triggers(
page: str,
multi_pipeline_mode: bool,
eval_handler: str,
dataset_id: str,
metric: str,
eval_handler: str | None,
dataset_id: str | None,
metric: str | None,
aggregate_metric: bool = True,
time_weighted: bool = True,
only_active_periods: bool = True,
Expand Down
2 changes: 1 addition & 1 deletion modyn/metadata_database/metadata_database_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, modyn_config: dict) -> None:
if "hash_partition_modulus" in self.modyn_config["metadata_database"]
else 16
)
self.seed: int = (
self.seed: int | None = (
self.modyn_config["metadata_database"]["seed"] if "seed" in self.modyn_config["metadata_database"] else None
)
if self.seed is not None:
Expand Down

0 comments on commit bc7ed02

Please sign in to comment.