Skip to content

Commit

Permalink
Predictor test
Browse files Browse the repository at this point in the history
  • Loading branch information
teubert committed Nov 8, 2024
1 parent 1f676d3 commit 3a3c461
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_predictors.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def test_UTP_ThrownObject(self):
self.assertAlmostEqual(results.time_of_event.mean['falling'], 4.15, 0)
# self.assertAlmostEqual(mc_results.times[-1], 9, 1) # Saving every second, last time should be around the 1s after impact event (because one of the sigma points fails afterwards)

# Test setting dt at class level (otherwise default of 1 will be used and this wont work)
pred['dt'] = 0.01
results = pred.predict(samples, save_freq=1)
self.assertAlmostEqual(results.time_of_event.mean['impact'], 8.21, 0)
self.assertAlmostEqual(results.time_of_event.mean['falling'], 4.15, 0)

# Setting event manually
results = pred.predict(samples, dt=0.01, save_freq=1, events=['falling'])
self.assertAlmostEqual(results.time_of_event.mean['falling'], 3.8, 5)
Expand Down

0 comments on commit 3a3c461

Please sign in to comment.