def _get_group_trajectories(self, group_name, sids):
        r"""Compute the trajectory results for `group_name` containing the
        samples `sids`.

        Weights the data if `self._weighted` is True and ``len(sids) > 1``

        Parameters
        ----------
        group_name : str
            The name of the group
        sids : list of str
            The sample ids in the group

        Returns
        -------
        GroupResults
            The trajectory results for the given group

        Raises
        ------
        RuntimeError
            If sids is an empty list
        """
        # We multiply the coord values with the prop_expl
        trajectories = self._coords.ix[sids] * self._prop_expl

        if trajectories.empty:
            # Raising a RuntimeError since in a usual execution this should
            # never happen. The only way this can happen is if the user
            # directly calls this method, which shouldn't be done
            # (that's why the method is private)
            raise RuntimeError("No samples to process, an empty list cannot "
                               "be processed")

        # The weighting can only be done over trajectories with a length
        # greater than 1
        if self._weighted and len(sids) > 1:
            trajectories_copy = deepcopy(trajectories)
            try:
                trajectories = _weight_by_vector(trajectories_copy,
                                                 self._weighting_vector[sids])
            except (FloatingPointError, __HOLE__):
                self._message_buffer.append("Could not weight group, no "
                                            "gradient in the the "
                                            "weighting vector.\n")
                trajectories = trajectories_copy

        return self._compute_trajectories_results(group_name,
                                                  trajectories.ix[sids])
dataset/ETHPy150Open biocore/scikit-bio/skbio/stats/gradient.py/GradientANOVA._get_group_trajectories