Skip to content

Commit

Permalink
fix: Account for incomplete reports
Browse files Browse the repository at this point in the history
  • Loading branch information
adjavon committed Apr 23, 2024
1 parent e997147 commit de3b5a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/quac/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def load(self, filename):
"""Load report from disk"""
with open(filename, "r") as fd:
data = json.load(fd)
self.metadata = data["metadata"]
self.metadata = data.get("metadata", {})
self.thresholds = data["thresholds"]
self.normalized_mask_sizes = data["normalized_mask_sizes"]
self.score_changes = data["score_changes"]
Expand All @@ -165,6 +165,7 @@ def load(self, filename):

def get_curve(self):
"""Gets the mean and standard deviation of the QuAC curve"""
# TODO Cache the results, takes forever otherwise
plot_values = []
for normalized_mask_sizes, score_changes in zip(
self.normalized_mask_sizes, self.score_changes
Expand Down

0 comments on commit de3b5a5

Please sign in to comment.