def serialize_attractor(info):
    """Turn an attractor (in describe_attractor format) into an object tree that can be serialized to JSON."""
    if isinstance(info, dict):
        for species in info['species']:
            ftpeaks = list(species['ftpeaks'].items())
            species['peaks'] = [int(fp[0]) for fp in ftpeaks]
            species['prominences'] = [float(fp[1]) for fp in ftpeaks]
            del species['ftpeaks']
        info['orbit'] = [[float(x) for x in r] for r in info['orbit']]
        return info
    else:
        return list(info)