sb-ai-lab / Eco2AI

eco2AI is a python library which accumulates statistics about power consumption and CO2 emission during running code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cast error when converting string to float in get_cpu_percent_linux.

luciabouzaheguerte opened this issue · comments

Hi, i got this error when running the tool (version 0.3.5):

image

when running top command, it shows me the values with commas:

image

Desktop

image

To fix it, i changed line 533 of eco2ai/tools/tools_cpu.py:

from: sum_cpu += float(words[8])
to: sum_cpu += float(words[8].replace(",","."))

Can you add this to the repo? thanks!
Lucía

Thank you for your comment. Your fix has been implemented. You can get the update of eco2AI from PyPi