Skip to content

Commit 96e63aa

Browse files
committed
Add new module numpy.f2py.symbolic
1 parent d721e67 commit 96e63aa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

numpy/f2py/crackfortran.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
# As the needed functions cannot be determined by static inspection of the
154154
# code, it is safest to use import * pending a major refactoring of f2py.
155155
from .auxfuncs import *
156-
from .symbolic import Expr, Language
157156
from . import symbolic
158157

159158
f2py_version = __version__.version
@@ -2578,9 +2577,9 @@ def analyzevars(block):
25782577
if len(dl) == 1 and dl[0] != star:
25792578
dl = ['1', dl[0]]
25802579
if len(dl) == 2:
2581-
d1, d2 = map(Expr.parse, dl)
2580+
d1, d2 = map(symbolic.Expr.parse, dl)
25822581
dsize = d2 - d1 + 1
2583-
d = dsize.tostring(language=Language.C)
2582+
d = dsize.tostring(language=symbolic.Language.C)
25842583
# find variables v that define d as a linear
25852584
# function, `d == a * v + b`, and store
25862585
# coefficients a and b for further analysis.
@@ -2674,7 +2673,8 @@ def analyzevars(block):
26742673
is_required = False
26752674
init = solver(symbolic.as_symbol(
26762675
f'shape({n}, {i})'))
2677-
init = init.tostring(language=Language.C)
2676+
init = init.tostring(
2677+
language=symbolic.Language.C)
26782678
vars[v]['='] = init
26792679
# n needs to be initialzed before v. So,
26802680
# making v dependent on n and on any

numpy/tests/test_public_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ def test_NPY_NO_EXPORT():
253253
"f2py.f90mod_rules",
254254
"f2py.func2subr",
255255
"f2py.rules",
256+
"f2py.symbolic",
256257
"f2py.use_rules",
257258
"fft.helper",
258259
"lib.arraypad",

0 commit comments

Comments
 (0)