def convert_units()

in analysis/GreenSKU-Framework/src/carbon_model.py [0:0]


def convert_units(data: Dict[str, Any]) -> Dict[str, Any]:
    for key in data:
        if not isinstance(data[key], str):
            continue
        if key == 'power':
            data[key] = strip_power(data[key])
        elif key == 'size':
            if data[key].endswith('GB'):
                data[key] = float(data[key].replace('GB', ''))
            elif data[key].endswith('TB'):
                data[key] = float(data[key].replace('TB', ''))*1000
    return data