brightway-lca / brightway2-io

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

Cannot import ELCD3.2 database. #52

Open aleksandra-kim opened 6 years ago

aleksandra-kim commented 6 years ago

Original report by Mario Duarte Gamas (Bitbucket: mariojfdgamas, ).


Cannot import ELCD3.2 database (processes), invalid filename.

(Also, how can I import LCIAmethods?)

#!python

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\MARIO DUARTE\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bw2io\importers\ecospold1.py", line 68, in __init__
    self.data = Ecospold1DataExtractor.extract(filepath, db_name)
  File "C:\Users\MARIO DUARTE\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bw2io\extractors\ecospold1.py", line 59, in extract
    for p in results
  File "C:\Users\MARIO DUARTE\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bw2io\extractors\ecospold1.py", line 60, in <listcomp>
    for x in p.get()
  File "C:\Users\MARIO DUARTE\AppData\Local\Programs\Python\Python36-32\lib\multiprocessing\pool.py", line 644, in get
    raise self._value
NameError: name 'filename' is not defined

Example dataset:

aleksandra-kim commented 6 years ago

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Thanks for the bug report Mario!

Unfortunately, we don't have the extractor to process the ILCD XML format. This would be a substantial new chunk of work, and to be honest it isn't very exciting work, either, so no one has volunteered for it. You can get an example of what would be needed by looking at the extractor for ecospold2.

There would be one more problem in using ELCD - because ELCD has its own system of naming things, none of the "builtin" data for elementary flows or LCIA methods would work. You would need to find and import LCIA methods, presumably in another XML format.

So, until you (or someone else) does this engineering work, or provides ELCD in a much simpler format, we can't integrate ELCD datasets.

aleksandra-kim commented 5 years ago

Original comment by Benjamin W. Portner (Bitbucket: pommespapst, GitHub: pommespapst).


@mariojfdgamas Have you tried importing the data in OpenLCA, then exporting as ecospold2, then importing into brightway2?

aleksandra-kim commented 4 years ago

Original comment by Kristian Rönn (Bitbucket: zero0nee, GitHub: zero0nee).


@{5ac490f8295e614dda80798e} Perhaps use this tool. http://www.openlca.org/format-converter

mfastudillo commented 1 year ago

we are currently testing an importer for the ILCD format, using the mapping from ILCD to biosphere3 provided in the GLAD initiative.

We are testing with some examples in the GLAD web but a substantial number of elementary flows is lost in the process. Perhaps the JRC and ecoinvent (@cmutel ?) can improve the mapping.

mfastudillo commented 1 year ago

ok, little by little the importer of ilcd files is getting along. But it requires quite hefty files from GLAD https://github.com/UNEP-Economy-Division/GLAD-ElementaryFlowResources/ .. would it make sense to add it as a dependency instead of putting those big files in the data folder of bw2io ? @cmutel @tngTUDOR

tngTUDOR commented 1 year ago

Work is on the way towards adding data required by bw2io in an alternative manner. This is, by allowing bw2io to download required data.