feynml.feynml.FeynML
- class feynml.feynml.FeynML(version: Optional[str] = '0.2.26', head: Optional[feynml.head.Head] = <factory>, diagrams: List[feynml.feynmandiagram.FeynmanDiagram] = <factory>)[source]
Bases:
SheetHandler
,XML
- __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
()Return the sheet.
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.
- 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.