Giter Site home page Giter Site logo

Comments (3)

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

Original comment by Pascal Lesage (Bitbucket: MPa, ).


Importing datasets with electricity inputs expressed in MJ breaks import with this error:

C:\bw2-python\envs\bw2\lib\site-packages\bw2data\backends\peewee\database.py in _efficient_write_many_data(self, data, indices)
156 for exchange in ds.get('exchanges', []):
157 if 'input' not in exchange or 'amount' not in exchange:
--> 158 raise InvalidExchange
159 if 'type' not in exchange:
160 raise UntypedExchange

InvalidExchange:

from brightway2-io.

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

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


This is basically impossible to fix - at least for me, with my current knowledge and skills.

We already do some conversions to default units.

However, the example you give is exactly what makes it difficult. MJ and kWh are both used for energy in common practice and ecoinvent. So there is no "default" energy unit. As far as I know, SimaPro does provide unit conversions (see the end of the CSV file), but doesn't specify which unit process should use which conversion to match against ecoinvent. I think this is because SimaPro uses a different strategy to match against ecoinvent - we use a combination of name, product, unit, etc.

So, basically this is a known issue, but I have no idea how to fix it. Our guidance is to not use unit conversions in SimaPro.

from brightway2-io.

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

Original comment by Pascal Lesage (Bitbucket: MPa, ).


Understood.
However, given that importing datasets from SimaPro that have MJ as unit for exchanges results in import failure, perhaps a clunky strategy like if 'electricity' in exchange['name'] and exchange['unit'] == 'MJ' then exchange['unit'] = 'kWh' and exchange['amount'] = exchange['amount'] * 1/3.6
I can't think of cases where this would break (but perhaps there are).

from brightway2-io.

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.