Skip to content

Commit b7cd8e1

Browse files
committed
Simplify
1 parent d20fe01 commit b7cd8e1

1 file changed

Lines changed: 13 additions & 23 deletions

File tree

bench_runner/config.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,33 +89,23 @@ def __post_init__(self):
8989
self.benchmarks = Benchmarks(**self.benchmarks)
9090
if isinstance(self.notify, dict):
9191
self.notify = Notify(**self.notify)
92-
self.longitudinal_plot = (
93-
mplot.LongitudinalPlotConfig(
94-
**self.longitudinal_plot # pyright: ignore[reportCallIssue]
92+
if isinstance(self.longitudinal_plot, dict):
93+
self.longitudinal_plot = mplot.LongitudinalPlotConfig(
94+
**self.longitudinal_plot
9595
)
96-
if self.longitudinal_plot
97-
else None
98-
)
99-
self.flag_effect_plot = (
100-
mplot.FlagEffectPlotConfig(
101-
**self.flag_effect_plot # pyright: ignore[reportCallIssue]
96+
if isinstance(self.flag_effect_plot, dict):
97+
self.flag_effect_plot = mplot.FlagEffectPlotConfig(**self.flag_effect_plot)
98+
if isinstance(self.benchmark_longitudinal_plot, dict):
99+
self.benchmark_longitudinal_plot = mplot.BenchmarkLongitudinalPlotConfig(
100+
**self.benchmark_longitudinal_plot
102101
)
103-
if self.flag_effect_plot
104-
else None
105-
)
106-
self.benchmark_longitudinal_plot = (
107-
mplot.BenchmarkLongitudinalPlotConfig(
108-
**self.benchmark_longitudinal_plot # pyright: ignore[reportCallIssue]
109-
)
110-
if self.benchmark_longitudinal_plot
111-
else None
112-
)
113-
self.weekly = {
114-
name: Weekly(**weekly) # pyright: ignore[reportCallIssue]
115-
for name, weekly in self.weekly.items()
116-
}
117102
if len(self.weekly) == 0:
118103
self.weekly = {"default": Weekly(runners=list(self.runners.keys()))}
104+
else:
105+
self.weekly = {
106+
name: Weekly(**weekly) # pyright: ignore[reportCallIssue]
107+
for name, weekly in self.weekly.items()
108+
}
119109

120110

121111
@functools.cache

0 commit comments

Comments
 (0)