Skip to content

Commit 83e42c8

Browse files
committed
Undo implicit conversion
1 parent ca9199a commit 83e42c8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

probdiffeq/probdiffeq.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ def __init__(
15141514
)
15151515
self.increase_init_damp_by_eps = increase_init_damp_by_eps
15161516

1517-
def init(self, t, u: TaylorCoeffTarget, *, damp: float) -> ProbabilisticSolution:
1517+
def init(self, t, u: TaylorCoeffTarget, *, damp) -> ProbabilisticSolution:
15181518
estimate, prediction = self.strategy.init_posterior(u=u)
15191519
correction_state = self.constraint.init_linearization()
15201520

@@ -1525,7 +1525,7 @@ def init(self, t, u: TaylorCoeffTarget, *, damp: float) -> ProbabilisticSolution
15251525
# in which case the correction below would yield NaNs.
15261526
if self.increase_init_damp_by_eps:
15271527
damp = np.asarray(damp)
1528-
damp = damp + np.finfo_eps(damp)
1528+
damp = damp + np.finfo_eps(damp.dtype)
15291529

15301530
# Update
15311531
f_wrapped = func.partial(self.vector_field, t=t)
@@ -1658,7 +1658,7 @@ def init(self, t, u, *, damp) -> ProbabilisticSolution:
16581658
# in which case the correction below would yield NaNs.
16591659
if self.increase_init_damp_by_eps:
16601660
damp = np.asarray(damp)
1661-
damp = damp + np.finfo_eps(damp)
1661+
damp = damp + np.finfo_eps(damp.dtype)
16621662

16631663
f_wrapped = func.partial(self.vector_field, t=t)
16641664
fx, lin_state = self.constraint.linearize(
@@ -1785,9 +1785,7 @@ def __init__(
17851785
)
17861786
self.increase_init_damp_by_eps = increase_init_damp_by_eps
17871787

1788-
def init(
1789-
self, t: Array, u: TaylorCoeffTarget, *, damp: float
1790-
) -> ProbabilisticSolution:
1788+
def init(self, t: Array, u: TaylorCoeffTarget, *, damp) -> ProbabilisticSolution:
17911789
u, prediction = self.strategy.init_posterior(u=u)
17921790

17931791
correction_state = self.constraint.init_linearization()
@@ -1797,7 +1795,7 @@ def init(
17971795
# in which case the correction below would yield NaNs.
17981796
if self.increase_init_damp_by_eps:
17991797
damp = np.asarray(damp)
1800-
damp = damp + np.finfo_eps(damp)
1798+
damp = damp + np.finfo_eps(damp.dtype)
18011799

18021800
f_wrapped = func.partial(self.vector_field, t=t)
18031801
fx, correction_state = self.constraint.linearize(

0 commit comments

Comments
 (0)