SINTEF / Splipy

Spline modelling made easy.
GNU General Public License v3.0
100 stars 18 forks source link

Numpy print is version dependent, breaking tests #51

Closed VikingScientist closed 6 years ago

VikingScientist commented 6 years ago

In the below setup I have numpy version 1.13.3 installed for python2 and numpy version 1.14.0 installed for python3

(splipymin) [kjetijo@kjetijo-laptop:geomodeler]$ py2.test splipy/basis_test.py 
======================================================================================= test session starts =======================================================================================
platform linux2 -- Python 2.7.12, pytest-3.0.5, py-1.4.32, pluggy-0.4.0
rootdir: /home/kjetijo/Documents/Projects/geomodeler, inifile: setup.cfg
collected 16 items 

splipy/basis_test.py ................

==================================================================================== 16 passed in 0.14 seconds ====================================================================================
(splipymin) [kjetijo@kjetijo-laptop:geomodeler]$ py3.test splipy/basis_test.py 
======================================================================================= test session starts =======================================================================================
platform linux -- Python 3.5.2, pytest-3.1.2, py-1.4.34, pluggy-0.4.0
rootdir: /home/kjetijo/Documents/Projects/geomodeler, inifile: setup.cfg
collected 16 items 

splipy/basis_test.py ...........F....

============================================================================================ FAILURES =============================================================================================
_______________________________________________________________________________________ TestBasis.test_repr _______________________________________________________________________________________

self = <splipy.basis_test.TestBasis testMethod=test_repr>

    def test_repr(self):
>       self.assertEqual(repr(BSplineBasis()), 'p=2, [ 0.  0.  1.  1.]')
E       AssertionError: 'p=2, [0. 0. 1. 1.]' != 'p=2, [ 0.  0.  1.  1.]'
E       - p=2, [0. 0. 1. 1.]
E       + p=2, [ 0.  0.  1.  1.]
E       ?       +   +   +  +

splipy/basis_test.py:106: AssertionError
=============================================================================== 1 failed, 15 passed in 0.25 seconds ===============================================================================
VikingScientist commented 6 years ago

I'm also getting einsum errors for numpy v.1.14 on the following test in TestSurfaceFactory.test_edge_curves

    @unittest.skipIf(not has_nutils, "EdgeCurves with poisson solver requires nutils")
    def test_edgecurves(self):
        # create an arrow-like 2D geometry with the pointy end at (-1,1) towards up and left
        # rebuild to avoid rational representations
        c1 = CurveFactory.circle_segment(pi / 2).rebuild(3,11)
        c2 = Curve(BSplineBasis(2, [0, 0, 1, 2, 2]), [[0, 1], [-1, 1], [-1, 0]])
        c3 = CurveFactory.circle_segment(pi / 2).rebuild(3,11)
        c3.rotate(pi)
        c4 = Curve(BSplineBasis(2), [[0, -1], [1, 0]]).rebuild(3,10)
        c4 = c4.rebuild(4,11)

>       surf = SurfaceFactory.edge_curves([c1, c2, c3, c4], type='poisson')