Skip to content

CLN: remove unnecessary scipy attr checks #30450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions pandas/tests/frame/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
import pandas.util.testing as tm


def _skip_if_no_pchip():
try:
from scipy.interpolate import pchip_interpolate # noqa
except ImportError:
import pytest

pytest.skip("scipy.interpolate.pchip missing")


class TestDataFrameMissingData:
def test_dropEmptyRows(self, float_frame):
N = len(float_frame.index)
Expand Down Expand Up @@ -837,8 +828,6 @@ def test_interp_alt_scipy(self):
expectedk["A"] = expected["A"]
tm.assert_frame_equal(result, expectedk)

_skip_if_no_pchip()

result = df.interpolate(method="pchip")
expected.loc[2, "A"] = 3
expected.loc[5, "A"] = 6.0
Expand Down
24 changes: 2 additions & 22 deletions pandas/tests/series/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@
import pandas.util.testing as tm


def _skip_if_no_pchip():
try:
from scipy.interpolate import pchip_interpolate # noqa
except ImportError:
import pytest

pytest.skip("scipy.interpolate.pchip missing")


def _skip_if_no_akima():
try:
from scipy.interpolate import Akima1DInterpolator # noqa
except ImportError:
import pytest

pytest.skip("scipy.interpolate.Akima1DInterpolator missing")


def _simple_ts(start, end, freq="D"):
rng = date_range(start, end, freq=freq)
return Series(np.random.randn(len(rng)), index=rng)
Expand Down Expand Up @@ -1099,7 +1081,6 @@ def test_interpolate_time_raises_for_non_timeseries(self):

@td.skip_if_no_scipy
def test_interpolate_pchip(self):
_skip_if_no_pchip()

ser = Series(np.sort(np.random.uniform(size=100)))

Expand All @@ -1113,7 +1094,6 @@ def test_interpolate_pchip(self):

@td.skip_if_no_scipy
def test_interpolate_akima(self):
_skip_if_no_akima()

ser = Series([10, 11, 12, 13])

Expand Down Expand Up @@ -1619,7 +1599,7 @@ def test_interp_non_timedelta_index(self, interp_methods_ind, ind):

method, kwargs = interp_methods_ind
if method == "pchip":
_skip_if_no_pchip()
pytest.importorskip("scipy")

if method == "linear":
result = df[0].interpolate(**kwargs)
Expand Down Expand Up @@ -1647,7 +1627,7 @@ def test_interpolate_timedelta_index(self, interp_methods_ind):

method, kwargs = interp_methods_ind
if method == "pchip":
_skip_if_no_pchip()
pytest.importorskip("scipy")

if method in {"linear", "pchip"}:
result = df[0].interpolate(method=method, **kwargs)
Expand Down