hgrecco / pint-pandas

Pandas support for pint
Other
169 stars 42 forks source link

revert test skip introduced for #239 #244

Closed mutricyl closed 1 month ago

mutricyl commented 1 month ago

need to wait for new release of pint after https://github.com/hgrecco/pint/pull/2036

andrewgsavage commented 1 month ago
self = <pint_pandas.testsuite.test_issues.TestIssue80 object at 0x7f1f27ce2440>
reduction = 'min'

    @pytest.mark.parametrize(
        "reduction",
        ["min", "max", "sum", "mean", "median"],
    )
    def test_reductions(self, reduction):
        # before the fix, those reductions could be *very* slow. Fail early.
        for n in [10_000, 1_000_000]:
            s_pint = self._make_df(n)["time"]
            s = self._make_df(n, pint_units=False)["time"]

            tp = self._timeit(getattr(s_pint, reduction)).to("ms")
            t = self._timeit(getattr(s, reduction)).to("ms")

            if t > 0:
>               assert tp <= 5 * t
E               AssertionError: assert <Quantity(3.80[40](https://github.com/hgrecco/pint-pandas/actions/runs/9909151676/job/27376580214?pr=244#step:11:41)94, 'millisecond')> <= (5 * <Quantity(0.648044, 'millisecond')>)

pint_pandas/testsuite/test_issues.py:1[41](https://github.com/hgrecco/pint-pandas/actions/runs/9909151676/job/27376580214?pr=244#step:11:42): AssertionError

Try changing this to 10 * t

>               assert tp <= 5 * t
andrewgsavage commented 1 month ago

very nice, thanks

mutricyl commented 1 month ago

Thanks for your help and swift review/merge. Long journey to get eval to work with pint-pandas!! 😃 need to get some rest now😪 (vacation time for me).