Skip to content

Commit 3a325bf

Browse files
committed
fix if statements
1 parent 20ffce6 commit 3a325bf

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

ci/fireci/fireciplugins/macrobenchmark/analyze/aggregator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def mapper(quantile: float) -> str: return f'p{int(quantile * 100)}'
4646
dispersions = pd.DataFrame([pd.Series(cv, name='cv'), pd.Series(rmad, name='rmad')])
4747

4848
# Optionally save percentiles and dispersions to file
49-
if output_dir is not None:
49+
if output_dir:
5050
percentiles.to_json(output_dir.joinpath('percentiles.json'), orient='index')
5151
dispersions.to_json(output_dir.joinpath('dispersions.json'), orient='index')
5252
logger.info(f'Percentiles and dispersions saved in: {output_dir}')
@@ -73,8 +73,7 @@ def calculate_statistic_diff(
7373
percentage = delta / ctl_mean
7474

7575
# Optionally save statistics to file
76-
if output_dir is not None:
76+
if output_dir:
7777
delta.to_json(output_dir.joinpath('delta.json'))
7878
percentage.to_json(output_dir.joinpath('percentage.json'))
7979
logger.info(f'Percentiles diff saved in: {output_dir}')
80-

ci/fireci/fireciplugins/macrobenchmark/analyze/analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def start(
3838
):
3939
logger.info('Starting to analyze macrobenchmark test results ...')
4040

41-
if output_dir is None:
41+
if not output_dir:
4242
output_dir = Path(tempfile.mkdtemp(prefix='macrobenchmark-analysis-'))
4343
logger.info(f'Created temporary dir "{output_dir}" to save analysis results')
4444

ci/fireci/fireciplugins/macrobenchmark/analyze/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828

2929

3030
def collect_data_points(ftl_results_dir: list[str], local_reports_dir: Path) -> list[DataPoint]:
31-
if not ftl_results_dir and local_reports_dir is None:
31+
if not ftl_results_dir and not local_reports_dir:
3232
raise ClickException('Neither ftl-results-dir or local-reports-dir is provided.')
33-
elif ftl_results_dir and local_reports_dir is None:
33+
elif ftl_results_dir and not local_reports_dir:
3434
temp_dir = _download(ftl_results_dir)
3535
return _extract_raw_data(temp_dir)
36-
elif not ftl_results_dir and local_reports_dir is not None:
36+
elif not ftl_results_dir and local_reports_dir:
3737
return _extract_raw_data(local_reports_dir)
3838
else:
3939
raise ClickException('Should specify either ftl-results-dir or local-reports-dir, not both.')

0 commit comments

Comments
 (0)