Skip to content

Commit ef2519f

Browse files
Fix AttributeError in HMC bad initial energy warning (#6037)
* Fix AttributeError in HMC bad initial energy warning * Make pre-commit happy
1 parent ad16bf4 commit ef2519f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc/step_methods/hmc/base_hmc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060
t0=10,
6161
adapt_step_size=True,
6262
step_rand=None,
63-
**aesara_kwargs
63+
**aesara_kwargs,
6464
):
6565
"""Set up Hamiltonian samplers with common structures.
6666
@@ -165,7 +165,7 @@ def astep(self, q0):
165165
self.potential.raise_ok(q0.point_map_info)
166166
message_energy = (
167167
"Bad initial energy, check any log probabilities that "
168-
"are inf or -inf, nan or very small:\n{}".format(error_logp.to_string())
168+
f"are inf or -inf, nan or very small:\n{error_logp}"
169169
)
170170
warning = SamplerWarning(
171171
WarningType.BAD_ENERGY,

0 commit comments

Comments
 (0)