in analysis/GreenSKU-Framework/src/carbon_model.py [0:0]
def _set_derate_curves(self) -> None:
"""Set the derate curves for the server."""
self.allocated_spec = self.config['spec']
if 'spec_allocation' in self.config['rack']:
self.provisioned_spec = self.config['rack']['spec_allocation']
else:
self.provisioned_spec = self.allocated_spec
for key, value in self.data.items():
if 'spec_derates' not in value:
self.component_derate_curves[key] = lambda x: 1
continue
self.component_derate_curves[key] = fit_cubic(value['spec_derates'])
for key, value in self.data['server'].items():
if 'spec_derates' not in value:
self.component_derate_curves[key] = lambda x: 1
continue
self.component_derate_curves[key] = fit_cubic(value['spec_derates'])
for key, value in self.data['rack'].items():
if 'spec_derates' not in value:
self.component_derate_curves[key] = lambda x: 1
continue
self.component_derate_curves[key] = fit_cubic(value['spec_derates'])
for key, value in self.data['dc'].items():
if 'spec_derates' not in value:
self.component_derate_curves[key] = lambda x: 1
continue
self.component_derate_curves[key] = fit_cubic(value['spec_derates'])