[docs]classRound(DelayedOp):""" Delayed rounding from :py:meth:`~numpy.round`. This is very similar to :py:class:`~delayedarray.UnaryIsometricOpSimple.UnaryIsometricOpSimple` but accepts an argument for the number of decimal places. This class is intended for developers to construct new :py:class:`~delayedarray.DelayedArray.DelayedArray` instances. End users should not be interacting with ``Round`` objects directly. """
[docs]def__init__(self,seed,decimals:int):""" Args: seed: Any object that satisfies the seed contract, see :py:class:`~delayedarray.DelayedArray.DelayedArray` for details. decimals (int): Number of decimal places, possibly negative. """self._seed=seedself._decimals=decimals
@propertydefshape(self)->Tuple[int,...]:""" Returns: Tuple of integers specifying the extent of each dimension of the ``Round`` object. This is the same as the ``seed`` array. """returnself._seed.shape@propertydefdtype(self)->dtype:""" Returns: NumPy type for the ``Round``, same as the ``seed`` array. """returnself._seed.dtype@propertydefseed(self):""" Returns: The seed object. """returnself._seed@propertydefdecimals(self)->int:""" Returns: Number of decimal places to round to. """returnself._decimals