Args:
            structure: ordered structure
            return_ranked_list: as in other pymatgen Transformations

        Returns: transformed disordered structure(s)

def apply_transformation(self, structure, return_ranked_list=False):
        """
        Args:
            structure: ordered structure
            return_ranked_list: as in other pymatgen Transformations

        Returns: transformed disordered structure(s)
        """

        if not structure.is_ordered:
            raise ValueError("This transformation is for disordered structures only.")

        partitions = self._partition_species(structure.composition,
                                             max_components=self.max_sites_to_merge)
        disorder_mappings = self._get_disorder_mappings(structure.composition, partitions)

        disordered_structures = []
        for mapping in disorder_mappings:
            disordered_structure = structure.copy()
            disordered_structure.replace_species(mapping)
            disordered_structures.append({'structure': disordered_structure,
                                          'mapping': mapping})

        if len(disordered_structures) == 0:
            return None
        elif not return_ranked_list:
            return disordered_structures[0]['structure']
        else:
            if len(disordered_structures) > return_ranked_list:
                disordered_structures = disordered_structures[0:return_ranked_list]
            return disordered_structures