This commit is contained in:
Thomas (Tom) C. Gorordo 2025-12-20 08:08:47 -08:00
parent 6cdc579270
commit cbedbbeb48
12 changed files with 1582 additions and 591 deletions

View file

@ -40,7 +40,7 @@ def test_invalid_pref():
pp = pl.DataFrame(
{"a": ["A", "A", "B"], "b": ["B", "A", "C"], "c": ["C", "B", "A"]}
)
assert crsl.check_valid_pref(pp) is False
assert crsl.check_pref_allunique(pp) is False
def test_pref_to_rank():
@ -51,7 +51,7 @@ def test_invalid_rank():
rr = pl.DataFrame(
{"": ["A", "B", "C"], "a": [1, 1, 2], "b": [2, 1, 3], "c": [3, 2, 1]}
)
assert crsl.check_valid_pref(rr) is False
assert crsl.check_pref_allunique(rr) is False
def test_rank_to_pref():
@ -60,7 +60,7 @@ def test_rank_to_pref():
@given(rankings())
def test_valid_rank(R):
assert crsl.check_valid_rank(R)
assert crsl.check_rank_noties(R)
@given(rankings())
@ -70,7 +70,7 @@ def test_ranks_tofrom_prefs(R):
@given(preferences())
def test_valid_pref(P):
assert crsl.check_valid_pref(P)
assert crsl.check_pref_allunique(P)
@given(preferences())
@ -99,7 +99,7 @@ def test_eg2_unstable():
)
match = pl.DataFrame({"A": ["a"], "B": ["b"], "C": ["c"], "D": ["d"]})
assert crsl.check_unstable(match, ar, rr)
assert crsl.check_match_unstable(match, ar, rr)
def test_eg2_isstable():
@ -123,7 +123,7 @@ def test_eg2_isstable():
)
match = pl.DataFrame({"A": ["c"], "B": ["d"], "C": ["a"], "D": ["b"]})
assert crsl.check_stable(match, ar, rr)
assert crsl.check_match_stable(match, ar, rr)
@given(
@ -131,5 +131,5 @@ def test_eg2_isstable():
rankings(names=["A", "B", "C", "D"], choices=["a", "b", "c", "d"]),
)
def test_defacc_isstable(applicant_rankings, reviewer_rankings):
match = crsl.deferred_acceptance(applicant_rankings, reviewer_rankings)
assert crsl.check_stable(match, applicant_rankings, reviewer_rankings)
match = crsl.matchby_deferred_acceptance(applicant_rankings, reviewer_rankings)
assert crsl.check_match_stable(match, applicant_rankings, reviewer_rankings)