Skip to content

Commit

Permalink
More clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
AC-Dap committed Dec 21, 2023
1 parent 26d9bd4 commit bdeb14a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ersilia/core/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ def log_files_metrics(file):
for error in errors:
write_persistent_file(f"{error}: {errors[error]}")
write_persistent_file(f"Warning count: {warning_count}")
except FileNotFoundError:
logging.warning("Log file not found")
except (IsADirectoryError, FileNotFoundError):
logging.warning("Unable to calculate metrics for log file: log file not found")


def open_persistent_file(model_id):
Expand Down Expand Up @@ -223,7 +223,7 @@ def stats(self, result):
# drop first two columns (key, input)
dat = dat.drop(["key", "input"], axis=1)

# calculate and print statistics
# calculate statistics
stats = {}
for column in dat:
column_stats = {}
Expand Down Expand Up @@ -282,17 +282,15 @@ def check_types(self, result_df, metadata):
count += 1

if len(dtypes_list) > 1 and metadata["Output Shape"] != "List":
print("Not right shape. Expected List but got Single")
logging.warning("Not right shape. Expected List but got Single")
correct_shape = False
elif len(dtypes_list) == 1 and metadata["Output Shape"] != "Single":
print("Not right shape. Expected Single but got List")
logging.warning("Not right shape. Expected Single but got List")
correct_shape = False
else:
print("Output is correct shape.")
correct_shape = True

print(result_df)
print("Output has", count, "mismatched types.\n")
logging.info("Output has", count, "mismatched types.\n")

return {"mismatched_types": count, "correct_shape": correct_shape}

Expand Down

0 comments on commit bdeb14a

Please sign in to comment.