Repository: ManimCommunity/manim
File: manim/scene/vector_space_scene.py (Python)

Code before:
        positions/mobjects are left on screen

        Parameters
        ----------
        pieces
            The pieces for which the movement must be shown.

        Returns
        -------
        Animation
            The animation of the movement.
        """

        v_pieces = [piece for piece in pieces if isinstance(piece, VMobject)]
        start = VGroup(*v_pieces)
        target = VGroup(*(mob.target for mob in v_pieces))
        # NOTE other possible solution:
        """
        start = Group(*pieces)
        target = Group(*(mob.target for mob in pieces))
        """
        # NOTE JasonGrace said that there is another possible solution
        """
        - self.mobject = mobject if mobject is not None else Mobject()
        + self.mobject = mobject if mobject is not None else VMobject()
        """
        # don't add empty VGroups
        if self.leave_ghost_vectors and start.submobjects:
            # start.copy() gives a VGroup of Vectors
            self.ghost_vectors.add(start.copy().fade(0.7))
            self.add(self.ghost_vectors[-1])
        return Transform(start, target, lag_ratio=0)

    def get_moving_mobject_movement(self, func: Callable[[np.ndarray], np.ndarray]):
        """
        This method returns an animation that moves a mobject
        in "self.moving_mobjects"  to its corresponding .target value.
        func is a function that determines where the .target goes.

        Parameters
        ----------

        func
            The function that determines where the .target of
            the moving mobject goes.

        Returns
        -------
        Animation
            The animation of the movement.
        """

Review comment (suggestion):
```suggestion
```
This should not be added to the source code


Code after:
        positions/mobjects are left on screen

        Parameters
        ----------
        pieces
            The pieces for which the movement must be shown.

        Returns
        -------
        Animation
            The animation of the movement.
        """

        v_pieces = [piece for piece in pieces if isinstance(piece, VMobject)]
        start = VGroup(*v_pieces)
        target = VGroup(*(mob.target for mob in v_pieces))

        # don't add empty VGroups
        if self.leave_ghost_vectors and start.submobjects:
            # start.copy() gives a VGroup of Vectors
            self.ghost_vectors.add(start.copy().fade(0.7))
            self.add(self.ghost_vectors[-1])
        return Transform(start, target, lag_ratio=0)

    def get_moving_mobject_movement(self, func: Callable[[np.ndarray], np.ndarray]):
        """
        This method returns an animation that moves a mobject
        in "self.moving_mobjects"  to its corresponding .target value.
        func is a function that determines where the .target goes.

        Parameters
        ----------

        func
            The function that determines where the .target of
            the moving mobject goes.

        Returns
        -------
        Animation
            The animation of the movement.
        """
        for m in self.moving_mobjects:
            if m.target is None:
                m.target = m.copy()
            target_point = func(m.get_center())
            m.target.move_to(target_point)
        return self.get_piece_movement(self.moving_mobjects)

    def get_vector_movement(self, func: Callable[[np.ndarray], np.ndarray]):
        """