Boavizta / boaviztapi

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

Measure of the maximum coefficient throw a key error CPU Component #30

Closed da-ekchajzer closed 2 years ago

da-ekchajzer commented 2 years ago

Bug description

In component.py

sub['_scope3'] = sub[['core_units', 'die_size_per_core']].apply(lambda x: x[0] * x[1])

throws

raise KeyError(key) from err
KeyError: 0

when

multiple line of cpu.csv are selected and the maximum value have to get selected

Exemple

http:///localhost:5000/v1/component/cpu

{
    "process": 22
}
samuelrince commented 2 years ago

Fixed in fbd9a01. Pandas apply function has the default axis parameter set to 0 (columns). Changing it 1 (i.e. apply on rows) fixes the issue.