Comments (4)
Fixed in 0.8.12
from brightway2-io.
Hi @cmutel Sorry to bother again. I might not be doing this the correct way. I update bw2io and create a new proejct, re-use the codes above but getting the same error. Should I use your import_ecoinvent_release instead?
My brightway2 is 2.4.4 (it says it is not compatible with 0.8.12 though, but I didn't find a newer version)
from brightway2-io.
This seems to have been fixed for legacy, but I can reproduce the error with bw25:
In [1]: import bw2data as bd
In [2]: import bw2io as bi
In [3]: bd.__version__
Out[3]: (4, 0, 'DEV33')
In [4]: bi.__version__
Out[4]: (0, 9, 'DEV26')
In [13]: importer = bi.SingleOutputEcospold2Importer('/home/upolig/Documents/dbs/ecoinvent/3.10/datasets/', 'ecoinvent-3.10-cutoff')
Extracting XML data from 23523 datasets
Extracted 23523 datasets in 38.39 seconds
In [14]: importer.apply_strategies()
Applying strategy: normalize_units
Applying strategy: update_ecoinvent_locations
Applying strategy: remove_zero_amount_coproducts
Applying strategy: remove_zero_amount_inputs_with_no_activity
Applying strategy: remove_unnamed_parameters
Applying strategy: es2_assign_only_product_with_amount_as_reference_product
Applying strategy: assign_single_product_as_activity
Applying strategy: create_composite_code
Applying strategy: drop_unspecified_subcategories
Applying strategy: fix_ecoinvent_flows_pre35
Applying strategy: drop_temporary_outdated_biosphere_flows
Applying strategy: link_biosphere_by_flow_uuid
Applying strategy: link_internal_technosphere_by_composite_code
Applying strategy: delete_exchanges_missing_activity
Applying strategy: delete_ghost_exchanges
Applying strategy: remove_uncertainty_from_negative_loss_exchanges
Applying strategy: fix_unreasonably_high_lognormal_uncertainties
Applying strategy: convert_activity_parameters_to_list
Applying strategy: add_cpc_classification_from_single_reference_product
Applying strategy: delete_none_synonyms
Applying strategy: update_social_flows_in_older_consequential
Applying strategy: set_lognormal_loc_value
Applied 22 strategies in 3.55 seconds
In [15]: importer.statistics()
23523 datasets
743409 exchanges
4034 unlinked exchanges
Type biosphere: 62 unique unlinked exchanges
Out[15]: (23523, 743409, 4034)
from brightway2-io.
As of bw2io version 0.9.DEV26
,
Importing ei 3.10 with ecoinvent_interface β
This works for both, legacy and bw25.
For the "legacy" bw2 io, you need to make sure you have bwio version 0.8.12
exactly, install ecoinvent_interface
and follow the Howto instructions at the bottom of this comment.
Importing ei 3.10 with SingleOutputEcospold2Importer
π³οΈ
- This requires a biosphere db to exist already in the project (this can be done with
bw2setup()
) - the
bw2setup()
function will create a biosphere db compatible with ecoinvent 3.9: from this file, at this point in code:
def create_default_biosphere3(overwrite=False):
from .importers import Ecospold2BiosphereImporter
eb = Ecospold2BiosphereImporter()
eb.apply_strategies()
eb.write_database(overwrite=overwrite)
(because the Ecospold2BiosphereImporter() class will take as default "3.9" as version, and because there's also no "3.10" file.
Hence, when trying to use the SingleOutputEcospold2Importer
to import ecoinvent 3.10, there are unlinked biosphere exchanges. so this leads to π³οΈ
What to do ?
The current solution to add ecoinvent 3.10 to a project, using brightway25 is to use the ecoinvent_interface feature of bw2io
:
Prerequisite
install ecoinvent_interface:
pip install ecoinvent_interface
or
conda install -c conda-forge ecoinvent_interface
Howto
import bw2data as bd
import bw2io as bi
bd.projects.set_current('β-rulez')
bi.import_ecoinvent_release(version="3.10", \
system_model="cutoff", username=( Λ Β³Λ)γΒ°οΎΒΊβq, password=β)
from brightway2-io.
Related Issues (20)
- How to export database with location information of technosphere HOT 1
- [BW2 Legacy] Using older versions of Biosphere HOT 2
- 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 2
- 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
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.