brightway-lca / brightway2-io

Importing and exporting for the Brightway LCA framework
BSD 3-Clause "New" or "Revised" License
26 stars 41 forks source link

Impossible to import an exchange which unit name is a Python builtin object #120

Open sc-gcoste opened 2 years ago

sc-gcoste commented 2 years ago

When trying to import an exchange which unit name is a Python builtin object (ex: min), the parsing function crashes raising a TypeError. This is due to this line in the to_number() function:

return float(eval(obj.replace(",", ".").strip()))

I think that catching the TypeError solves the problem.

sc-gcoste commented 2 years ago

product_in_minutes.CSV