Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykubica committed Oct 29, 2024
1 parent a4f948e commit 35d6e3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_stamp_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def setUp(self):
)

# Insert a single fake object with known parameters.
self.trj = Trajectory(8, 7, 2.0, 1.0, flux=250.0)
self.trj2 = Trajectory(8, 7, 2.0, 1.0, flux=250.0)
self.ds.insert_object(self.trj)

# Make a StampCreator.
self.stamp_creator = StampCreator()

def test_create_stamps(self):
stamps = self.stamp_creator.create_stamps(self.ds.stack, self.trj, 1, True, [])
stamps = self.stamp_creator.create_stamps(self.ds.stack, self.trj2, 1, True, [])
self.assertEqual(len(stamps), self.img_count2)
for i in range(self.img_count2):
self.assertEqual(stamps[i].image.shape, (3, 3))
Expand All @@ -132,7 +132,7 @@ def test_create_stamps(self):

# Check that we can set use_indices to produce only some stamps.
use_times = [False, True, False, True, True, False, False, False, True, False]
stamps = self.stamp_creator.create_stamps(self.ds.stack, self.trj, 1, True, use_times)
stamps = self.stamp_creator.create_stamps(self.ds.stack, self.trj2, 1, True, use_times)
self.assertEqual(len(stamps), np.count_nonzero(use_times))

stamp_count = 0
Expand All @@ -150,7 +150,7 @@ def test_create_stamps(self):

def test_create_variance_stamps(self):
test_trj = Trajectory(8, 7, 1.0, 2.0)
stamps = self.stamp_creator.create_variance_stamps(self.ds.stack, self.trj, 1, [])
stamps = self.stamp_creator.create_variance_stamps(self.ds.stack, self.trj2, 1, [])
self.assertEqual(len(stamps), self.img_count2)
for i in range(self.img_count2):
self.assertEqual(stamps[i].image.shape, (3, 3))
Expand All @@ -163,7 +163,7 @@ def test_create_variance_stamps(self):

# Check that we can set use_indices to produce only some stamps.
use_times = [False, True, False, True, True, False, False, False, True, False]
stamps = self.stamp_creator.create_variance_stamps(self.ds.stack, self.trj, 1, use_times)
stamps = self.stamp_creator.create_variance_stamps(self.ds.stack, self.trj2, 1, use_times)
self.assertEqual(len(stamps), np.count_nonzero(use_times))

stamp_count = 0
Expand Down

0 comments on commit 35d6e3e

Please sign in to comment.