Comments (6)
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
This is partially fixed in ffd2e6c, which splits nuncertainty
into three tested strategies:
- remove_uncertainty_from_negative_loss_exchanges
- fix_unreasonably_high_lognormal_uncertainties
- set_lognormal_loc_value
You can override the default cutoff and replacement values in fix_unreasonably_high_lognormal_uncertainties
.
strategies
is just a list; you can delete strategies you don't want easily, e.g.
#!python
from brightway2 import *
from bw2io.strategies.ecospold2 import *
ei = SingleOutputEcospold2Importer("something", "something")
del ei.strategies[ei.strategies.index(set_lognormal_loc_value)]
If you think there needs to be a better interface, please suggest something 😄
from brightway2-io.
Original comment by Pascal Lesage (Bitbucket: MPa, ).
To the solution proposed: Thanks for breaking up the strategy. I am unable to access (and hence delete) the strategy, however:
#!python
>>> ei32cutoff_no_cap = SingleOutputEcospold2Importer(myDir, 'ecoinvent 3.2 cutoff - no uncertainty cap')
>>> ei32cutoff_no_cap.strategies
[<function bw2io.strategies.generic.normalize_units>,
<function bw2io.strategies.ecospold2.remove_zero_amount_coproducts>,
<function bw2io.strategies.ecospold2.remove_zero_amount_inputs_with_no_activity>,
<function bw2io.strategies.ecospold2.remove_unnamed_parameters>,
<function bw2io.strategies.ecospold2.es2_assign_only_product_with_amount_as_reference_product>,
<function bw2io.strategies.ecospold2.assign_single_product_as_activity>,
<function bw2io.strategies.ecospold2.create_composite_code>,
<function bw2io.strategies.biosphere.drop_unspecified_subcategories>,
<function bw2io.strategies.ecospold2.link_biosphere_by_flow_uuid>,
<function bw2io.strategies.ecospold2.link_internal_technosphere_by_composite_code>,
<function bw2io.strategies.ecospold2.delete_exchanges_missing_activity>,
<function bw2io.strategies.ecospold2.delete_ghost_exchanges>,
<function bw2io.strategies.ecospold2.remove_uncertainty_from_negative_loss_exchanges>,
<function bw2io.strategies.ecospold2.fix_unreasonably_high_lognormal_uncertainties>,
<function bw2io.strategies.ecospold2.set_lognormal_loc_value>]
>>> ei32cutoff_no_cap.strategies.index(set_lognormal_loc_value)
`NameError: name 'set_lognormal_loc_value' is not defined
As to proposing a better interface: I don't have a good enough understanding of the use of strategies to actually submit code (not now, anyways), but would offhandedly propose that assigning strategies be done in a way that all strategies are passed by default (ei.apply_strategy(set_lognormal_loc_value=True)
but can be turned off, i.e. ei.apply_strategy(set_lognormal_loc_value=False)
from brightway2-io.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
You are missing the import of the functions:
#!python
from bw2io.strategies.ecospold2 import *
It might be easy to accept **kwargs
in apply_strategies()
, I will think about it.
from brightway2-io.
Original comment by Pascal Lesage (Bitbucket: MPa, ).
Worked wonders.
Note that is seems that the capping of uncertainties is included outside the strategies per se (in the extractor
), though with a cap that is much greater:
#!python
if data["scale"] <= 0 or data["scale"] > 25:
cls.abort_exchange(data)
from brightway2-io.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Added more explicit comments to the extractor in ba745c5. Note that, at least for 3.3, this only changes exchanges where the variance is zero; I don't know how other software would handle those distributions.
from brightway2-io.
Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).
Considering this fixed for now. See also #38.
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
- database writing failed due to unlinked exchanges in ecoinvent 3.10 HOT 4
- 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
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.