Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EF 3.1 import from simapro #209

Open
ccomb opened this issue Aug 23, 2023 · 4 comments
Open

EF 3.1 import from simapro #209

ccomb opened this issue Aug 23, 2023 · 4 comments

Comments

@ccomb
Copy link
Contributor

ccomb commented Aug 23, 2023

Using 0.9.DEV21, I'm trying to import an Environmental Footprint 3.1 method which is different from the one included in Brightway.

At the end of the Method section, there is a normalization and weighting set that look like this:

Method

Name
Environmental Footprint 3.1 (adapted) patch wtu

Version  
1;00

(..........)

Normalization-Weighting set
EF 3.1 normalization and weighting set

Normalization
Acidification;1,79954697817319E-2
Climate change;1,32396265000545E-4
Ecotoxicity, freshwater;1,76315265883092E-5
Particulate matter;1,67963676260898E3
Eutrophication, marine;5,11635053040380E-2
Eutrophication, freshwater;6,22334801314516E-1
Eutrophication, terrestrial;5,65754859095399E-3
Human toxicity, cancer;5,79612781610433E4                                                                                                                                                                                                     Human toxicity, non-cancer;7,76785093849270E3
Ionising radiation;2,36957650107588E-4
Land use;1,22025895949292E-6                                                                                                                                                                                                                  Ozone depletion;1,91027866641876E1
Photochemical ozone formation;2,44742935603176E-2
Resource use, fossils;1,53836072461811E-5
Resource use, minerals and metals;1,57176814608394E1
Water use;8,71937749334747E-5

Weighting
Acidification;0,062
Climate change;0,2106
Ecotoxicity, freshwater;0,0192
Particulate matter;0,0896
Eutrophication, marine;0,0296
Eutrophication, freshwater;0,028
Eutrophication, terrestrial;0,0371
Human toxicity, cancer;0,0213
Human toxicity, non-cancer;0,0184
Ionising radiation;0,0501
Land use;0,0794
Ozone depletion;0,0631
Photochemical ozone formation;0,0478
Resource use, fossils;0,0832
Resource use, minerals and metals;0,0755
Water use;0,0851

End

When importing it with the simapro_lcia_csv extractor, I get this error:

Traceback (most recent call last):
  File "/home/jovyan/ecobalyse/data/import_method.py", line 62, in <module>
    main()
  File "/home/jovyan/ecobalyse/data/import_method.py", line 56, in main
    import_method()
  File "/home/jovyan/ecobalyse/data/import_method.py", line 33, in import_method
    ef = bw2io.importers.SimaProLCIACSVImporter(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/bw2io/importers/simapro_lcia_csv.py", line 61, in __init__
    self.data = SimaProLCIACSVExtractor.extract(filepath, delimiter, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/bw2io/extractors/simapro_lcia_csv.py", line 85, in extract
    ds, index = cls.read_method_data_set(lines, index, filepath)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/bw2io/extractors/simapro_lcia_csv.py", line 239, in read_method_data_set
    nw_dataset, index = cls.get_normalization_weighting_data(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/bw2io/extractors/simapro_lcia_csv.py", line 419, in get_normalization_weighting_data
    assert data[index][0] == "Weighting"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

At this moment, data[index][0] is equal to "Normalization".
In the code there is a comment:
# TODO: Only works for weighting data, no addition or normalization

@ccomb
Copy link
Contributor Author

ccomb commented Aug 23, 2023

(I'm not sure how to fix this)

@cmutel
Copy link
Member

cmutel commented Aug 24, 2023

Can you make the CSV file available somewhere? We can update the importer but the SimaPro CSVs are unpredictable, we need actual data (including outside the provided section) to write tests and make sure things are reasonable.

@ccomb
Copy link
Contributor Author

ccomb commented Aug 24, 2023

I uploaded the file here: https://nextcloud.prelab.fr/index.php/s/Mao3AQaMPSL6xFs

@tfardet
Copy link

tfardet commented Nov 3, 2023

I have the same issue with SimaProLCIACSVImporter on the SImaPro files from Impact World+: https://zenodo.org/records/8200703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants