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

Function _get_namespace

dm_control/mjcf/physics.py:654–665  ·  view source on GitHub ↗

Returns the element namespace string.

(element)

Source from the content-addressed store, hash-verified

652
653
654def _get_namespace(element):
655 """Returns the element namespace string."""
656 # The worldbody is treated as a member of the `body` namespace.
657 if element.tag == 'worldbody':
658 namespace = 'body'
659 else:
660 namespace = element.spec.namespace.split(constants.NAMESPACE_SEPARATOR)[0]
661 # Mocap bodies have distinct attributes so we use a dummy namespace for
662 # them.
663 if namespace == 'body' and element.mocap == 'true':
664 namespace = 'mocap_body'
665 return namespace

Callers 1

names_from_elementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…