Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
73 stars 23 forks source link

CPU core_units is enforced/MODIFY with no evident reason #106

Closed bpetit closed 2 years ago

bpetit commented 2 years ago

Bug description

When using the server route, querying impact by configuration, verbose section shows that core_units value has been to a higher value.

"core_units":{"input_value":4,"used_value":24,"status":"MODIFY"}

API version : 0.1.2

To Reproduce

Use server route with this configuration for the CPU

'cpu': {'core_units': 4, 'family': 'broadwell', 'units': 1}

Expected behavior

core_units (4 in my example) is UNCHANGED in VERBOSE, and effectively used for the calculation.

JSON OUTPUT

{"CPU-1":{"unit":1,"hash":"62006c40c09def866b65156214bb947cea1272b640a25734224d8cb63ff69a08","core_units":{"input_value":4,"used_value":24,"status":"MODIFY"},"die_size_per_core":{"input_value":null,"used_value":0.245,"status":"SET"},"family":{"input_value":"broadwell","used_value":"broadwell","status":"UNCHANGED"},"impacts":{"gwp":{"value":21.7,"unit":"kgCO2eq"},"pe":{"value":325.0,"unit":"MJ"},"adp":{"value":0.02,"unit":"kgSbeq"}}}

da-ekchajzer commented 2 years ago

This is due to the fact that broadwell should be written with a capital letter : Broadwell. In your case the API find 0 match for the CPU and uses the default value.

This will be fixed in 0.2. See : https://github.com/Boavizta/boaviztapi/issues/75