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

Method replace

dm_control/mjcf/namescope.py:177–190  ·  view source on GitHub ↗

Reassociates an identifier with a different object. Args: namespace: A string specifying the namespace to which the identifier belongs. identifier: The identifier string. obj: The object referred to by the identifier. Raises: ValueError: If `identifier` not

(self, namespace, identifier, obj)

Source from the content-addressed store, hash-verified

175 self.increment_revision()
176
177 def replace(self, namespace, identifier, obj):
178 """Reassociates an identifier with a different object.
179
180 Args:
181 namespace: A string specifying the namespace to which the
182 identifier belongs.
183 identifier: The identifier string.
184 obj: The object referred to by the identifier.
185
186 Raises:
187 ValueError: If `identifier` not valid.
188 """
189 self._assign(namespace, identifier, obj)
190 self.increment_revision()
191
192 def remove(self, namespace, identifier):
193 """Removes an identifier from this name scope.

Callers 10

__init__Method · 0.80
get_observableMethod · 0.80
testAttachMethod · 0.80
_parse_childrenFunction · 0.80
_assignMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80
shorten_namesFunction · 0.80

Calls 2

_assignMethod · 0.95
increment_revisionMethod · 0.95

Tested by 2

testAttachMethod · 0.64