Skip to content

Commit

Permalink
Attempting to fix naming issues across worker and api
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellAV committed Aug 2, 2024
1 parent 51e1d51 commit 6ee58ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions valhub/submissions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def update_submission_result(request: Request, submission_id: str):
return Response(response_data, status=status.HTTP_400_BAD_REQUEST)

required_fields = [
"mean_run_time",
"mean_runtime",
"function_parameters",
"metrics",
]
Expand All @@ -283,7 +283,7 @@ def update_submission_result(request: Request, submission_id: str):
return Response(response_data, status=status.HTTP_400_BAD_REQUEST)

logging.info(f"results = {results}")
submission.mrt = float(results["mean_run_time"])
submission.mrt = float(results["mean_runtime"])
submission.data_requirements = results["function_parameters"]
submission.result = results["metrics"]
try:
Expand Down
8 changes: 4 additions & 4 deletions workers/src/pvinsight-validation-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ def run( # noqa: C901

public_metrics_dict["module"] = module_name
# Get the mean and median run times
public_metrics_dict["mean_run_time"] = results_df["run_time"].mean()
public_metrics_dict["median_run_time"] = results_df["run_time"].median()
public_metrics_dict["mean_runtime"] = results_df["runtime"].mean()
public_metrics_dict["median_runtime"] = results_df["runtime"].median()
public_metrics_dict["function_parameters"] = [
"time_series",
*config_data["allowable_kwargs"],
Expand Down Expand Up @@ -628,7 +628,7 @@ def m_median(df: pd.DataFrame, column: str):
for val in config_data["ground_truth_compare"]:

if metric == "runtime":
key = "run_time"
key = "runtime"
else:
key = f"{metric}_{val}"

Expand All @@ -643,7 +643,7 @@ def m_median(df: pd.DataFrame, column: str):

metric_result = operation_function(results_df, key)

metric_result_dict = {f"{operation}_{key}": metric_result}
metric_result_dict = {f"{operation}_{metric}": metric_result}
metrics_dict.update(metric_result_dict)

public_metrics_dict["metrics"] = metrics_dict
Expand Down

0 comments on commit 6ee58ec

Please sign in to comment.