mirror of
https://github.com/tgorordo/carousel.git
synced 2026-06-14 21:32:14 -07:00
add rich logging
This commit is contained in:
parent
3d3d021023
commit
f69ddba109
2 changed files with 28 additions and 7 deletions
|
|
@ -1,9 +1,18 @@
|
||||||
import rich
|
import logging, rich
|
||||||
|
from rich.logging import RichHandler
|
||||||
|
|
||||||
|
import itertools as it
|
||||||
|
|
||||||
import polars as pl
|
import polars as pl
|
||||||
import polars.selectors as pls
|
import polars.selectors as pls
|
||||||
|
|
||||||
import itertools as it
|
logging.basicConfig(
|
||||||
|
level="NOTSET",
|
||||||
|
format="%(message)s",
|
||||||
|
datefmt="[%X]",
|
||||||
|
handlers=[RichHandler(rich_tracebacks=True, tracebacks_suppress=[pl, pls])],
|
||||||
|
)
|
||||||
|
log = logging.getLogger("rich")
|
||||||
|
|
||||||
|
|
||||||
def rank_to_pref(ranking):
|
def rank_to_pref(ranking):
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,29 @@
|
||||||
import rich
|
import logging, rich
|
||||||
|
from rich.logging import RichHandler
|
||||||
|
|
||||||
import polars as pl
|
import polars as pl
|
||||||
import polars.selectors as pls
|
import polars.selectors as pls
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
rng = np.random.default_rng()
|
|
||||||
|
|
||||||
from polars.testing import assert_frame_equal
|
from polars.testing import assert_frame_equal
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from hypothesis import given, strategies as st
|
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
|
@st.composite
|
||||||
def rankings(draw, names=["a", "b", "c"], choices=["A", "B", "C"]):
|
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
|
return p
|
||||||
|
|
||||||
|
|
||||||
import carousel as crsl
|
|
||||||
|
|
||||||
p = pl.DataFrame({"a": ["A", "C", "B"], "b": ["B", "A", "C"], "c": ["C", "B", "A"]})
|
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]})
|
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