diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-11-05 11:01:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-05 11:01:10 -0700 |
commit | ae7f9a2cb71cccc9d49cd343e238464107397814 (patch) | |
tree | e499e9aca6bd05ac98fa6b7512e2d77ca9121481 | |
parent | 2351cf4976b940eda199f9a17a12bd170d9b326e (diff) | |
parent | f9dc6c2517e0f16c59add724b12fd5632ecc0642 (diff) | |
download | numpy-ae7f9a2cb71cccc9d49cd343e238464107397814.tar.gz |
Merge pull request #17715 from ianthomas23/revert_17654
REV: Revert gh-17654 - f2py incorrectly translates dimension declarations.
-rwxr-xr-x | numpy/f2py/crackfortran.py | 9 | ||||
-rw-r--r-- | numpy/f2py/tests/test_crackfortran.py | 22 |
2 files changed, 0 insertions, 31 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py index 6ff30560d..2e95e4596 100755 --- a/numpy/f2py/crackfortran.py +++ b/numpy/f2py/crackfortran.py @@ -2177,15 +2177,6 @@ def getlincoef(e, xset): # e = a*x+b ; x in xset m1 = re_1.match(ee) c2 = myeval(ee, {}, {}) if (a * 0.5 + b == c and a * 1.5 + b == c2): - # gh-8062: return integers instead of floats if possible. - try: - a = int(a) - except: - pass - try: - b = int(b) - except: - pass return a, b, x except Exception: pass diff --git a/numpy/f2py/tests/test_crackfortran.py b/numpy/f2py/tests/test_crackfortran.py index 96adffc72..735804024 100644 --- a/numpy/f2py/tests/test_crackfortran.py +++ b/numpy/f2py/tests/test_crackfortran.py @@ -86,25 +86,3 @@ class TestPublicPrivate(): assert 'public' not in mod['vars']['a']['attrspec'] assert 'private' not in mod['vars']['seta']['attrspec'] assert 'public' in mod['vars']['seta']['attrspec'] - - -class TestArrayDimCalculation(util.F2PyTest): - # Issue gh-8062. Calculations that occur in the dimensions of fortran - # array declarations should be interpreted by f2py as integers not floats. - # Prior to fix, test fails as generated fortran wrapper does not compile. - code = """ - function test(n, a) - integer, intent(in) :: n - real(8), intent(out) :: a(0:2*n/2) - integer :: test - a(:) = n - test = 1 - endfunction - """ - - def test_issue_8062(self): - for n in (5, 11): - _, a = self.module.test(n) - assert(a.shape == (n+1,)) - assert_array_equal(a, n) - |