Skip to content

Commit

Permalink
fix int/float mismatch in np.linspace
Browse files Browse the repository at this point in the history
  • Loading branch information
jwittbrodt committed Apr 13, 2021
1 parent ba33397 commit a926351
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cosmoTransitions/pathDeformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,15 +758,15 @@ def V_lin(x, p0, dp0, V): return V(p0+x*dp0)
xmin = optimize.fmin(V_lin, 0.0, args=(pts[0], dpts[0], V),
xtol=1e-6, disp=0)[0]
if xmin > 0.0: xmin = 0.0
nx = np.ceil(abs(xmin)-.5) + 1
nx = int(np.ceil(abs(xmin)-.5)) + 1
x = np.linspace(xmin, 0, nx)[:, np.newaxis]
pt_ext = pts[0] + x*dpts[0]
pts = np.append(pt_ext, pts[1:], axis=0)
# extend at the end of the path
xmin = optimize.fmin(V_lin, 0.0, args=(pts[-1], dpts[-1], V),
xtol=1e-6, disp=0)[0]
if xmin < 0.0: xmin = 0.0
nx = np.ceil(abs(xmin)-.5) + 1
nx = int(np.ceil(abs(xmin)-.5)) + 1
x = np.linspace(xmin, 0, nx)[::-1, np.newaxis]
pt_ext = pts[-1] + x*dpts[-1]
pts = np.append(pts[:-1], pt_ext, axis=0)
Expand Down
2 changes: 1 addition & 1 deletion cosmoTransitions/tunneling1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ def findProfile(self, xguess=None, xtol=1e-4, phitol=1e-4,
if max_interior_pts > 0:
dx0 = R[1]-R[0]
if R[0] / dx0 <= max_interior_pts:
n = np.ceil(R[0]/dx0)
n = int(np.ceil(R[0]/dx0))
R_int = np.linspace(0, R[0], n+1)[:-1]
else:
n = max_interior_pts
Expand Down

0 comments on commit a926351

Please sign in to comment.