[PyFeyn] More control over labels on fermion and boson lines

Ian Brock brock at physik.uni-bonn.de
Wed May 20 17:05:47 BST 2020


Dear All,

I still see the problem with upright particles with the latest versions of TeX Live. I have not yet found a workaround for it.

I recently reinstalled python (3.8.2), (matplotlib), MacTeX, PyFeyn in a clean way using brew and pyenv.

As a result PyX is now Version 0.15 and they have changed the text engine, so that PyFeyn no longer works. I have managed to get it working again and at the same time I have decoupled the initialisation of hepnicenames into a separate function that the user can call if he/she wants to.

While it is easy to adjust __init__.py to cope with different PyX versions, changes are also need in deco.py to use defaulttextengine instead of defaulttexrunner. I am not sure if and how one could make these changes dependent on the PyX version, or we just bite the bullet and say that PyFeyn only work with version 0.15 onwards.

I also tried playing around with things using Ubuntu installations. If I install pyfeyn with pip3, it automatically picks up PyX 0.15. I then have to remove that version and install PyX 0.14 by hand, so this is also not a real solution.

How should I go about submitting my changes?

I also see a problem with the Drell-Yan example script. If I leave the line as:
glu = Gluon(midpoint(out_vtx, out1), midpoint(out_vtx, out2)).set3D()
it fails as it says that 
Drawing <class 'pyfeyn.lines.Gluon'> with styles = []
Traceback (most recent call last):
  File "./DY.py", line 33, in <module>
    fd.draw("pyfeyn-test1.pdf")
  File "/Users/brock/.pyenv/versions/3.8.2/lib/python3.8/site-packages/pyfeyn/diagrams.py", line 70, in draw
    c = self.drawToCanvas()
  File "/Users/brock/.pyenv/versions/3.8.2/lib/python3.8/site-packages/pyfeyn/diagrams.py", line 62, in drawToCanvas
    obj.draw(self.currentCanvas)
  File "/Users/brock/.pyenv/versions/3.8.2/lib/python3.8/site-packages/pyfeyn/lines.py", line 522, in draw
    ass, bs = para.normpath_selfintersections(mypath.normpath(), 0.01, 0.1) #epsilon=0.01, eps_comparepairs=0.1)
  File "/Users/brock/.pyenv/versions/3.8.2/lib/python3.8/site-packages/pyx/deformer.py", line 1518, in normpath_selfintersections
    dist = self.dist_pt
AttributeError: 'parallel' object has no attribute 'dist_pt’
If I remove “.set3D()” it works, so the problem seems to be somehow connected to that, but I have not understood more.

Note that I had to add an extra argument to ass, bs = para.normpath_selfintersections(mypath.normpath(), 0.01, 0.1) #epsilon=0.01, eps_comparepairs=0.1) - before there was only epsilon
and as far as I can see para.normpath_selfintersections returns only 2 variables and not 3.

Best Regards
Ian

Ian C. Brock | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn
Tel. +49 228 733616 | Email: i.brock at uni-bonn.de <mailto:brock at physik.uni-bonn.de>



> On 23 Apr 2019, at 14:03, Andy Buckley <andy.buckley at cern.ch> wrote:
> 
> Hi Ian,
> 
> Really glad you're using and liking it! From my point of view pyfeyn is not actively developed, and I didn't even know about this need to hack to use newtx fonts. I'll happily accept, merge, and make a new release if you have any code patches for the features you want, and can probably recall enough of the implementation detail to help with figuring out with passing extra label specifications to PyX if that's not obvious.
> 
> Dr Andy Buckley, Senior Lecturer & Royal Society Research Fellow
> Particle Physics Experiment Group, University of Glasgow, UK
> On Apr 15 2019, at 8:54 am, Ian Brock <brock at physik.uni-bonn.de> wrote:
> Dear PyFeyn,
> 
> I have been using PyFeyn for a couple of years now and am very happy with it. It would be great if it was not necessary to fix vffile.py so that one can use the newtx fonts. I guess that needs a new version of PyX though?
> 
> In addition, it would be nice to be able to control how hepnicenames is included. I sometimes want it with the italic option and sometimes not. At the moment I simply comment that out in the __init__.py file of pyfeyn.
> 
> The main reason I write this mail though, is that it would be good to have some more control over the labels (expecially on boson and fermion lines). Sometimes it would be good to have the horizontal alignment left instead of centred for example. It would also be nice if it was easy to change the default text size. I did not find a way to do either of these things. Am I missing something?
> 
> Best Regards
> Ian
> 
> Ian C. Brock | Physikalisches Institut, Universität Bonn | Nußallee 12 | D-53115 Bonn
> Tel. +49 228 733616 | Email: i.brock at uni-bonn.de <mailto:brock at physik.uni-bonn.de>
> 
> 
> 
> _______________________________________________
> PyFeyn mailing list
> PyFeyn at projects.hepforge.org
> https://www.hepforge.org/lists/listinfo/pyfeyn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.hepforge.org/lists-archive/pyfeyn/attachments/20200520/7e56d11e/attachment.html>


More information about the PyFeyn mailing list