Sorts the `AmpalContainer` by a tag on the component objects.

        Parameters
        ----------
        tag : str
            Key of tag used for sorting.

def sort_by_tag(self, tag):
        """Sorts the `AmpalContainer` by a tag on the component objects.

        Parameters
        ----------
        tag : str
            Key of tag used for sorting.
        """
        return AmpalContainer(sorted(self, key=lambda x: x.tags[tag]))