mirror of
https://github.com/tgorordo/carousel.git
synced 2026-06-12 20:42:13 -07:00
add rich logging
This commit is contained in:
parent
3d3d021023
commit
f69ddba109
2 changed files with 28 additions and 7 deletions
|
|
@ -1,15 +1,29 @@
|
|||
import rich
|
||||
import logging, rich
|
||||
from rich.logging import RichHandler
|
||||
|
||||
import polars as pl
|
||||
import polars.selectors as pls
|
||||
import numpy as np
|
||||
|
||||
rng = np.random.default_rng()
|
||||
|
||||
from polars.testing import assert_frame_equal
|
||||
|
||||
import pytest
|
||||
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()
|
||||
|
||||
|
||||
@st.composite
|
||||
def rankings(draw, names=["a", "b", "c"], choices=["A", "B", "C"]):
|
||||
|
|
@ -31,8 +45,6 @@ def preferences(draw, names=["a", "b", "c"], choices=["A", "B", "C"]):
|
|||
return p
|
||||
|
||||
|
||||
import carousel as crsl
|
||||
|
||||
p = pl.DataFrame({"a": ["A", "C", "B"], "b": ["B", "A", "C"], "c": ["C", "B", "A"]})
|
||||
r = pl.DataFrame({"": ["A", "B", "C"], "a": [1, 3, 2], "b": [2, 1, 3], "c": [3, 2, 1]})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue