Skip to content

Commit

Permalink
restructure setup extras, make mpl, scipy optional
Browse files Browse the repository at this point in the history
  • Loading branch information
joostvanzwieten committed Nov 28, 2018
1 parent fba8169 commit 6232234
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Expand Up @@ -6,7 +6,7 @@ environment:
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36-x64"
install:
- "%PYTHON%\\python.exe -m pip install --upgrade .[test,mkl] coverage codecov"
- "%PYTHON%\\python.exe -m pip install --upgrade .[docs,matrix_scipy,matrix_mkl,export_mpl] coverage codecov"
build: off
test_script:
- "%PYTHON%\\python.exe -m coverage run -m unittest -b"
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -19,7 +19,7 @@ matrix:
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O python.pkg "$PYTHON_PKG_URL"; sudo installer -pkg python.pkg -target /; rm python.pkg; fi
install:
- python3 -m pip install --upgrade .[test,mkl] coverage codecov $FORCE_PYTHON_PKGS
- python3 -m pip install --upgrade .[docs,matrix_scipy,matrix_mkl,export_mpl] coverage codecov $FORCE_PYTHON_PKGS
script:
- python3 -m coverage run -m unittest -b
after_success:
Expand Down
3 changes: 3 additions & 0 deletions examples/adaptivity.py
Expand Up @@ -89,6 +89,7 @@ def main(etype: 'type of elements (square/triangle/mixed)' = 'square',

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_square_quadratic(self):
ndofs, error, rate, lhs = main(nrefine=2, etype='square', degree=2)
self.assertEqual(ndofs, 149)
Expand All @@ -101,6 +102,7 @@ def test_square_quadratic(self):
'+qV92kKevjK36ozDP/FSnh1iteWiqWuf+oMaKuyKaC1i52rKPokiF2WLA/20bya+ZCPbWKRPpv'
'gFaedebw==')

@nutils.testing.requires('matplotlib')
def test_triangle_quadratic(self):
ndofs, error, rate, lhs = main(nrefine=2, etype='triangle', degree=2)
self.assertEqual(ndofs, 98)
Expand All @@ -111,6 +113,7 @@ def test_triangle_quadratic(self):
'MiXH+LXRR9NwoPkg82xN5IB2MZu2mGabSBnnAbGscYEJj3GVYQAQg/TVGfaA7RI0BsErRjeNeo'
'wDgDQPmF9gkmciaJxtArGjzrAKCGWNpYAQAL0kOBE=')

@nutils.testing.requires('matplotlib')
def test_mixed_linear(self):
ndofs, error, rate, lhs = main(nrefine=2, etype='mixed', degree=1)
self.assertEqual(ndofs, 34)
Expand Down
3 changes: 3 additions & 0 deletions examples/burgers.py
Expand Up @@ -60,16 +60,19 @@ def main(nelems: 'number of elements' = 20,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_1d_p1(self):
lhs = main(ndims=1, nelems=10, timescale=.1, degree=1, endtime=.01)
nutils.numeric.assert_allclose64(lhs, 'eNrbocann6u3yqjTyMLUwfSw2TWzKPNM8+9mH8wyTMNNZxptMir'
'W49ffpwYAI6cOVA==')

@nutils.testing.requires('matplotlib')
def test_1d_p2(self):
lhs = main(ndims=1, nelems=10, timescale=.1, degree=2, endtime=.01)
nutils.numeric.assert_allclose64(lhs, 'eNrr0c7SrtWfrD/d4JHRE6Ofxj6mnqaKZofNDpjZmQeYB5pHmL8'
'we23mb5ZvWmjKY/LV6KPRFIMZ+o368dp92gCxZxZG')

@nutils.testing.requires('matplotlib')
def test_2d_p1(self):
lhs = main(ndims=2, nelems=4, timescale=.1, degree=1, endtime=.01)
nutils.numeric.assert_allclose64(lhs, 'eNoNyKENhEAQRuGEQsCv2SEzyQZHDbRACdsDJNsBjqBxSBxBHIg'
Expand Down
3 changes: 3 additions & 0 deletions examples/cahnhilliard.py
Expand Up @@ -95,6 +95,7 @@ def _checkrand(self, lhs0):
'xTJdjQ5yjEwWjX3MTk2n8kwNMbKTsoay1DMWDC8ycM1eTQyyb42NzdKNmLN5skSNs/LXDbnMuw'
'19DNKNREtGTfui1ut')

@nutils.testing.requires('matplotlib')
def test_square(self):
lhs0, lhs = main(nelems=3, timestep=1, mtol=.1)
self._checkrand(lhs0)
Expand All @@ -103,6 +104,7 @@ def test_square(self):
'J01Pmp9MMY0y/WIYCOSZn7Q82XCi8UTXiSkn5pxYBISovJYTrSd6T0wD8xae6ATCCSemn5gLlu'
'sFwiknZp9YcGIpEE4Ewhkn5p1YfGIFEKLyAN6wcSE=')

@nutils.testing.requires('matplotlib')
def test_contactangle(self):
lhs0, lhs = main(nelems=3, timestep=1, mtol=.1, contactangle=45)
self._checkrand(lhs0)
Expand All @@ -112,6 +114,7 @@ def test_contactangle(self):
'Mmz4CwzqTeZLbJNpOzJo+AcIrJVJO1JkdMbpi8BsLlJitM9gHNeGLy2eQLkLfSZL/JFZOnJl+B'
'EAAJrlyi')

@nutils.testing.requires('matplotlib')
def test_mixedcircle(self):
lhs0, lhs = main(nelems=3, timestep=1, mtol=.1, circle=True, etype='mixed')
self._checkrand(lhs0)
Expand Down
5 changes: 4 additions & 1 deletion examples/cylinderflow.py
Expand Up @@ -7,7 +7,7 @@
# exponentially with radius such that the artificial exterior boundary is
# placed at large (configurable) distance.

import nutils, numpy, matplotlib.collections
import nutils, numpy

# The main function defines the parameter space for the script. Configurable
# parameters are the mesh density (in number of elements along the cylinder
Expand Down Expand Up @@ -81,6 +81,7 @@ def main(nelems: 'number of elements' = 24,
with nutils.export.mplfigure('flow.jpg', figsize=(12.8,7.2)) as fig:
ax = fig.add_axes([0,0,1,1], yticks=[], xticks=[], frame_on=False, xlim=bbox[0], ylim=bbox[1])
im = ax.tripcolor(x[:,0], x[:,1], bezier.tri, p, shading='gouraud', cmap='jet')
import matplotlib.collections
ax.add_collection(matplotlib.collections.LineCollection(x[bezier.hull], colors='k', linewidths=.1, alpha=.5))
ax.quiver(xgrd[:,0], xgrd[:,1], ugrd[:,0], ugrd[:,1], angles='xy', width=1e-3, headwidth=3e3, headlength=5e3, headaxislength=2e3, zorder=9, alpha=.5)
ax.plot(0, 0, 'k', marker=(3,2,t*rotation*180/numpy.pi-90), markersize=20)
Expand Down Expand Up @@ -109,6 +110,7 @@ def main(nelems: 'number of elements' = 24,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib', 'scipy')
def test_rot0(self):
lhs0, lhs = main(nelems=6, reynolds=100, timestep=.1, endtime=.05, rotation=0)
nutils.numeric.assert_allclose64(lhs0, 'eNqtjD8OwWAcQJ/JNSQ20Tbf135RkUjEZO8RJ'
Expand All @@ -121,6 +123,7 @@ def test_rot0(self):
'Y+sMfJwavBhDNPPvbFV8cxOKk3ADtFOFI86zqjN9o8D8hcNFjCfsXVPd47Vj/qPdZBa0F5QUZD'
'7UEJQYi527zjROVETUeVRfZIfrfvRKZKs7s6SVXLZ9k=')

@nutils.testing.requires('matplotlib', 'scipy')
def test_rot1(self):
lhs0, lhs = main(nelems=6, reynolds=100, timestep=.1, endtime=.05, rotation=1)
nutils.numeric.assert_allclose64(lhs0, 'eNqtjD8OwWAcQJ/JNSQ20Tbf135RkUjEZO8RJ'
Expand Down
5 changes: 4 additions & 1 deletion examples/drivencavity-compatible.py
Expand Up @@ -9,7 +9,7 @@
# uses the Raviart-Thomas discretization providing compatible velocity and
# pressure spaces resulting in a pointwise divergence-free velocity field.

import nutils, numpy, matplotlib.collections
import nutils, numpy

# The main function defines the parameter space for the script. Configurable
# parameters are the mesh density (in number of elements along an edge),
Expand Down Expand Up @@ -71,6 +71,7 @@ def postprocess(domain, ns, every=.05, spacing=.01, **arguments):
x, u, p, stream = bezier.eval(['x_i', 'sqrt(u_i u_i)', 'p', 'stream'] @ ns, **arguments)
with nutils.export.mplfigure('flow.jpg') as fig: # plot velocity as field, pressure as contours, streamlines as dashed
ax = fig.add_axes([.1,.1,.8,.8], yticks=[], aspect='equal')
import matplotlib.collections
ax.add_collection(matplotlib.collections.LineCollection(x[bezier.hull], colors='w', linewidths=.5, alpha=.2))
ax.tricontour(x[:,0], x[:,1], bezier.tri, stream, 16, colors='k', linestyles='dotted', linewidths=.5, zorder=9)
caxu = fig.add_axes([.1,.1,.03,.8], title='velocity')
Expand All @@ -97,13 +98,15 @@ def postprocess(domain, ns, every=.05, spacing=.01, **arguments):

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_p1(self):
lhs0, lhs1 = main(nelems=3, reynolds=100, degree=2)
nutils.numeric.assert_allclose64(lhs0, 'eNpTvPBI3/o0t1mzds/pltM65opQ/n196QvcZh4XO03MTHbolZ'
'8+dVrxwlP9rycVL03Xjbm45tQfrZc37M/LGLBcFVc/aPDk/H3dzEtL9EJMGRgAJt4mPA==')
nutils.numeric.assert_allclose64(lhs1, 'eNoBUgCt/6nOuTGJy4M1SCzJy4zLCjcsLk3PCst/Nlcx9M2DNe'
'DPgDR+NB7UG8wVzSwuPc6ByezUQiudMKTL/y4AL73NLS6jLUov8s4zzXoscdMJMSo2AABO+yTF')

@nutils.testing.requires('matplotlib')
def test_p2(self):
lhs0, lhs1 = main(nelems=3, reynolds=100, degree=3)
nutils.numeric.assert_allclose64(lhs0, 'eNp7ZmB71sY46VSq2dLzludvnMo20jFHsJ7BZaXObzbedDrVbJ'
Expand Down
5 changes: 4 additions & 1 deletion examples/drivencavity.py
Expand Up @@ -5,7 +5,7 @@
# bottom and right boundaries and a top boundary that is moving at unit
# velocity in positive x-direction.

import nutils, numpy, matplotlib.collections
import nutils, numpy

# The main function defines the parameter space for the script. Configurable
# parameters are the mesh density (in number of elements along an edge),
Expand Down Expand Up @@ -67,6 +67,7 @@ def postprocess(domain, ns, every=.05, spacing=.01, **arguments):
x, u, p, stream = bezier.eval(['x_i', 'sqrt(u_k u_k)', 'p', 'stream'] @ ns, **arguments)
with nutils.export.mplfigure('flow.jpg') as fig: # plot velocity as field, pressure as contours, streamlines as dashed
ax = fig.add_axes([.1,.1,.8,.8], yticks=[], aspect='equal')
import matplotlib.collections
ax.add_collection(matplotlib.collections.LineCollection(x[bezier.hull], colors='w', linewidths=.5, alpha=.2))
ax.tricontour(x[:,0], x[:,1], bezier.tri, stream, 16, colors='k', linestyles='dotted', linewidths=.5, zorder=9)
caxu = fig.add_axes([.1,.1,.03,.8], title='velocity')
Expand All @@ -92,6 +93,7 @@ def postprocess(domain, ns, every=.05, spacing=.01, **arguments):

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_square(self):
lhs0, lhs1 = main(nelems=3, etype='square', reynolds=100, degree=3)
nutils.numeric.assert_allclose64(lhs0, 'eNp1zj1IQlEUB/BrCJKEQxLRFNFQxvN1vTcpo'
Expand All @@ -110,6 +112,7 @@ def test_square(self):
'chLfnV63yLT/Pd2CKLXqfadsL9DmGmLeruPPl42diN/44jyV8wBuMogvteIe827MYxwTWkMOiK'
'1k8QxrTbl9xZQpPMIzn2EDR3cgjg5dYxzYKKIHjDzbx252sY9mdHuKHaRj/AYh1yFc=')

@nutils.testing.requires('matplotlib')
def test_mixed(self):
lhs0, lhs1 = main(nelems=3, etype='mixed', reynolds=100, degree=2)
nutils.numeric.assert_allclose64(lhs0, 'eNpjYICAiRePnWdg0D736SyIF3P2nK6VYSWQH'
Expand Down
4 changes: 4 additions & 0 deletions examples/elasticity.py
Expand Up @@ -60,19 +60,22 @@ def main(nelems: 'number of elements along edge' = 10,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_default(self):
cons, lhs = main(nelems=4)
nutils.numeric.assert_allclose64(cons, 'eNpjYICDBnzwhykMMhCpAwEBQ08XYg==')
nutils.numeric.assert_allclose64(lhs, 'eNpjYICBFGMxYyEgTjFebDLBpB2IF5tkmKaYJg'
'JxhukPOIRrYBA1CjJgYFh3/vXZMiMVQwaGO+e6zvYY2QBZR86VnO2FsorPAgAXLB7S')

@nutils.testing.requires('matplotlib')
def test_mixed(self):
cons, lhs = main(nelems=4, etype='mixed')
nutils.numeric.assert_allclose64(cons, 'eNpjYACCBiBkQMJY4A9TGGQgUgcCAgBVTxdi')
nutils.numeric.assert_allclose64(lhs, 'eNpjYGBgSDKWNwZSQKwExAnGfSbLTdpNek2WmW'
'SYppgmAHGG6Q84BKpk4DASN2Bg2K/JwHDrPAPDj7MqhnlGRddenpt+ts/I0nChyrlzJWcdDbuN'
'YjUOnSs/CwB0uyJb')

@nutils.testing.requires('matplotlib')
def test_quadratic(self):
cons, lhs = main(nelems=4, degree=2)
nutils.numeric.assert_allclose64(cons, 'eNpjYMAADQMJf5iiQ4ZB5kJMCAAkxE4W')
Expand All @@ -82,6 +85,7 @@ def test_quadratic(self):
'Hw4sTzU859PZtldNGQ3XCCPgNDwYWf5/TPTTtbYvTKUNpwP1DE8cLTc2Lnes62Gf01NDW8BxRR'
'unD6HPO5KqjIA6CIAlSkw+ifobnhI6CI3IWT55jOVQBF/hqaGT4EishfOAVUU3EWAA5lcd0=')

@nutils.testing.requires('matplotlib')
def test_poisson(self):
cons, lhs = main(nelems=4, poisson=.4)
nutils.numeric.assert_allclose64(cons, 'eNpjYICDBnzwhykMMhCpAwEBQ08XYg==')
Expand Down
3 changes: 3 additions & 0 deletions examples/finitestrain.py
Expand Up @@ -76,6 +76,7 @@ def main(nelems: 'number of elements along edge' = 10,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_default(self):
lhs0, lhs1 = main(nelems=4, angle=10)
nutils.numeric.assert_allclose64(lhs0, 'eNpjYICB8ku8+icMthvOM+K42G1ga6Rv/Mh42'
Expand All @@ -85,6 +86,7 @@ def test_default(self):
'wxdjAVM2k1uX1A22mjcbaJsCtfAoHz53sXiC27nGc6pnD94Tutc5dlLZyLOSpw9fab4DOsZyTM'
'fTp88vex0y2kA6e4nVQ==')

@nutils.testing.requires('matplotlib')
def test_mixed(self):
lhs0, lhs1 = main(nelems=4, angle=10, etype='mixed')
nutils.numeric.assert_allclose64(lhs0, 'eNoBZACb/wAAAADV0WwvAAChMAAAtjEAAKgyX'
Expand All @@ -94,6 +96,7 @@ def test_mixed(self):
'zGKLIEySDPKM6fS9TFCMwM0mzQjMtvQsTOLNCM1AAAAAD/TYNEAAN7QAAA3zwAACc7SzgnPEc6'
'TzdjMZ80TzdHMa8wXzPDLGczJy6bLhMthnih2')

@nutils.testing.requires('matplotlib')
def test_spline(self):
lhs0, lhs1 = main(nelems=4, angle=10, degree=2, btype='spline')
nutils.numeric.assert_allclose64(lhs0, 'eNpjYECAa1e+aE3Qu6Nfa9BlmHoxU/eHgbIRs'
Expand Down
3 changes: 3 additions & 0 deletions examples/laplace.py
Expand Up @@ -120,6 +120,7 @@ def main(nelems: 'number of elements along edge' = 10,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_default(self):
cons, lhs, err = main(nelems=4, etype='square', btype='std', degree=1)
nutils.numeric.assert_allclose64(cons, 'eNrbKPv1QZ3ip9sL1BgaILDYFMbaZwZj5ZnDW'
Expand All @@ -128,6 +129,7 @@ def test_default(self):
'XyNR82ZTa+NpI2oTbPNhU3bjf7Ngo3ODd+N9c3SNEU1g==')
numpy.testing.assert_almost_equal(err, 1.63e-3, decimal=5)

@nutils.testing.requires('matplotlib')
def test_spline(self):
cons, lhs, err = main(nelems=4, etype='square', btype='spline', degree=2)
nutils.numeric.assert_allclose64(cons, 'eNqrkmN+sEfhzF0xleRbDA0wKGeCYFuaIdjK5'
Expand All @@ -136,6 +138,7 @@ def test_spline(self):
'gmmNaZ7jBlN7M08wLCDLNFZh/NlM0vmV0y+2CmZV5pvtr8j9kfMynzEPPF5lfNAcuhGvs=')
numpy.testing.assert_almost_equal(err, 8.04e-5, decimal=7)

@nutils.testing.requires('matplotlib')
def test_mixed(self):
cons, lhs, err = main(nelems=4, etype='mixed', btype='std', degree=2)
nutils.numeric.assert_allclose64(cons, 'eNorfLZF2ucJQwMC3pR7+QDG9lCquAtj71Rlu'
Expand Down
2 changes: 2 additions & 0 deletions examples/platewithhole-nurbs.py
Expand Up @@ -97,6 +97,7 @@ def main(nrefine = 2,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test0(self):
err, cons, lhs = main(nrefine=0)
nutils.numeric.assert_allclose64(err, 'eNoT1r6hDwACsAFG')
Expand All @@ -105,6 +106,7 @@ def test0(self):
nutils.numeric.assert_allclose64(lhs, 'eNoBMADP/1jZ0DGVM5YzzSjfL2kzqDMz1ygzHj'
'PTM5LOr85F0GgpJc6GzrIuc9Qdzm7Pvc+NKyFrF1c=')

@nutils.testing.requires('matplotlib')
def test2(self):
err, cons, lhs = main(nrefine=2)
nutils.numeric.assert_allclose64(err, 'eNqzUn2kDQADSgFt')
Expand Down
2 changes: 2 additions & 0 deletions examples/platewithhole.py
Expand Up @@ -77,6 +77,7 @@ def main(nelems: 'number of elementsa long edge' = 9,

class test(nutils.testing.TestCase):

@nutils.testing.requires('matplotlib')
def test_spline(self):
err, cons, lhs = main(nelems=4, etype='square', degree=2, btype='spline')
nutils.numeric.assert_allclose64(err, 'eNpbpd6jCwAEZgGL')
Expand All @@ -88,6 +89,7 @@ def test_spline(self):
'zi/OGclHzJfOSs45zjDOOSK7z5fPC8+cznzOBd/D3d3RFdAuz+vO+yGg1bnSvdCoz03Pzdz01a'
'zS3dDLz2zPaQdIRw==')

@nutils.testing.requires('matplotlib')
def test_mixed(self):
err, cons, lhs = main(nelems=4, etype='mixed', degree=2, btype='std')
nutils.numeric.assert_allclose64(err, 'eNpjU9+jCwACNgEX')
Expand Down
1 change: 0 additions & 1 deletion readthedocs.yml
Expand Up @@ -5,4 +5,3 @@ python:
pip_install: true
extra_requirements:
- docs
- readthedocs
13 changes: 5 additions & 8 deletions setup.py
Expand Up @@ -23,8 +23,6 @@
with open(os.path.join('nutils', '__init__.py')) as f:
version = next(filter(None, map(re.compile("^version = '([a-zA-Z0-9.]+)'$").match, f))).group(1)

tests_require = ['Sphinx>=1.6','pillow>2.6']

setup(
name = 'nutils',
version = version,
Expand All @@ -37,13 +35,12 @@
long_description = long_description,
license = 'MIT',
python_requires = '>=3.5',
install_requires = ['numpy>=1.12', 'matplotlib>=1.3', 'scipy>=0.13', 'treelog', 'stickybar'],
tests_require = tests_require,
install_requires = ['numpy>=1.12', 'treelog', 'stickybar'],
extras_require = dict(
test=tests_require,
docs=['Sphinx>=1.6'],
mkl=['mkl'],
readthedocs=['pillow>2.6'],
docs=['Sphinx>=1.6','scipy>=0.13','matplotlib>=1.3','pillow>2.6'],
matrix_scipy=['scipy>=0.13'],
matrix_mkl=['mkl','tbb;platform_system!="Windows"'],
export_mpl=['matplotlib>=1.3','pillow>2.6'],
),
command_options = dict(
test=dict(test_loader=('setup.py', 'unittest:TestLoader')),
Expand Down
1 change: 1 addition & 0 deletions tests/test_export.py
Expand Up @@ -9,6 +9,7 @@ def setUpContext(self, stack):
self.outdir = pathlib.Path(stack.enter_context(tempfile.TemporaryDirectory()))
stack.enter_context(treelog.set(treelog.DataLog(str(self.outdir))))

@nutils.testing.requires('matplotlib', 'PIL')
def test_autodetect_imagetype(self):
for (imagetype, test) in (('jpg', lambda data: self.assertEqual(data[:3], b'\xFF\xD8\xFF')),
('png', lambda data: self.assertEqual(data[:8], b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A')),
Expand Down
5 changes: 3 additions & 2 deletions tests/test_quadrature.py
@@ -1,6 +1,6 @@
from nutils import *
from nutils.testing import *
import scipy.special, re
import math, re


@parametrize
Expand All @@ -17,7 +17,8 @@ def setUp(self):
self.integrals = numpy.reciprocal((self.monomials+1.).prod(-1))
else:
self.ref = element.getsimplex(self.ndims)
self.integrals = scipy.special.gamma(self.monomials+1.).prod(-1) / scipy.special.gamma(self.ndims+1+self.monomials.sum(-1))
gamma = numpy.vectorize(math.gamma)
self.integrals = gamma(self.monomials+1.).prod(-1) / gamma(self.ndims+1+self.monomials.sum(-1))

def test_degree(self):
for degree in range(1, self.maxdegree+1):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_util.py
Expand Up @@ -14,11 +14,13 @@ def setUp(self):
self.x = numpy.array([[0,0],[1,0],[0,1],[1,0],[0,1],[1,1]], dtype=float)
self.tri = numpy.array([[0,1,2],[3,4,5]])

@requires('scipy')
def test_merge(self):
tri_merged = util.tri_merge(self.tri, self.x, mergetol=self.mergetol).tolist()
tri_expected = self.tri.tolist() if self.mergetol < 0 else [[0,1,2],[1,2,5]] if self.mergetol < 1 else [[0,0,0],[0,0,0]]
self.assertEqual(tri_merged, tri_expected)

@requires('matplotlib', 'scipy')
def test_interpolate(self):
interpolate = util.tri_interpolator(self.tri, self.x, mergetol=self.mergetol)
x = [.1, .9],
Expand All @@ -36,6 +38,7 @@ def test_interpolate(self):
self.assertTrue(numpy.isnan(vx).all())

@parametrize.enable_if(lambda mergetol: 0 <= mergetol < 1)
@requires('matplotlib', 'scipy')
def test_outofbounds(self):
interpolate = util.tri_interpolator(self.tri, self.x, mergetol=self.mergetol)
x = [.5, .5], [1.5, .5]
Expand Down

0 comments on commit 6232234

Please sign in to comment.