From c36fe1e6aeff585a04235481591d89cfa1c1f6d3 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 28 Sep 2022 11:47:47 -0700 Subject: [PATCH 1/4] DEPR Enforce ewm.vol deprecation --- pandas/core/window/ewm.py | 11 ----------- pandas/tests/window/test_ewm.py | 8 -------- 2 files changed, 19 deletions(-) diff --git a/pandas/core/window/ewm.py b/pandas/core/window/ewm.py index 6fae119bffdf1..3dfe06bd195bd 100644 --- a/pandas/core/window/ewm.py +++ b/pandas/core/window/ewm.py @@ -677,17 +677,6 @@ def std(self, bias: bool = False, numeric_only: bool = False, *args, **kwargs): ) return zsqrt(self.var(bias=bias, numeric_only=numeric_only, **kwargs)) - def vol(self, bias: bool = False, *args, **kwargs): - warnings.warn( - ( - "vol is deprecated will be removed in a future version. " - "Use std instead." - ), - FutureWarning, - stacklevel=find_stack_level(inspect.currentframe()), - ) - return self.std(bias, *args, **kwargs) - @doc( template_header, create_section_header("Parameters"), diff --git a/pandas/tests/window/test_ewm.py b/pandas/tests/window/test_ewm.py index b524eb5978fa0..5b8dc49ba019f 100644 --- a/pandas/tests/window/test_ewm.py +++ b/pandas/tests/window/test_ewm.py @@ -170,14 +170,6 @@ def test_ewm_getitem_attributes_retained(arg, adjust, ignore_na): assert result == expected -def test_ewm_vol_deprecated(): - ser = Series(range(1)) - with tm.assert_produces_warning(FutureWarning): - result = ser.ewm(com=0.1).vol() - expected = ser.ewm(com=0.1).std() - tm.assert_series_equal(result, expected) - - def test_ewma_times_adjust_false_raises(): # GH 40098 with pytest.raises( From ef0dac4517370b3e632d1e9c2d2d4d31513fa5f4 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:37:24 -0700 Subject: [PATCH 2/4] add whatsnew note --- doc/source/whatsnew/v2.0.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index e57ba92267855..a38d3aec9a567 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -145,6 +145,7 @@ Deprecations Removal of prior version deprecations/changes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Disallow passing non-round floats to :class:`Timestamp` with ``unit="M"`` or ``unit="Y"`` (:issue:`47266`) +- Removed :meth:`core.window.ewm.ExponentialMovingWindow.vol` (:issue:`39220`) - Removed :func:`is_extension_type` in favor of :func:`is_extension_array_dtype` (:issue:`29457`) - Remove :meth:`DataFrameGroupBy.pad` and :meth:`DataFrameGroupBy.backfill` (:issue:`45076`) - Enforced :meth:`Rolling.count` with ``min_periods=None`` to default to the size of the window (:issue:`31302`) From fb7e472580ee0f52511e9a70b255e0ee488c1428 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:01:17 -0700 Subject: [PATCH 3/4] Remove reference to core --- doc/source/whatsnew/v2.0.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 0132cb4d5c697..0c89d5d0f2d2f 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -186,7 +186,7 @@ Removal of prior version deprecations/changes - Removed deprecated :meth:`Timedelta.delta`, :meth:`Timedelta.is_populated`, and :attr:`Timedelta.freq` (:issue:`46430`, :issue:`46476`) - Removed the ``numeric_only`` keyword from :meth:`Categorical.min` and :meth:`Categorical.max` in favor of ``skipna`` (:issue:`48821`) - Removed :func:`is_extension_type` in favor of :func:`is_extension_array_dtype` (:issue:`29457`) -- Removed :meth:`core.window.ewm.ExponentialMovingWindow.vol` (:issue:`39220`) +- Removed ``.ExponentialMovingWindow.vol`` (:issue:`39220`) - Removed :meth:`Index.get_value` (:issue:`33907`) - Remove :meth:`DataFrameGroupBy.pad` and :meth:`DataFrameGroupBy.backfill` (:issue:`45076`) - Remove ``numpy`` argument from :func:`read_json` (:issue:`30636`) From 4194feac1e511c0ce2333a3a817cc05cebac2c1a Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:53:58 -0700 Subject: [PATCH 4/4] Remove unused imports --- pandas/core/window/ewm.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandas/core/window/ewm.py b/pandas/core/window/ewm.py index 5e78e3a6d53c9..9e5437a084695 100644 --- a/pandas/core/window/ewm.py +++ b/pandas/core/window/ewm.py @@ -4,7 +4,6 @@ from functools import partial from textwrap import dedent from typing import TYPE_CHECKING -import warnings import numpy as np @@ -21,7 +20,6 @@ from pandas.compat.numpy import function as nv from pandas.util._decorators import doc -from pandas.util._exceptions import find_stack_level from pandas.core.dtypes.common import ( is_datetime64_ns_dtype,