Skip to content

Commit

Permalink
#296: simplify calc_metrics script
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Aug 14, 2024
1 parent 720d3da commit eeb3d60
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions tests/e2e_tests/calc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,36 +213,36 @@ def _get_history_plots(test_results: dict, metrics_classes: list):
test_results |= metrics
except Exception as e:
print(e)
finally:
print(test_results)

if not neptune_upload:
print("skipping neptune upload")
exit(0)

neptune_run = neptune.init_run(
project=NEPTUNE_PROJECT_NAME,
tags=[test_case_name, short_sha, branch_name],
)

# metrics
for k, v in test_results.items():
print(f"adding {k}={v}")
neptune_run[k] = v

# files
for file_name in OutputFiles.all_values():
print("adding", file_name)
file_path = os.path.join(output_path, file_name)
if os.path.exists(file_path):
neptune_run["output/" + file_name].track_files(file_path)

try:
history_plots = _get_history_plots(test_results, metrics_classes)

for name, plot in history_plots:
neptune_run[f"plots/{name}"].upload(plot)
except Exception as e:
print(f"no plots today: {e}")

neptune_run.stop()

print(test_results)

if not neptune_upload:
print("skipping neptune upload")
exit(0)

neptune_run = neptune.init_run(
project=NEPTUNE_PROJECT_NAME,
tags=[test_case_name, short_sha, branch_name],
)

# metrics
for k, v in test_results.items():
print(f"adding {k}={v}")
neptune_run[k] = v

# files
for file_name in OutputFiles.all_values():
print("adding", file_name)
file_path = os.path.join(output_path, file_name)
if os.path.exists(file_path):
neptune_run["output/" + file_name].track_files(file_path)

try:
history_plots = _get_history_plots(test_results, metrics_classes)

for name, plot in history_plots:
neptune_run[f"plots/{name}"].upload(plot)
except Exception as e:
print(f"no plots today: {e}")

neptune_run.stop()

0 comments on commit eeb3d60

Please sign in to comment.