Comments (3)
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.
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.
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)
- Some extractor methods do not have the `use_mp` flag implemented, causing them to fail. HOT 1
- [BW2 legacy] Error with easy ecoinvent biosphere flows/LCI/LCIA import of bw2io version 0.8.11 HOT 3
- SimaPro CSV importer doesn't fix broken uncertainty values HOT 8
- US EEIO import is broken
- [Discussion/Feature request] Adding `database` field to Linking Iterables by field on import HOT 2
- Excel file import - AttributeError: 'int' object has no attribute 'lower' HOT 1
- Few type hints not compatible with python 3.9 & python 3.8 HOT 1
- Encoding erorr when running `import_ecoinvent_release` on `v3.10` HOT 3
- Backport fix for "chemical formulas" from 0.9.DEV7 to 0.8.X ? HOT 1
- AttributeError in add_missing_cfs(): 'ExcelLCIAImporter' object has no attribute 'biosphere_name' HOT 1
- Importing in BW processes written in SP HOT 2
- errors importing exiobase in monetary units HOT 1
- KeyError in IOTable backend HOT 3
- update README to use cookiecutterlib format
- Configurable multiprocessing for large data import (Ecoinvent ecospold2) HOT 2
- `ExcelImporter` should convert integer codes to strings HOT 5
- minor compatibility issue HOT 2
- WrongDatabase: Activity database must be ecoinvent_3_8, but set() was also found HOT 4
- Missing EXIOBASE importer, cannot import Exiobase3MonetaryImporter from bw2io HOT 2
- Excel exporter uses the process `activity` when exporting ecoinvent, which breaks everything
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brightway2-io.