Skip to content

Commit

Permalink
Update to new numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin committed Jun 18, 2024
1 parent 15ef337 commit 2ab3175
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions folie/domains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def Rd(cls, dim):
if dim < 1:
dim = 1
range = np.empty((2, dim))
range[0, :] = -np.infty
range[1, :] = np.infty
range[0, :] = -np.inf
range[1, :] = np.inf
return cls(range)

@classmethod
Expand Down
6 changes: 3 additions & 3 deletions folie/estimation/mle.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def fit(self, data, minimizer=None, coefficients0=None, use_jac=True, callback=N
do_init = not (self.warm_start and hasattr(self, "converged_"))
n_init = self.n_init if do_init else 1

max_lower_bound = -np.infty
max_lower_bound = -np.inf
self.converged_ = False

# That becomes duplicate of callback
Expand All @@ -200,8 +200,8 @@ def fit(self, data, minimizer=None, coefficients0=None, use_jac=True, callback=N
mu0 = np.zeros(self.model.dim_h)
sig0 = np.identity(self.model.dim_h)
self._print_verbose_msg_init_beg(init)
lower_bound = -np.infty if do_init else self.lower_bound_
lower_bound_m_step = -np.infty
lower_bound = -np.inf if do_init else self.lower_bound_
lower_bound_m_step = -np.inf
# Algorithm loop
for n_iter in range(1, self.max_iter + 1):
prev_lower_bound = lower_bound
Expand Down
4 changes: 2 additions & 2 deletions folie/simulations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _bias(self, xt):


class ABMD_Simulator(BiasedSimulator):
def __init__(self, stepper, dt, k=1, xstop=np.infty, **kwargs):
def __init__(self, stepper, dt, k=1, xstop=np.inf, **kwargs):
super().__init__(stepper, dt, **kwargs)
self.xmax = None
self.k = k
Expand All @@ -106,7 +106,7 @@ def _bias(self, xt):


class ABMD_2D_to_1DColvar_Simulator(BiasedSimulator): # user must provide both colvar function and its gradient in colvar element
def __init__(self, stepper, dt, colvar, k=1, qstop=np.infty, **kwargs):
def __init__(self, stepper, dt, colvar, k=1, qstop=np.inf, **kwargs):
super().__init__(stepper, dt, **kwargs)
self.qmax = None
self.k = k
Expand Down

0 comments on commit 2ab3175

Please sign in to comment.