Skip to content

Commit

Permalink
Merge pull request #465 from nerkulec/fix_test_snapshot
Browse files Browse the repository at this point in the history
Fix ValueError in test_snapshot
  • Loading branch information
RandomDefaultUser authored Aug 4, 2023
2 parents bdb4dca + 5d73999 commit 9da5d7e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mala/network/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ def test_snapshot(self, snapshot_number, data_type='te'):

results = {}
for observable in self.observables_to_test:
results[observable] = self.\
__calculate_observable_error(snapshot_number,
observable, predicted_outputs,
actual_outputs)
try:
results[observable] = self.\
__calculate_observable_error(snapshot_number,
observable, predicted_outputs,
actual_outputs)
except ValueError as e:
printout(f"Error calculating observable: {observable} for snapshot {snapshot_number}", min_verbosity=0)
printout(e, min_verbosity=2)
results[observable] = np.inf
return results

def predict_targets(self, snapshot_number, data_type='te'):
Expand Down

0 comments on commit 9da5d7e

Please sign in to comment.