pyfeyn2.feynmandiagram.FeynML

class pyfeyn2.feynmandiagram.FeynML(version: str | None = '0.2.26', head: ~feynml.head.Head | None = <factory>, diagrams: ~typing.List[~feynml.feynmandiagram.FeynmanDiagram] = <factory>)[source]

Bases: FeynML

FeynML with pyfeyn2 meta tag.

__init__(version: str | None = '0.2.26', head: ~feynml.head.Head | None = <factory>, diagrams: ~typing.List[~feynml.feynmandiagram.FeynmanDiagram] = <factory>) None

Methods

__init__([version, head, diagrams])

add_rule(rule)

Add a rule to the style.

add_rules(rules)

Add rules to the style.

from_xml(xml)

Load self from XML.

from_xml_file(file)

Load self from XML file.

get_diagram(idd)

get_root()

get_sheet()

Return the sheet.

get_sheets()

Return the sheet.

get_style(obj[, xml])

Get the style of an object.

get_style_property(obj, property_name[, xml])

Get a style property of an object.

render([show])

to_xml()

Return self as XML.

with_root(root)

with_rule(rule)

Replace rules of the style.

with_rules(rules)

Replace rules of the style.

with_sheet(sheet)

Return the object with the sheet.

Attributes

default_sheet

version

head

diagrams

add_rule(rule: str)

Add a rule to the style.

add_rules(rules: str)

Add rules to the style.

classmethod from_xml(xml: str)

Load self from XML.

classmethod from_xml_file(file: str)[source]

Load self from XML file.

get_sheet()[source]

Return the sheet.

get_sheets()[source]

Return the sheet.

get_style(obj, xml=None)[source]

Get the style of an object.

This is prefered over accessing the style attribute directly, since it includes class and pdgid definitions.

get_style_property(obj, property_name, xml: XML | None = None) str

Get a style property of an object.

to_xml() str

Return self as XML.

with_rule(rule: str)

Replace rules of the style.

with_rules(rules: str)

Replace rules of the style.

with_sheet(sheet)[source]

Return the object with the sheet.