def index_nic_data()

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


def index_nic_data(nic_bandwidth: str, data_source: str="data_sources") -> Dict[str, Any]:
    nic_data = read_yaml(join_path(data_source, 'NIC.yaml'))
    data = None
    for nic_bandwidth_data in nic_data['bandwidths']:
        if nic_bandwidth_data['bandwidth'] != nic_bandwidth:
            continue
        data = nic_bandwidth_data
        data['spec_derates'] = nic_data['spec_derates']
        if 'carbon' not in data:
            data['carbon'] = 0.0
        return data
    raise ValueError(f'NIC data not found for {nic_bandwidth}')