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

Method to_xml_string

dm_control/mjcf/attribute.py:381–391  ·  view source on GitHub ↗
(self, prefix_root, **kwargs)

Source from the content-addressed store, hash-verified

379 return out_string
380
381 def to_xml_string(self, prefix_root, **kwargs):
382 self._check_dead_reference()
383 if isinstance(self._value, base.Element):
384 return self._value.prefixed_identifier(prefix_root)
385 elif (self.reference_namespace == constants.DEFAULT
386 and self._name != constants.CHILDCLASS):
387 return self._defaults_string(prefix_root)
388 elif self._value:
389 return self._parent.namescope.full_prefix(prefix_root) + self._value
390 else:
391 return None
392
393
394class BasePath(_Attribute):

Callers

nothing calls this directly

Calls 4

_check_dead_referenceMethod · 0.95
_defaults_stringMethod · 0.95
full_prefixMethod · 0.80
prefixed_identifierMethod · 0.45

Tested by

no test coverage detected