Skip to content

Commit

Permalink
Still needs feynml bump
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed Jul 5, 2023
1 parent 04d1744 commit fa45645
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,4 @@ tmp.tex
tests/out.pdf

.vscode/*
tmp-*
13 changes: 11 additions & 2 deletions pyfeyn2/render/latex/tikzfeynman.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
from typing import List
from warnings import warn

from feynml.connector import Connector
from feynml.feynmandiagram import FeynmanDiagram
from feynml.leg import Leg
from feynml.vertex import Vertex
from pylatex import Command
from pylatex.utils import NoEscape

from pyfeyn2.feynmandiagram import Connector, FeynmanDiagram, Leg, Vertex
from pyfeyn2.render.latex.latex import LatexRender

# converte FeynmanDiagram to tikz-feynman
Expand Down Expand Up @@ -56,7 +59,13 @@ def stylize_connect(fd: FeynmanDiagram, c: Connector):
if style.getProperty("line") is not None:
ret += type_map[style.getProperty("line").value]
else:
ret += type_map[c.type] # fallback to type if no style
if c.type is not None:
ret += type_map[c.type] # fallback to type if no style
else:
warnings.warn(
f"No type or style set for connector {c.id} {c.type} {c.pdgid}"
)
ret += "plain"

if c.label is not None:
ret += ",edge label=" + c.label
Expand Down

0 comments on commit fa45645

Please sign in to comment.