def makeBundlesDictFromList(bundleList):
    """Utility to convert a list of MetricBundles into a dictionary, keyed by the fileRoot names.

    Raises an exception if the fileroot duplicates another metricBundle.
    (Note this should alert to potential cases of filename duplication).

    Parameters
    ----------
    bundleList : list of MetricBundles
    """
    bDict = {}
    for b in bundleList:
        if b.fileRoot in bDict:
            raise NameError('More than one metricBundle is using the same fileroot, %s' % (b.fileRoot))
        bDict[b.fileRoot] = b
    return bDict