<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hmm,<div><br class="webkit-block-placeholder"></div><div>We have the grammar set to treat "raw" strings as a regular expression. They were introduced to the python language specifically to make writing regular expressions easier, so this seems logical.</div><div><br class="webkit-block-placeholder"></div><div>Anyway, the grammar thinks that you're LaTeX code is a regular expression. My suggestion would be to remove the "r" from before your doc-string. Is there a particular reason you are using them?</div><div><br class="webkit-block-placeholder"></div><div>–Alex</div><div><br class="webkit-block-placeholder"></div><div><br><div><div>On Aug 11, 2007, at 9:04 PM, Anand Patil wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">def half_normal_like(x, tau):<span class="Apple-converted-space"> </span><br> r"""<span class="Apple-converted-space"> </span><br> half_normal_like(x, tau)<br><br> Half-normal log-likelihood, a normal distribution with mean 0 and limited<br> to the domain :math:`x \in [0, \Infty)`.<br><br> .. math::<br> f(x \mid \tau) = \sqrt{\frac{2\tau}{\pi}}\exp<div>\left\{ {\frac{-x^2 \tau}{2}}\right\}<span class="Apple-converted-space"> </span><br><br> :Parameters:<br> x : float<br> :math:`x \ge 0`<br> tau : float<br> :math:`\tau > 0`<br><br> """<br> # try:<br> # constrain(tau, lower=0)<br> # constrain(x, lower=0, allow_equal=True)<span class="Apple-converted-space"> </span><br> # except ZeroProbability:<br> # return -Inf<br> return flib.hnormal(x, tau)</div></span></blockquote></div><br></div></body></html>