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

Method remove

dm_control/mjcf/element.py:721–738  ·  view source on GitHub ↗

Removes this element from the model.

(self, affect_attachments=False)

Source from the content-addressed store, hash-verified

719 child._check_attachments_on_remove(affect_attachments) # pylint: disable=protected-access
720
721 def remove(self, affect_attachments=False):
722 """Removes this element from the model."""
723 self._check_attachments_on_remove(affect_attachments)
724 if affect_attachments:
725 for attachment in self._attachments.values():
726 attachment.remove(affect_attachments=True)
727 for child in list(self._children):
728 child.remove(affect_attachments)
729 if self._spec.repeated or self._spec.on_demand:
730 self._parent._children.remove(self) # pylint: disable=protected-access
731 for attribute in self._attributes.values():
732 attribute._force_clear() # pylint: disable=protected-access
733 self._parent = None
734 self._is_removed = True
735 else:
736 for attribute in self._attributes.values():
737 attribute._force_clear() # pylint: disable=protected-access
738 self.namescope.increment_revision()
739
740 @property
741 def is_removed(self):

Callers 5

__dir__Method · 0.45
__delattr__Method · 0.45
_detachMethod · 0.45
clearMethod · 0.45
__delitem__Method · 0.45

Calls 4

valuesMethod · 0.80
_force_clearMethod · 0.80
increment_revisionMethod · 0.80

Tested by

no test coverage detected