Giter Club home page Giter Club logo

Comments (7)

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


Update: error does not occur, if I export an ecoinvent activity as ILCD, convert it to ecospold2, and try to import it into brightway2. Seems, the error occurs because I try to import a custom process with mal-defined geography?

from brightway2.

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


The output file is not valid ecospold2. It is not just the location data, but a lot of different of elements:

#!bash

8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:12: element timePeriod: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}timePeriod': This element is not expected. Expected is one of ( {http://www.EcoInvent.org/EcoSpold02}classification, {http://www.EcoInvent.org/EcoSpold02}geography ).
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:45: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:45: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:48: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:48: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:51: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:51: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:54: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:54: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:57: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:57: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:60: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:60: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:63: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:63: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:66: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:66: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:69: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:69: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:72: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:72: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:75: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:75: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:78: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:78: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:81: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:81: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:84: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:84: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:87: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter', attribute 'id': The attribute 'id' is not allowed.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:87: element parameter: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}parameter': The attribute 'parameterId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:97: element dataEntryBy: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}dataEntryBy': The attribute 'personId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:97: element dataEntryBy: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}dataEntryBy': The attribute 'personName' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:97: element dataEntryBy: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}dataEntryBy': The attribute 'personEmail' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:98: element dataGeneratorAndPublication: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}dataGeneratorAndPublication': The attribute 'personId' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:98: element dataGeneratorAndPublication: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}dataGeneratorAndPublication': The attribute 'personName' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:98: element dataGeneratorAndPublication: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}dataGeneratorAndPublication': The attribute 'personEmail' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:99: element fileAttributes: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}fileAttributes': The attribute 'majorRevision' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold:99: element fileAttributes: Schemas validity error : Element '{http://www.EcoInvent.org/EcoSpold02}fileAttributes': The attribute 'minorRevision' is required but missing.
8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold fails to validate

Unfortunately, there is not much that Brightway can do here. If you expect this to be a major problem, the only real solution would be to write a more lenient extractor that provides default values for missing attributes (e.g. GLO for location).

from brightway2.

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


Could you let me know how you created the log file?

from brightway2.

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


#!bash

xmllint --schema "path/to/EcoSpold02.xsd" --noout 8eb88a18-9ad1-4382-a1d1-99cec36e6a58.spold

You can download the schema from ecoinvent.

from brightway2.

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


Thanks a lot for the hint to xmllint!

Concerning my problem: I found a work around. I will describe it here. Maybe you can make it a section in your documentation or something.

Aim: Export a model from GaBi into Brightway2.

Things I've tried:

Export as tsx -> import in Brightway2 : import of tsx not supported in Brightway2

Export as ecospold1 -> import in Brightway2: not an option because ecospold1 does not support parameters

Export as ILCD -> import in Brightway2: import of ILCD not supported in Brightway2

Export as ILCD -> convert to ecospold2 using OpenLCA conversion tool -> import in brightway2: import crashes with above errors (only for custom activities, ecoinvent activities work)

Export as ILCD -> import into OpenLCA -> export as ecospold2 -> import in brightway2: works!

Looks like OpenLCA import adds the missing attributes. Also export from OpenLCA seems to get the attribute naming right (parameterId instead of id), contrary to the conversion tool. Unfortunately there is no possibility in GaBi to export ecospold2. Would make things a lot easier...

from brightway2.

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


Just realized that the import worked but the mathematical relations in the parameters were not imported. Is there a way to keep the mathematical relations?

from brightway2.

aleksandra-kim avatar aleksandra-kim commented on July 22, 2024

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


It's on the roadmap, and needed for current projects, so it is coming - but is not there yet. Shouldn't be too much of a change, you are welcome to look at the parameter extraction already in bw2io and extend it :)

from brightway2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.