Skip to content

Commit

Permalink
Merge pull request #107 from lsst/tickets/PREOPS-4640a
Browse files Browse the repository at this point in the history
tickets/PREOPS-4640a: test result of match_visits_across_sims when there are no matches
  • Loading branch information
ehneilsen authored Sep 25, 2024
2 parents 4460150 + 07f7766 commit 96f0482
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_multisim.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
(0, 0, 1, 2, 2, 2, 4, 4),
(0, 1, 2, 2, 2, 3, 3, 4),
(0, 1, 2, 3, 4, 2, 2, 4),
(0, 1, 3, 4, 4),
(0, 1, 4, 4, 4),
)


Expand Down Expand Up @@ -128,6 +130,18 @@ def test_match_visits_across_sims(self):
assert matched_visits is not None
assert np.isclose(matched_visits.loc[:, "delta"], [-573.278053, -604.849867]).all()

# What if there are no matches?
matched_visits = schedview.compute.multisim.match_visits_across_sims(
start_times.loc[2, :], sim_indexes=(0, 4)
)
assert len(matched_visits) == 0

# What about no visits in either sim?
matched_visits = schedview.compute.multisim.match_visits_across_sims(
start_times.loc[2, :], sim_indexes=(4, 5)
)
assert len(matched_visits) == 0

def test_compute_matched_visit_delta_statistics(self):
matched_visit_stats = schedview.compute.multisim.compute_matched_visit_delta_statistics(self.visits)
assert tuple(matched_visit_stats.index.names) == (
Expand Down

0 comments on commit 96f0482

Please sign in to comment.