|
[PyFeyn] PyFeyn error with fd.drawGeorg von Hippel hippel at uni-mainz.deTue Jun 7 11:21:30 BST 2016
Hi Ian, hmm, looks like there are some rather deep changes in the PyX code, then. We'll have to look into that in some more detail and add additional workarounds to Pyfeyn. However, it is very odd that Pyfeyn seems to no longer work with PyX 0.13, because I'm pretty sure it did before -- George made sure of that. I have checked that it definitely works with Python 2.7.6 and PyX 0.12.1, if that's any help to you. Best, Georg On Tue, 7 Jun 2016, Ian Brock wrote: > Hi Georg, > > Still no luck! > brock at ltbrock:~/Downloads$ python pyfeyn-test1.py > /usr/local/texlive/2015/texmf-dist/tex/latex/hepnames/hepnicenames.sty > Traceback (most recent call last): > File "pyfeyn-test1.py", line 26, in <module> > fd.draw("pyfeyn-test1.pdf") > File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 70, in draw > c = self.drawToCanvas() > File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 62, in drawToCanvas > obj.draw(self.currentCanvas) > File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/lines.py", line 522, in draw > ass, bs, cs = para.normpath_selfintersections(mypath.normpath(), 0.01, 0.01) > File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyx/deformer.py", line 1517, in normpath_selfintersections > dist = self.dist_pt > AttributeError: 'parallel' object has no attribute 'dist_pt' > > Best Regards > Ian > > Ian C. Brock | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn > Tel. +49 228 733616 | Email: brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> > > > >> On 07 Jun 2016, at 11:39, Georg von Hippel <hippel at uni-mainz.de> wrote: >> >> >> Hi Ian, >> >> ok, I looked at the PyX source code now. Apparently it now wants three arguments (none of which are optional now), so it should be something like >> >> para.normpath_selfintersections(mypath.normpath(), 0.01, 0.01) >> >> assuming that the eps_comparepairs should be similar to the epsilon. Hopefully that works. >> >> Best, >> >> Georg >> >> >> On Tue, 7 Jun 2016, Ian Brock wrote: >> >>> Hi Georg, >>> >>> I tried that and it did not help: >>> brock at ltbrock:~/Downloads$ python pyfeyn-test1.py >>> /usr/local/texlive/2015/texmf-dist/tex/latex/hepnames/hepnicenames.sty >>> Traceback (most recent call last): >>> File "pyfeyn-test1.py", line 26, in <module> >>> fd.draw("pyfeyn-test1.pdf") >>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 70, in draw >>> c = self.drawToCanvas() >>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 62, in drawToCanvas >>> obj.draw(self.currentCanvas) >>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/lines.py", line 522, in draw >>> ass, bs, cs = para.normpath_selfintersections(mypath.normpath(), 0.01) >>> TypeError: normpath_selfintersections() missing 1 required positional argument: 'eps_comparepairs' >>> >>> Best Regards >>> Ian >>> >>> Ian C. Brock | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn >>> Tel. +49 228 733616 | Email: brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> >>> >>> >>> >>>> On 07 Jun 2016, at 11:27, Georg von Hippel <hippel at uni-mainz.de <mailto:hippel at uni-mainz.de>> wrote: >>>> >>>> >>>> Hi Ian, >>>> >>>> can you try removing the "epsilon=" in front of the 0.01 in lines.py:522? Maybe that's enough to get it to run with your setup. >>>> >>>> Best, >>>> >>>> Georg >>>> >>>> >>>> On Tue, 7 Jun 2016, Ian Brock wrote: >>>> >>>>> Hi Georg, >>>>> >>>>> Yes, I’m sure. pyfeyn-test2.py worked! Heres the output! >>>>> >>>>> In [1]: %run pyfeyn-test1.py >>>>> /usr/local/texlive/2015/texmf-dist/tex/latex/hepnames/hepnicenames.sty >>>>> --------------------------------------------------------------------------- >>>>> TypeError Traceback (most recent call last) >>>>> /Users/brock/Downloads/pyfeyn-test1.py in <module>() >>>>> 24 glu.addParallelArrow(size=0.1, displace=0.2, sense=-1) >>>>> 25 >>>>> ---> 26 fd.draw("pyfeyn-test1.pdf") >>>>> >>>>> /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py in draw(self, outfile, enlargement) >>>>> 68 """Draw the diagram to a file, with the filetype (EPS or PDF) >>>>> 69 derived from the file extension.""" >>>>> ---> 70 c = self.drawToCanvas() >>>>> 71 if c is not None and outfile is not None: >>>>> 72 if pyxversion >= Version("0.12"): >>>>> >>>>> /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py in drawToCanvas(self) >>>>> 60 if config.getOptions().DEBUG: >>>>> 61 print("Depth = ", obj.getDepth()) >>>>> ---> 62 obj.draw(self.currentCanvas) >>>>> 63 >>>>> 64 return self.currentCanvas >>>>> >>>>> /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/lines.py in draw(self, canvas) >>>>> 520 else: >>>>> 521 para = pyx.deformer.parallel(0.001) >>>>> --> 522 ass, bs, cs = para.normpath_selfintersections(mypath.normpath(), epsilon=0.01) >>>>> 523 coil_params = [] >>>>> 524 for b in bs: >>>>> >>>>> TypeError: normpath_selfintersections() missing 1 required positional argument: 'eps_comparepairs' >>>>> >>>>> In [2]: print(pyx.__version__) >>>>> 0.13 >>>>> >>>>> Best Regards >>>>> Ian >>>>> >>>>> Ian C. Brock | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn >>>>> Tel. +49 228 733616 | Email: brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>> >>>>> >>>>> >>>>> >>>>>> On 07 Jun 2016, at 10:47, Georg von Hippel <hippel at uni-mainz.de <mailto:hippel at uni-mainz.de> <mailto:hippel at uni-mainz.de <mailto:hippel at uni-mainz.de>>> wrote: >>>>>> >>>>>> >>>>>> Hi Ian, >>>>>> >>>>>> PyX 0.12.x is for Python 2.x and won't work with Python 3.x. I'm confused about the error using PyX 0.13, though -- are you sure that it isn't actually using the more recent version of PyX still? >>>>>> >>>>>> Best, >>>>>> >>>>>> Georg >>>>>> >>>>>> >>>>>> On Tue, 7 Jun 2016, Ian Brock wrote: >>>>>> >>>>>>> Hi Georg, >>>>>>> >>>>>>> I used pip to install version PyX 0.13. I got errors from pip when trying to install 0.12.1. >>>>>>> pyfeyn-test1.py still does not work, while pyfeyn-test2.py seems to work? >>>>>>> >>>>>>> brock at ltbrock:~/Downloads$ python pyfeyn-test1.py >>>>>>> /usr/local/texlive/2015/texmf-dist/tex/latex/hepnames/hepnicenames.sty >>>>>>> Traceback (most recent call last): >>>>>>> File "pyfeyn-test1.py", line 26, in <module> >>>>>>> fd.draw("pyfeyn-test1.pdf") >>>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 70, in draw >>>>>>> c = self.drawToCanvas() >>>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 62, in drawToCanvas >>>>>>> obj.draw(self.currentCanvas) >>>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/lines.py", line 522, in draw >>>>>>> ass, bs, cs = para.normpath_selfintersections(mypath.normpath(), epsilon=0.01) >>>>>>> TypeError: normpath_selfintersections() missing 1 required positional argument: 'eps_comparepairs' >>>>>>> brock at ltbrock:~/Downloads$ python pyfeyn-test2.py >>>>>>> /usr/local/texlive/2015/texmf-dist/tex/latex/hepnames/hepnicenames.sty >>>>>>> Ignoring line 16918 in mapping file 'pdftex.map': Unknown token '<MinLibBol' >>>>>>> Ignoring line 16919 in mapping file 'pdftex.map': Unknown token '<MinLibBol' >>>>>>> Ignoring line 16920 in mapping file 'pdftex.map': Unknown token '<MinLibBol' >>>>>>> Ignoring line 16921 in mapping file 'pdftex.map': Unknown token '<MinLibBolIta' >>>>>>> Ignoring line 16922 in mapping file 'pdftex.map': Unknown token '<MinLibBolIta' >>>>>>> Ignoring line 16923 in mapping file 'pdftex.map': Unknown token '<MinLibBolIta' >>>>>>> Ignoring line 16924 in mapping file 'pdftex.map': Unknown token '<MinLibIta' >>>>>>> Ignoring line 16925 in mapping file 'pdftex.map': Unknown token '<MinLibIta' >>>>>>> Ignoring line 16926 in mapping file 'pdftex.map': Unknown token '<MinLibIta' >>>>>>> Ignoring line 16927 in mapping file 'pdftex.map': Unknown token '<MinLibReg' >>>>>>> Ignoring line 16928 in mapping file 'pdftex.map': Unknown token '<MinLibReg' >>>>>>> Ignoring line 16929 in mapping file 'pdftex.map': Unknown token '<MinLibReg' >>>>>>> >>>>>>> Best Regards >>>>>>> Ian >>>>>>> >>>>>>> Ian C. Brock | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn >>>>>>> Tel. +49 228 733616 | Email: brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> On 07 Jun 2016, at 09:48, Georg von Hippel <hippel at uni-mainz.de <mailto:hippel at uni-mainz.de> <mailto:hippel at uni-mainz.de <mailto:hippel at uni-mainz.de>> <mailto:hippel at uni-mainz.de <mailto:hippel at uni-mainz.de> <mailto:hippel at uni-mainz.de <mailto:hippel at uni-mainz.de>>>> wrote: >>>>>>>> >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> this is a perpetual annoyance with PyX -- it does not provide a stable API, and every time they publish a new version, new workaround code is needed. >>>>>>>> >>>>>>>> Pyfeyn works with 0.12.x and 0.13.x, but apparently 0.14.x breaks yet another interface (specifically normpath_selfintersections, which appears to require an additional argument). This will need yet another workaround. Ugh. >>>>>>>> >>>>>>>>> From the name of the required argument eps_comparepairs, I suspect it may >>>>>>>> be enough to replace the "epsilon=0.01" with simply "0.01" on line 522 of lines.py in order to make the code run (quite possibly with all version of PyX), but that needs checking. >>>>>>>> >>>>>>>> Best, >>>>>>>> >>>>>>>> Georg >>>>>>>> >>>>>>>> >>>>>>>> On Mon, 6 Jun 2016, George S. Williams wrote: >>>>>>>> >>>>>>>>> Hey, Ian, >>>>>>>>> >>>>>>>>> Sorry you're having a problem with PyFeyn. I think the problem is actually with PyX- they change an API and any code that relied on that API call from a previous version is broken. We've had that problem in the past. >>>>>>>>> >>>>>>>>> Would you please let us know which versions of PyX and PyFeyn you have installed? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> George >>>>>>>>> >>>>>>>>> >>>>>>>>> On 6/6/2016 12:20 PM, Ian Brock wrote: >>>>>>>>>> Dear PyFeyn, >>>>>>>>>> I get an error when trying to run the first PyFeyn test file: >>>>>>>>>> python pyfeyn-test1.py >>>>>>>>>> /usr/local/texlive/2015/texmf-dist/tex/latex/hepnames/hepnicenames.sty >>>>>>>>>> Traceback (most recent call last): >>>>>>>>>> File "pyfeyn-test1.py", line 26, in <module> >>>>>>>>>> fd.draw("pyfeyn-test1.pdf") >>>>>>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 70, in draw >>>>>>>>>> c = self.drawToCanvas() >>>>>>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/diagrams.py", line 62, in drawToCanvas >>>>>>>>>> obj.draw(self.currentCanvas) >>>>>>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pyfeyn/lines.py", line 522, in draw >>>>>>>>>> ass, bs, cs = para.normpath_selfintersections(mypath.normpath(), epsilon=0.01) >>>>>>>>>> TypeError: normpath_selfintersections() missing 1 required positional argument: 'eps_comparepairs' >>>>>>>>>> I am using Python3.5 installed via Macports. >>>>>>>>>> I installed PyX and PyFeyn via pip. This worked without any error messages. >>>>>>>>>> I tested hepnames in test file and it works fine. >>>>>>>>>> Best Regards >>>>>>>>>> Ian >>>>>>>>>> *Ian C. Brock* | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn >>>>>>>>>> Tel. +49 228 733616 | Email: brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de><mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de><mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de><mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>> <mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de><mailto:brock at physik.uni-bonn.de <mailto:brock at physik.uni-bonn.de>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> PyFeyn mailing list >>>>>>>>>> PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org> <mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org>> <mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org><mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org>>> <mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org> <mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org>> <mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org> <mailto:PyFeyn at projects.hepforge.org <mailto:PyFeyn at projects.hepforge.org>>>> >>>>>>>>>> https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn> <https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn>> <https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn><https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn>>> <https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn> <https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn>><https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn> <https://www.hepforge.org/lists/listinfo/pyfeyn <https://www.hepforge.org/lists/listinfo/pyfeyn>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> --- >>>>>>>>> This email has been checked for viruses by Avast antivirus software. >>>>>>>>> https://www.avast.com/antivirus <https://www.avast.com/antivirus> <https://www.avast.com/antivirus <https://www.avast.com/antivirus>> <https://www.avast.com/antivirus <https://www.avast.com/antivirus> <https://www.avast.com/antivirus <https://www.avast.com/antivirus>>> <https://www.avast.com/antivirus <https://www.avast.com/antivirus> <https://www.avast.com/antivirus <https://www.avast.com/antivirus>> <https://www.avast.com/antivirus <https://www.avast.com/antivirus> <https://www.avast.com/antivirus <https://www.avast.com/antivirus>>>> >>>>>>>>> >>>>>> >>>>>> -- >>>>>> =========================================================================== >>>>>> >>>>>> 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 <mailto:hippel at kph.uni-mainz.de> <mailto:hippel at kph.uni-mainz.de <mailto:hippel at kph.uni-mainz.de>> >>>>>> Germany wwwth.kph.uni-mainz.de/1205.php <http://wwwth.kph.uni-mainz.de/1205.php> <http://wwwth.kph.uni-mainz.de/1205.php <http://wwwth.kph.uni-mainz.de/1205.php>> >>>>>> >>>>>> =========================================================================== >>>>> >>>>> >>>> >>>> -- >>>> =========================================================================== >>>> >>>> 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 >>>> >>>> =========================================================================== >>> >>> >> >> -- >> =========================================================================== >> >> 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 >> >> =========================================================================== > > -- =========================================================================== 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 |