def get_dict_capex()

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


def get_dict_capex(components: Dict[str, Any], cost='carbon', factor: float=1.0, 
                   server_lifetime: float=-1) -> float:
    """Calculate the capex cost of a component.

    Args:
        components: A dictionary containing the components' cost and number.

    Returns:
        The capex cost of the server.
    """
    total_capex = 0
    for key, component in components.items():
        total_capex += get_capex_from_dict(component,
                                           cost=cost,
                                           factor=factor,
                                           server_lifetime=server_lifetime)
    return total_capex