MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / to_xml

Method to_xml

dm_control/mjcf/element.py:1116–1132  ·  view source on GitHub ↗
(self, prefix_root=None, debug_context=None,
             *,
             precision=constants.XML_DEFAULT_PRECISION,
             zero_threshold=0,
             filename_with_hash=True)

Source from the content-addressed store, hash-verified

1114 __slots__ = []
1115
1116 def to_xml(self, prefix_root=None, debug_context=None,
1117 *,
1118 precision=constants.XML_DEFAULT_PRECISION,
1119 zero_threshold=0,
1120 filename_with_hash=True):
1121 xml_element = (super().to_xml(prefix_root, debug_context,
1122 precision=precision,
1123 zero_threshold=zero_threshold,
1124 filename_with_hash=filename_with_hash))
1125 if self.spec.namespace is not None:
1126 if self.name:
1127 name = (self._parent.prefixed_identifier(prefix_root) +
1128 self.name + constants.PREFIX_SEPARATOR)
1129 else:
1130 name = self._parent.prefixed_identifier(prefix_root)
1131 xml_element.set('name', name)
1132 return xml_element
1133
1134 def prefixed_identifier(self, prefix_root=None):
1135 if self.name:

Callers

nothing calls this directly

Calls 3

setMethod · 0.80
to_xmlMethod · 0.45
prefixed_identifierMethod · 0.45

Tested by

no test coverage detected