Skip to content

Commit 2f077b9

Browse files
committed
Define derivative() instead of using now-deprecated scipy function
1 parent a127b86 commit 2f077b9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

t2grids.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,6 @@ def minc(self, volume_fractions, spacing = 50., num_fracture_planes = 1,
10031003
else:
10041004

10051005
from scipy.optimize import bisect
1006-
from scipy.misc import derivative
10071006
from numbers import Number
10081007

10091008
volume_fractions = np.array(volume_fractions, dtype = float64)
@@ -1071,6 +1070,9 @@ def inner_dist(x):
10711070
volsum[-1] = 1. - delta
10721071
xl, xr = 0., volume_fractions[1] / a[0]
10731072

1073+
def derivative(f, x, dx):
1074+
return (f(x + dx) - f(x - dx)) / (2 * dx)
1075+
10741076
for vs in volsum:
10751077
xm, xr = invert_proximity(vs, xl, xr)
10761078
if xm is None:

0 commit comments

Comments
 (0)