add rich logging

This commit is contained in:
Thomas (Tom) C. Gorordo 2025-04-18 13:47:50 -07:00
parent 3d3d021023
commit f69ddba109
Signed by: tgorordo
GPG key ID: 0CBED22BB0D94490
2 changed files with 28 additions and 7 deletions

View file

@ -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]})