# AUTOGENERATED! DO NOT EDIT! File to edit: ../../../notebooks/utils/00_dataset.ipynb.

# %% auto 0
__all__ = ['keep_good_fit', 'unique_events']

# %% ../../../notebooks/utils/00_dataset.ipynb 0
from ..naming import start_col, end_col
import polars as pl

# %% ../../../notebooks/utils/00_dataset.ipynb 1
def keep_good_fit(df: pl.DataFrame, rsquared=0.9):
    return df.filter(pl.col("fit.stat.rsquared") > rsquared)

# %% ../../../notebooks/utils/00_dataset.ipynb 2
def unique_events(df: pl.DataFrame, subset: list[str] = [start_col, end_col]):
    return df.unique(subset=subset)
