Skip to content

Commit 5ee6682

Browse files
committed
Replaced old-style with new-style formatting
1 parent 7f5a165 commit 5ee6682

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

pymc3/distributions/continuous.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _repr_latex_(self, name=None, dist=None):
158158
dist = self
159159
lower = dist.lower
160160
upper = dist.upper
161-
return r'$%s \sim \text{Uniform}(\mathit{lower}=%s, \mathit{upper}=%s)$' % (name,
161+
return r'${} \sim \text{{Uniform}}(\mathit{{lower}}={}, \mathit{{upper}}={})$'.format(name,
162162
get_variable_name(lower),
163163
get_variable_name(upper))
164164

@@ -182,7 +182,7 @@ def logp(self, value):
182182
def _repr_latex_(self, name=None, dist=None):
183183
if dist is None:
184184
dist = self
185-
return r'$%s \sim \text{Flat}()$'
185+
return r'${} \sim \text{{Flat}()$'
186186

187187

188188
class Normal(Continuous):
@@ -252,7 +252,7 @@ def _repr_latex_(self, name=None, dist=None):
252252
dist = self
253253
sd = dist.sd
254254
mu = dist.mu
255-
return r'$%s \sim \text{Normal}(\mathit{mu}=%s, \mathit{sd}=%s)$' % (name,
255+
return r'${} \sim \text{{Normal}}(\mathit{{mu}}={}, \mathit{{sd}}={})$'.format(name,
256256
get_variable_name(mu),
257257
get_variable_name(sd))
258258

@@ -311,7 +311,7 @@ def _repr_latex_(self, name=None, dist=None):
311311
if dist is None:
312312
dist = self
313313
sd = dist.sd
314-
return r'$%s \sim \text{HalfNormal}(\mathit{sd}=%s)$' % (name,
314+
return r'${} \sim \text{{HalfNormal}}(\mathit{{sd}}={})$'.format(name,
315315
get_variable_name(sd))
316316

317317
class Wald(PositiveContinuous):
@@ -440,7 +440,7 @@ def _repr_latex_(self, name=None, dist=None):
440440
lam = dist.lam
441441
mu = dist.mu
442442
alpha = dist.alpha
443-
return r'$%s \sim \text{Wald}(\mathit{mu}=%s, \mathit{lam}=%s, \mathit{alpha}=%s)$' % (name,
443+
return r'${} \sim \text{{Wald}}(\mathit{{mu}}={}, \mathit{{lam}}={}, \mathit{{alpha}}={})$'.format(name,
444444
get_variable_name(mu),
445445
get_variable_name(lam),
446446
get_variable_name(alpha))
@@ -538,7 +538,7 @@ def _repr_latex_(self, name=None, dist=None):
538538
dist = self
539539
alpha = dist.alpha
540540
beta = dist.beta
541-
return r'$%s \sim \text{Beta}(\mathit{alpha}=%s, \mathit{alpha}=%s)$' % (name,
541+
return r'${} \sim \text{{Beta}}(\mathit{{alpha}}={}, \mathit{{alpha}}={})$'.format(name,
542542
get_variable_name(alpha),
543543
get_variable_name(beta))
544544

@@ -588,7 +588,7 @@ def _repr_latex_(self, name=None, dist=None):
588588
if dist is None:
589589
dist = self
590590
lam = dist.lam
591-
return r'$%s \sim \text{Exponential}(\mathit{lam}=%s)$' % (name,
591+
return r'${} \sim \text{{Exponential}}(\mathit{{lam}}={})$'.format(name,
592592
get_variable_name(lam))
593593

594594
class Laplace(Continuous):
@@ -640,7 +640,7 @@ def _repr_latex_(self, name=None, dist=None):
640640
dist = self
641641
b = dist.b
642642
mu = dist.mu
643-
return r'$%s \sim \text{Laplace}(\mathit{mu}=%s, \mathit{b}=%s)$' % (name,
643+
return r'${} \sim \text{{Laplace}}(\mathit{{mu}}={}, \mathit{{b}}={})$'.format(name,
644644
get_variable_name(mu),
645645
get_variable_name(b))
646646

@@ -713,7 +713,7 @@ def _repr_latex_(self, name=None, dist=None):
713713
dist = self
714714
tau = dist.tau
715715
mu = dist.mu
716-
return r'$%s \sim \text{Lognormal}(\mathit{mu}=%s, \mathit{tau}=%s)$' % (name,
716+
return r'${} \sim \text{{Lognormal}}(\mathit{{mu}}={}, \mathit{{tau}}={})$'.format(name,
717717
get_variable_name(mu),
718718
get_variable_name(tau))
719719

@@ -787,7 +787,7 @@ def _repr_latex_(self, name=None, dist=None):
787787
nu = dist.nu
788788
mu = dist.mu
789789
lam = dist.lam
790-
return r'$%s \sim \text{StudentT}(\mathit{nu}=%s, \mathit{mu}=%s, \mathit{lam}=%s)$' % (name,
790+
return r'${} \sim \text{{StudentT}}(\mathit{{nu}}={}, \mathit{{mu}}={}, \mathit{{lam}}={})$'.format(name,
791791
get_variable_name(nu),
792792
get_variable_name(mu),
793793
get_variable_name(lam))
@@ -859,7 +859,7 @@ def _repr_latex_(self, name=None, dist=None):
859859
dist = self
860860
alpha = dist.alpha
861861
m = dist.m
862-
return r'$%s \sim \text{Pareto}(\mathit{alpha}=%s, \mathit{m}=%s)$' % (name,
862+
return r'${} \sim \text{{Pareto}}(\mathit{{alpha}}={}, \mathit{{m}}={})$'.format(name,
863863
get_variable_name(alpha),
864864
get_variable_name(m))
865865

@@ -920,7 +920,7 @@ def _repr_latex_(self, name=None, dist=None):
920920
dist = self
921921
alpha = dist.alpha
922922
beta = dist.beta
923-
return r'$%s \sim \text{Cauchy}(\mathit{alpha}=%s, \mathit{beta}=%s)$' % (name,
923+
return r'${} \sim \text{{Cauchy}}(\mathit{{alpha}}={}, \mathit{{beta}}={})$'.format(name,
924924
get_variable_name(alpha),
925925
get_variable_name(beta))
926926

@@ -974,7 +974,7 @@ def _repr_latex_(self, name=None, dist=None):
974974
if dist is None:
975975
dist = self
976976
beta = dist.beta
977-
return r'$%s \sim \text{HalfCauchy}(\mathit{beta}=%s)$' % (name,
977+
return r'${} \sim \text{{HalfCauchy}}(\mathit{{beta}}={})$'.format(name,
978978
get_variable_name(beta))
979979

980980
class Gamma(PositiveContinuous):
@@ -1064,7 +1064,7 @@ def _repr_latex_(self, name=None, dist=None):
10641064
dist = self
10651065
beta = dist.beta
10661066
alpha = dist.alpha
1067-
return r'$%s \sim \text{Gamma}(\mathit{alpha}=%s, \mathit{beta}=%s)$' % (name,
1067+
return r'${} \sim \text{{Gamma}}(\mathit{{alpha}}={}, \mathit{{beta}}={})$'.format(name,
10681068
get_variable_name(alpha),
10691069
get_variable_name(beta))
10701070

@@ -1134,7 +1134,7 @@ def _repr_latex_(self, name=None, dist=None):
11341134
dist = self
11351135
beta = dist.beta
11361136
alpha = dist.alpha
1137-
return r'$%s \sim \text{InverseGamma}(\mathit{alpha}=%s, \mathit{beta}=%s)$' % (name,
1137+
return r'${} \sim \text{{InverseGamma}}(\mathit{{alpha}}={}, \mathit{{beta}}={})$'.format(name,
11381138
get_variable_name(alpha),
11391139
get_variable_name(beta))
11401140

@@ -1168,7 +1168,7 @@ def _repr_latex_(self, name=None, dist=None):
11681168
if dist is None:
11691169
dist = self
11701170
nu = dist.nu
1171-
return r'$%s \sim \Chi^2(\mathit{nu}=%s)$' % (name,
1171+
return r'${} \sim \Chi^2(\mathit{{nu}}={})$'.format(name,
11721172
get_variable_name(nu))
11731173

11741174

@@ -1232,7 +1232,7 @@ def _repr_latex_(self, name=None, dist=None):
12321232
dist = self
12331233
beta = dist.beta
12341234
alpha = dist.alpha
1235-
return r'$%s \sim \text{Weibull}(\mathit{alpha}=%s, \mathit{beta}=%s)$' % (name,
1235+
return r'${} \sim \text{{Weibull}}(\mathit{{alpha}}={}, \mathit{{beta}}={})$'.format(name,
12361236
get_variable_name(alpha),
12371237
get_variable_name(beta))
12381238

@@ -1332,7 +1332,7 @@ def _repr_latex_(self, name=None, dist=None):
13321332
sigma = dist.sigma
13331333
mu = dist.mu
13341334
nu = dist.nu
1335-
return r'$%s \sim \text{ExGaussian}(\mathit{mu}=%s, \mathit{sigma}=%s, \mathit{nu}=%s)$' % (name,
1335+
return r'${} \sim \text{{ExGaussian}}(\mathit{{mu}}={}, \mathit{{sigma}}={}, \mathit{{nu}}={})$'.format(name,
13361336
get_variable_name(mu),
13371337
get_variable_name(sigma),
13381338
get_variable_name(nu))
@@ -1390,7 +1390,7 @@ def _repr_latex_(self, name=None, dist=None):
13901390
dist = self
13911391
kappa = dist.kappa
13921392
mu = dist.mu
1393-
return r'$%s \sim \text{VonMises}(\mathit{mu}=%s, \mathit{kappa}=%s)$' % (name,
1393+
return r'${} \sim \text{{VonMises}}(\mathit{{mu}}={}, \mathit{{kappa}}={})$'.format(name,
13941394
get_variable_name(mu),
13951395
get_variable_name(kappa))
13961396

@@ -1476,7 +1476,7 @@ def _repr_latex_(self, name=None, dist=None):
14761476
sd = dist.sd
14771477
mu = dist.mu
14781478
alpha = dist.alpha
1479-
return r'$%s \sim \text{Skew-Normal}(\mathit{mu}=%s, \mathit{sd}=%s, \mathit{alpha}=%s)$' % (name,
1479+
return r'${} \sim \text{{Skew-Normal}}(\mathit{{mu}}={}, \mathit{{sd}}={}, \mathit{{alpha}}={})$'.format(name,
14801480
get_variable_name(mu),
14811481
get_variable_name(sd),
14821482
get_variable_name(alpha))
@@ -1529,7 +1529,7 @@ def _repr_latex_(self, name=None, dist=None):
15291529
lower = dist.lower
15301530
upper = dist.upper
15311531
c = dist.c
1532-
return r'$%s \sim \text{Triangular}(\mathit{c}=%s, \mathit{lower}=%s, \mathit{upper}=%s)$' % (name,
1532+
return r'${} \sim \text{{Triangular}}(\mathit{{c}}={}, \mathit{{lower}}={}, \mathit{{upper}}={})$'.format(name,
15331533
get_variable_name(c),
15341534
get_variable_name(lower),
15351535
get_variable_name(upper))
@@ -1583,7 +1583,7 @@ def _repr_latex_(self, name=None, dist=None):
15831583
dist = self
15841584
beta = dist.beta
15851585
mu = dist.mu
1586-
return r'$%s \sim \text{Gumbel}(\mathit{mu}=%s, \mathit{beta}=%s)$' % (name,
1586+
return r'${} \sim \text{{Gumbel}}(\mathit{{mu}}={}, \mathit{{beta}}={})$'.format(name,
15871587
get_variable_name(mu),
15881588
get_variable_name(beta))
15891589

0 commit comments

Comments
 (0)