Skip to content

Commit

Permalink
Update tests of simple initiators
Browse files Browse the repository at this point in the history
  • Loading branch information
ekhunter123 committed Jan 26, 2022
1 parent e499b25 commit b6a52b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions stonesoup/initiator/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ class MultiMeasurementInitiator(GaussianInitiator):
Does cause slight delay in initiation to tracker."""

prior_state: GaussianState = Property(doc="Prior state information")
measurement_model: MeasurementModel = Property(
default=None,
doc="Measurement model. Can be left as None if all detections have a "
"valid measurement model.")
deleter: Deleter = Property(doc="Deleter used to delete the track.")
data_associator: DataAssociator = Property(
doc="Association algorithm to pair predictions to detections.")
updater: Updater = Property(
doc="Updater used to update the track object to the new state.")
measurement_model: MeasurementModel = Property(
default=None,
doc="Measurement model. Can be left as None if all detections have a "
"valid measurement model.")
min_points: int = Property(
default=2, doc="Minimum number of track points required to confirm a track.")
updates_only: bool = Property(
Expand Down
5 changes: 3 additions & 2 deletions stonesoup/initiator/tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def test_multi_measurement(updates_only):

measurement_initiator = MultiMeasurementInitiator(
GaussianState([[0], [0], [0], [0]], np.diag([0, 15, 0, 15])),
measurement_model, deleter, data_associator, updater, updates_only=updates_only)
deleter, data_associator, updater,
measurement_model=measurement_model, updates_only=updates_only)

timestamp = datetime.datetime.now()
first_detections = {Detection(np.array([[5], [2]]), timestamp),
Expand Down Expand Up @@ -318,7 +319,7 @@ def test_measurement_model(initiator):
# model. The SimpleMeasurementInitiator will raise an error in the if/else
# blocks.
with pytest.raises(ValueError):
_ = initiator.initiate(dummy_detection, timestamp)
_ = initiator.initiate({dummy_detection}, timestamp)


@pytest.mark.parametrize("gaussian_initiator", [
Expand Down

0 comments on commit b6a52b1

Please sign in to comment.