3
3
from math import sqrt , sin , cos , radians , pi
4
4
import scipy .optimize as optimize
5
5
from scipy .interpolate import bisplrep , bisplev , splev , splrep
6
- from scipy .integrate import simps
6
+ from scipy .integrate import simpson as simps
7
7
from pwtools import _flib
8
8
import warnings
9
9
@@ -87,7 +87,7 @@ def norm_int(y, x, area=1.0, scale=True, func=simps):
87
87
different scales.
88
88
func : callable
89
89
Function to do integration (like scipy.integrate.{simps,trapz,...}
90
- Called as ``func(y,x)``. Default: simps
90
+ Called as ``func(y,x=x )``. Default: simps
91
91
92
92
Returns
93
93
-------
@@ -107,7 +107,7 @@ def norm_int(y, x, area=1.0, scale=True, func=simps):
107
107
fx = fy = 1.0
108
108
sx , sy = x , y
109
109
# Area under unscaled y(x).
110
- _area = func (sy , sx ) * fx * fy
110
+ _area = func (sy , x = sx ) * fx * fy
111
111
return y * area / _area
112
112
113
113
@@ -1097,7 +1097,7 @@ def a2_to_an(self):
1097
1097
a = np .unique (self .a2 [:, colidx ])
1098
1098
axes .append (a )
1099
1099
dims .append (len (a ))
1100
- assert np .product (dims ) == self .a2 .shape [0 ]
1100
+ assert np .prod (dims ) == self .a2 .shape [0 ]
1101
1101
idx = itertools .product (* tuple (map (range , dims )))
1102
1102
an = np .empty (dims , dtype = self .a2 .dtype )
1103
1103
# an[1,2,3] == an[(1,2,3)], need way to eliminate loop over index array
0 commit comments