Repository: ManimCommunity/manim
File: manim/mobject/matrix.py (Python)

Code before:
            Mobject to use, by default DecimalNumber
        element_to_mobject_config : dict, optional
            Config for the desired mobject, by default {"num_decimal_places": 1}
        """
        Matrix.__init__(
            self,
            matrix,
            element_to_mobject=element_to_mobject,
            element_to_mobject_config=element_to_mobject_config,
            **kwargs,
        )


class IntegerMatrix(Matrix):
    """A mobject that displays a matrix with integer entries on the screen."""

    def __init__(self, matrix, element_to_mobject=Integer, **kwargs):
        """
        Note- Will round if there are decimal entries in the matrix.

        Parameters
        ----------
        matrix : typing.Iterable
            A numpy 2d array or list of lists
        element_to_mobject : Mobject, optional
            Mobject to use, by default Integer
        """
        Matrix.__init__(self, matrix, element_to_mobject=element_to_mobject, **kwargs)


class MobjectMatrix(Matrix):
    """A mobject that displays a matrix of mobject entries on the screen."""

    def __init__(self, matrix, element_to_mobject=lambda m: m, **kwargs):
        Matrix.__init__(self, matrix, element_to_mobject=element_to_mobject, **kwargs)


def get_det_text(
    matrix, determinant=None, background_rect=False, initial_scale_factor=2
):
    r"""Helper function to create determinant

    Parameters
    ----------
    matrix : :class:`~.Matrix`
        The matrix whose determinant is to be created

    determinant : :class:`int|str`
        The value of the determinant of the matrix

    background_rect : :class:`bool`

Review comment (suggestion):
```suggestion
        matrix : :class:`typing.Iterable`
            A numpy 2d array or list of lists
        element_to_mobject : :class:`Mobject`, optional
            Mobject to use, by default Integer
```

Code after:
            Mobject to use, by default DecimalNumber
        element_to_mobject_config : Dict[:class:`str`, :class:`~.Mobject`], optional
            Config for the desired mobject, by default {"num_decimal_places": 1}
        """
        Matrix.__init__(
            self,
            matrix,
            element_to_mobject=element_to_mobject,
            element_to_mobject_config=element_to_mobject_config,
            **kwargs,
        )


class IntegerMatrix(Matrix):
    """A mobject that displays a matrix with integer entries on the screen."""

    def __init__(self, matrix, element_to_mobject=Integer, **kwargs):
        """
        Note- Will round if there are decimal entries in the matrix.

        Parameters
        ----------
        matrix : :class:`typing.Iterable`
            A numpy 2d array or list of lists
        element_to_mobject : :class:`~.Mobject`, optional
            Mobject to use, by default Integer
        """
        Matrix.__init__(self, matrix, element_to_mobject=element_to_mobject, **kwargs)


class MobjectMatrix(Matrix):
    """A mobject that displays a matrix of mobject entries on the screen."""

    def __init__(self, matrix, element_to_mobject=lambda m: m, **kwargs):
        Matrix.__init__(self, matrix, element_to_mobject=element_to_mobject, **kwargs)


def get_det_text(
    matrix, determinant=None, background_rect=False, initial_scale_factor=2
):
    r"""Helper function to create determinant

    Parameters
    ----------
    matrix : :class:`~.Matrix`
        The matrix whose determinant is to be created

    determinant : :class:`int|str`
        The value of the determinant of the matrix

    background_rect : :class:`bool`