Closed BenPortner closed 3 years ago
Problem: At least one ecospold file (electricity production, natural gas, conventional power plant, TH
) contains an empty synonym tag <synonym xml:lang="en" />
. This causes an error when importing ecoinvent:
File "C:\Users\benjamin.portner\programs\miniconda\envs\bw_dev\lib\site-packages\bw2data\search\indices.py", line 33, in _format_dataset
synonyms=u", ".join(ds.get("synonyms", [])).lower(),
TypeError: sequence item 0: expected str instance, NoneType found
Proposed mitigation:
Create a strategy to replace "synonyms": [None]
with "synonyms": []
In ecoinvent3, there is no activity
PTFE production
but when searching forPTFE
in ecoquery, one finds an activitytetrafluoroethylene film production, on glass
that seems to mean the same thing. Ecoquery find's it, because it includes synonyms in the search index. Brightway does not, hence the activity cannot be found. To improve search in brightway, I suggest parsing synonyms from the ecospold files and adding them to the search index. This requires changes in bw2io and bw2data:None
synonyms from ecospold2 data