[PyFeyn] Issues running examples on

Georg von Hippel hippel at uni-mainz.de
Sun Dec 27 19:27:31 GMT 2015


Dear Antonio,

this is a bug in the released PyFeyn version; the SVN development version 
has been fixed a while ago. To fix the bug, change the code for 
getarrowpath into:

def getarrowpath(arrowtopath, selfpos, var1, selfsize, var2,
                  selfconstriction, constrictionlen):
         if pyxversion >= Version("0.12"):
             arrowpath = pyx.deco._arrowhead(arrowtopath, selfpos,
                                         var1, selfsize, var2,
                                         selfconstriction,
                                         constrictionlen)
         else:
             arrowpath = pyx.deco._arrowhead(arrowtopath, selfpos,
                                         var1, selfsize, var2,
                                         constrictionlen)
         return arrowpath

and add self.constriction as the penultimate attribute to all calls to 
getarrowpath (i.e. the calls in lines 46 and 160).

Best regards,

    Georg


On Sun, 27 Dec 2015, Antonio Carlos Amaro de Faria Junior wrote:

> Dear Pyfeyn developers,
>
> I thank you in advance for any assistance you may be able to offer with my problem. I would like to use PyFeyn on a project as it looks like it will be extremely useful for my work on this.
>
> I tried to run your examples and am, in all cases receiving an error on the call of FeynDiagram().Draw()
>
> See stack trace for the Higgs Loop example below:
>
> Traceback (most recent call last):
>  File "test1.py", line 15, in <module>
>    fd.draw("pyfeyn-test1.pdf")
>  File "build/bdist.macosx-10.9-intel/egg/pyfeyn/diagrams.py", line 69, in draw
>  File "build/bdist.macosx-10.9-intel/egg/pyfeyn/diagrams.py", line 61, in drawToCanvas
>  File "build/bdist.macosx-10.9-intel/egg/pyfeyn/lines.py", line 329, in draw
>  File "/Library/Python/2.7/site-packages/PyX-0.12-py2.7.egg/pyx/canvas.py", line 298, in stroke
>    self.draw(path, [deco.stroked]+list(attrs))
>  File "/Library/Python/2.7/site-packages/PyX-0.12-py2.7.egg/pyx/canvas.py", line 284, in draw
>    adeco.decorate(dp, self.texrunner)
>  File "build/bdist.macosx-10.9-intel/egg/pyfeyn/deco.py", line 46, in decorate
>  File "build/bdist.macosx-10.9-intel/egg/pyfeyn/deco.py", line 16, in getarrowpath
> NameError: global name 'self' is not defined
>
> I am running Python 2.7.5 with pyX 0.12 and PyFeyn 0.3.4. on Mac OSX 10.9 Is there a possible version conflict? I’ll be happy to try other versions if applicable.
>
> Many thanks,
>
> Farias

-- 
===========================================================================

  PD Dr. Georg von Hippel
  Institut für Kernphysik                 Office: 01-226 (Neubau)
  Johannes Gutenberg-Universität Mainz    Phone:  +49 6131 39-22933
  Johann-Joachim-Becher-Weg 45            Fax:    +49 6131 39-22964
  55099 Mainz                             Email:  hippel at kph.uni-mainz.de
  Germany                                 wwwth.kph.uni-mainz.de/1205.php

===========================================================================


More information about the PyFeyn mailing list