From 93f7f597da1a6e2fcc02a7e2628aa22792dc084e Mon Sep 17 00:00:00 2001 From: Tim Mensinger Date: Wed, 13 Mar 2024 15:16:02 +0100 Subject: [PATCH] Suppress pandas PerformanceWarnings --- pyproject.toml | 1 - src/estimagic/visualization/estimation_table.py | 2 +- tests/visualization/test_estimation_table.py | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ad7f7a157..c224f2557 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,6 @@ infer_latex_dependencies = true filterwarnings = [ "ignore:Using or importing the ABCs from 'collections'", "ignore:the imp module is deprecated", - "ignore:indexing past lexsort depth may impact performance.", "ignore:Method .ptp is deprecated and will be removed in a future version. Use numpy.ptp instead.", "ignore:In a future version of pandas all arguments of concat except for the argument 'objs' will be keyword-only", "ignore:Please use `MemoizeJac` from the `scipy.optimize` namespace", diff --git a/src/estimagic/visualization/estimation_table.py b/src/estimagic/visualization/estimation_table.py index 39dcdd6a3..d122b8939 100644 --- a/src/estimagic/visualization/estimation_table.py +++ b/src/estimagic/visualization/estimation_table.py @@ -13,7 +13,6 @@ suppress_performance_warnings.filter(category=pd.errors.PerformanceWarning) -@suppress_performance_warnings def estimation_table( models, *, @@ -229,6 +228,7 @@ def estimation_table( return_type.write_text(out) +@suppress_performance_warnings def render_latex( body, footer, diff --git a/tests/visualization/test_estimation_table.py b/tests/visualization/test_estimation_table.py index eb28da4e6..c294db3f1 100644 --- a/tests/visualization/test_estimation_table.py +++ b/tests/visualization/test_estimation_table.py @@ -136,6 +136,7 @@ def test_estimation_table(): PARAMETRIZATION += [("html", render_html, models) for models in MODELS] +@pytest.mark.filterwarnings("error:indexing past lexsort depth may impact performance.") @pytest.mark.parametrize("return_type, render_func,models", PARAMETRIZATION) def test_one_and_stage_rendering_are_equal(return_type, render_func, models): first_stage = estimation_table(