Skip to content

Commit 618313e

Browse files
np.math.factorial deprecated with numpy 2
1 parent 2302f11 commit 618313e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/xspline/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# utility functions for the bsplinex class
2+
import math
23
import numpy as np
34

45

@@ -154,7 +155,7 @@ def constant_if(a, x, order, c):
154155
else:
155156
return 0.0
156157

157-
return c*(x - a)**order/np.math.factorial(order)
158+
return c*(x - a)**order/math.factorial(order)
158159

159160

160161
def linear_if(a, x, order, z, fz, dfz):
@@ -239,7 +240,7 @@ def integrate_across_pieces(a, x, order, funcs, knots):
239240
val = integrate_across_pieces(b, x, order, funcs[1:], knots[1:])
240241

241242
for j in range(order):
242-
val += funcs[0](a, b, order - j)*(x - b)**j / np.math.factorial(j)
243+
val += funcs[0](a, b, order - j)*(x - b)**j / math.factorial(j)
243244

244245
return val
245246

0 commit comments

Comments
 (0)