Code review comment for lp:~mg5core2/mg5amcnlo/2.5.5

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi,

Let assume that formatted returned "+23**2"
Then it will be transformed in (+23)**2
So this should not be a problem.

Cheers,

Olivier

PS: actually exponent are always associated to paranthesis so the problem will never occur.

> On 24 May 2017, at 23:26, Valentin Hirschi <email address hidden> wrote:
>
> Review: Approve
>
> Hi Olivier, quick last minute review:
>
> MadSpin/interface_madspin.py:
> two left-over misc.sprint
>
> This change seems a bit hacky, is it really safe?
> For example, what could happen if the first operator used is exponentiation, i.e. ** ?
>
> === modified file 'aloha/aloha_writers.py'
> --- aloha/aloha_writers.py 2017-03-27 08:37:47 +0000
> +++ aloha/aloha_writers.py 2017-05-24 17:51:30 +0000
> @@ -802,7 +802,13 @@
> for ind in numerator.listindices():
> formatted = self.write_obj(numerator.get_rep(ind))
> if formatted.startswith(('+','-')):
> - formatted = '(%s)*%s' % tuple(formatted.split('*',1))
> + if '*' in formatted:
> + formatted = '(%s)*%s' % tuple(formatted.split('*',1))
> + else:
> + if formatted.startswith('+'):
> + formatted = formatted[1:]
> + else:
> + formatted = '(-1)*%s' % formatted[1:]
> to_order[self.pass_to_HELAS(ind)] = \
> ' %s(%d)= %s%s\n' % (self.outname, self.pass_to_HELAS(ind)+1,
> coeff, formatted)
>
> Going through the other changes nothing struck me.
> However, I don't know well enough MadFKS to be able to assess the impact of Rik's clean-up of the code.
>
> So it's all ok for me.
>
>
>
>
> --
> https://code.launchpad.net/~mg5core2/mg5amcnlo/2.5.5/+merge/324347
> Your team mg5core2 is subscribed to branch lp:~mg5core2/mg5amcnlo/2.5.5.

« Back to merge proposal