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

Class _EmptyBinding

dm_control/mjcf/physics.py:403–418  ·  view source on GitHub ↗

The result of binding no `mjcf.Elements` to an `mjcf.Physics` instance.

Source from the content-addressed store, hash-verified

401
402
403class _EmptyBinding:
404 """The result of binding no `mjcf.Elements` to an `mjcf.Physics` instance."""
405
406 __slots__ = ('_arr',)
407
408 def __init__(self):
409 self._arr = np.empty((0))
410
411 def __getattr__(self, name):
412 return self._arr
413
414 def __setattr__(self, name, value):
415 if name in self.__slots__:
416 super().__setattr__(name, value)
417 else:
418 raise ValueError('Cannot assign a value to an empty binding.')
419
420_EMPTY_BINDING = _EmptyBinding()
421

Callers 1

physics.pyFile · 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…