[PyFeyn] pyfeyn-0.3.3 and PyX-0.12.1

Andrey G. Grozin A.G.Grozin at inp.nsk.su
Tue Feb 25 04:18:15 GMT 2014


Hello,

There are problems in pyfeyn with recent versions of PyX.

1. In __init__.py: there is no pyx.pykpathsea.kpse_tex_format
Indeed, the string kpse_tex_format is present in PyX sources just once, in 
pykpathsea.c, and this line is commented out. I don't know the meaning of 
the second argument of pyx.pykpathsea.find_file, so, I had to do 
pyx.text.defaulttexrunner.preamble(r"\usepackage{hepnames}") 
unconditionally.

2. pyx.deco._arrowhead must have 7 arguments, only 6 are provided in 
deco.py. Again, I don't know the meaning of all these arguments. I made a 
guess that the missing 6-th arg can be self.constriction (because the 
argument name in _arrowhead is constriction); test scripts work, and 
arrows seem to be OK.

So, I made a Gentoo package (ebuild) with the attached patch. The 
pyfeyn-0.3.3 package depends on PyX (currently 0.12.1) and texlive-science 
(this package contains hepnames). Now committed to the Gentoo repository.

What about porting to python-3 and, correspondingly, using PyX-0.13? Are 
there such plans? Probably, this should not be very difficult...

Thank you for the package,
Andrey Grozin,
theoretical physicist and Gentoo developer
-------------- next part --------------
diff -r -U1 pyfeyn-0.3.3.orig/pyfeyn/__init__.py pyfeyn-0.3.3/pyfeyn/__init__.py
--- pyfeyn-0.3.3.orig/pyfeyn/__init__.py	2013-10-03 20:24:30.000000000 +0700
+++ pyfeyn-0.3.3/pyfeyn/__init__.py	2014-02-24 20:19:42.908082109 +0700
@@ -15,8 +15,2 @@
     import pyx
-
-    ## Check the version
-    from distutils.version import StrictVersion as Version
-    if Version(pyx.version.version) < Version("0.9.0"):
-        print "Warning: PyFeyn may not work with PyX versions older than 0.9!"
-
     ## Units
@@ -24,10 +18,5 @@
     pyx.unit.set(defaultunit = "cm")
-
     ## TeX stuff
     pyx.text.defaulttexrunner.set(mode="latex")
-    if pyx.pykpathsea.find_file("hepnames.sty", pyx.pykpathsea.kpse_tex_format):
-        pyx.text.defaulttexrunner.preamble(r"\usepackage{hepnames}")
-    else:
-        print "Warning: hepnames LaTeX package not found!"
-
+    pyx.text.defaulttexrunner.preamble(r"\usepackage{hepnames}")
 except:
diff -r -U1 pyfeyn-0.3.3.orig/pyfeyn/deco.py pyfeyn-0.3.3/pyfeyn/deco.py
--- pyfeyn-0.3.3.orig/pyfeyn/deco.py	2011-02-20 23:29:40.000000000 +0600
+++ pyfeyn-0.3.3/pyfeyn/deco.py	2014-02-24 20:21:53.935087856 +0700
@@ -27,3 +27,3 @@
         arrowpath = pyx.deco._arrowhead(arrowtopath, self.pos*dp.path.arclen(),
-                                        1, self.size, 45, constrictionlen)
+                                        1, self.size, 45, self.constriction, constrictionlen)
         dp.ornaments.fill(arrowpath)


More information about the PyFeyn mailing list