mirror of
https://github.com/tgorordo/carousel.git
synced 2026-06-12 20:42:13 -07:00
init cgi script and html form
This commit is contained in:
parent
740ae98027
commit
5da4a21a3f
9 changed files with 909 additions and 110 deletions
|
|
@ -1,27 +1,14 @@
|
|||
import logging, rich
|
||||
from rich.logging import RichHandler
|
||||
|
||||
import polars as pl
|
||||
import polars.selectors as pls
|
||||
import numpy as np
|
||||
|
||||
from polars.testing import assert_frame_equal
|
||||
|
||||
import pytest
|
||||
import pytest, rich
|
||||
from hypothesis import given, strategies as st
|
||||
|
||||
import carousel as crsl
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
level="NOTSET",
|
||||
format="%(message)s",
|
||||
datefmt="[%X]",
|
||||
handlers=[RichHandler(rich_tracebacks=True, tracebacks_suppress=[np, pl, pls])],
|
||||
)
|
||||
|
||||
log = logging.getLogger("rich")
|
||||
|
||||
rng = np.random.default_rng()
|
||||
|
||||
|
||||
|
|
@ -57,8 +44,6 @@ def test_invalid_pref():
|
|||
|
||||
|
||||
def test_pref_to_rank():
|
||||
rr = crsl.pref_to_rank(p)
|
||||
rich.print(p, rr, r)
|
||||
assert_frame_equal(crsl.pref_to_rank(p), r, check_dtypes=False)
|
||||
|
||||
|
||||
|
|
@ -139,3 +124,12 @@ def test_eg2_isstable():
|
|||
match = pl.DataFrame({"A": ["c"], "B": ["d"], "C": ["a"], "D": ["b"]})
|
||||
|
||||
assert crsl.check_stable(match, ar, rr)
|
||||
|
||||
|
||||
@given(
|
||||
rankings(names=["a", "b", "c", "d"], choices=["A", "B", "C", "D"]),
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue