Skip to content

Commit

Permalink
scipy required
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Nov 14, 2023
1 parent 0161159 commit 31c05be
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion cf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
)

# Check the version of cfdm
_minimum_vn = "1.11.0.0"
_minimum_vn = "1.11.0.0b2"
_maximum_vn = "1.11.1.0"
_cfdm_version = Version(cfdm.__version__)
if not Version(_minimum_vn) <= _cfdm_version < Version(_maximum_vn):
Expand Down
7 changes: 0 additions & 7 deletions cf/test/test_Field.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import numpy
import numpy as np

from scipy.ndimage import convolve1d

faulthandler.enable() # to debug seg faults and timeouts
Expand Down Expand Up @@ -2318,9 +2317,6 @@ def test_Field_percentile(self):
# TODO: add loop to check get same shape and close enough data
# for every possible axis combo (see also test_Data_percentile).

@unittest.skipIf(
not SCIPY_AVAILABLE, "scipy must be installed for this test."
)
def test_Field_grad_xy(self):
f = cf.example_field(0)

Expand Down Expand Up @@ -2406,9 +2402,6 @@ def test_Field_grad_xy(self):
y.dimension_coordinate("X").standard_name, "longitude"
)

@unittest.skipIf(
not SCIPY_AVAILABLE, "scipy must be installed for this test."
)
def test_Field_laplacian_xy(self):
f = cf.example_field(0)

Expand Down
24 changes: 0 additions & 24 deletions cf/test/test_Maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,12 @@
import faulthandler
import unittest


SCIPY_AVAILABLE = False
try:
# We don't need SciPy directly in this test, it is only required by code
# here which uses 'convolve1d' under-the-hood. Without it installed, get:
#
# NameError: name 'convolve1d' is not defined. Did you
# mean: 'cf_convolve1d'?
import scipy

SCIPY_AVAILABLE = True
# not 'except ImportError' as that can hide nested errors, catch anything:
except Exception:
pass # test with this dependency will then be skipped by unittest

faulthandler.enable() # to debug seg faults and timeouts

import cf


class MathTest(unittest.TestCase):
@unittest.skipIf(
not SCIPY_AVAILABLE, "scipy must be installed for this test."
)
def test_curl_xy(self):
f = cf.example_field(0)

Expand Down Expand Up @@ -115,9 +97,6 @@ def test_curl_xy(self):
c.dimension_coordinate("X").standard_name, "longitude"
)

@unittest.skipIf(
not SCIPY_AVAILABLE, "scipy must be installed for this test."
)
def test_div_xy(self):
f = cf.example_field(0)

Expand Down Expand Up @@ -206,9 +185,6 @@ def test_div_xy(self):
d.dimension_coordinate("X").standard_name, "longitude"
)

@unittest.skipIf(
not SCIPY_AVAILABLE, "scipy must be installed for this test."
)
def test_differential_operators(self):
f = cf.example_field(0)

Expand Down

0 comments on commit 31c05be

Please sign in to comment.