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.
« Back to merge proposal
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' writers. py 2017-03-27 08:37:47 +0000 writers. py 2017-05-24 17:51:30 +0000 listindices( ):
formatted = self.write_ obj(numerator. get_rep( ind)) startswith( ('+','- ')): .split( '*',1)) .split( '*',1)) startswith( '+'):
to_order[ self.pass_ to_HELAS( ind)] = \
' %s(%d)= %s%s\n' % (self.outname, self.pass_ to_HELAS( ind)+1,
coeff, formatted)
--- aloha/aloha_
+++ aloha/aloha_
@@ -802,7 +802,13 @@
for ind in numerator.
if formatted.
- formatted = '(%s)*%s' % tuple(formatted
+ if '*' in formatted:
+ formatted = '(%s)*%s' % tuple(formatted
+ else:
+ if formatted.
+ formatted = formatted[1:]
+ else:
+ formatted = '(-1)*%s' % formatted[1:]
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.