polca / wurst Goto Github PK
View Code? Open in Web Editor NEWCode and metadata for linking life cycle assessment databases to other models
License: Other
Code and metadata for linking life cycle assessment databases to other models
License: Other
REGIONS = [(row, ws.cell(row=row, column=2).value) for row in range(5, 47)]
Brian found an error, it is taking the data until line 45 (index 46) missing the last line of the data with RoW. So it should be 47 instead of 46 in the line of code.
the current oil electricity filters have to exclude nuclear, because 'boiling water reactor' is also selected here.
oil_open_cycle_electricity = [
contains('name', 'oil'),
contains('name', 'electricity'),
equals('unit', 'kilowatt hour'),
exclude(contains('name', 'combined cycle')),
]
oil_combined_cycle_electricity = [
contains('name', 'oil'),
contains('name', 'electricity'),
equals('unit', 'kilowatt hour'),
contains('name', 'combined cycle'),
]
oil_chp_electricity = [
contains('name', 'oil'),
contains('name', 'heat and power'),
equals('unit', 'kilowatt hour'),
]
the gas open cycle and biomass CHP filters both have _combined_cycle in them, which causes them to not work.
I tried to test the copy_to_new_location function but I got a keyerror message. The code was the following
import wurst as w
boiler_ch=w.get_one(db,
w.searching.contains('name', 'light fuel oil'),
w.searching.contains('name', '10kW condensing'),
w.searching.equals('location', 'CH'),
)
boiler_qc=w.copy_to_new_location(boiler_ch,'CA-QC')
db is a version of ecoinvent 3.3 cutoff. get_one correctly identifies the activity , but I get a couple of messages (one an error) when executing copy_to_new_location
Successfully switched activity dataset to new code
c9cc73b5becb4509804660ec8abf00e9
KeyError: 'exchanges'
I am using the following versions: wurst==0.1.dev2; brightway2==2.1.1
please let me know if you prefer that I post it as a question in stackoverflow instead opening an issue here.
At least, by the Brightway2 exporter, which calls in order:
which raises an error.
here is the current code:
'parameters': {key: value['amount'] for key, value in proxy.data.get('parameters', {}).items()}
This means that in an unimported ecoinvent I would access the efficiency value with something like:
ds['parameters']['efficiency']['amount']
but if I export with wurst, I have to access the same parameter with:
ds['parameters']['efficiency']
The function empty_high_voltage_markets should also delete all imports of electricity.
I have written my own function to delete all electricity inputs (except own consumption). it looks like this and seems to work:
def delete_electricity_inputs_from_market(ds):
# This function reads through an electricity market dataset and deletes all electricity inputs that are not
# own consumption.
ds['exchanges'] = list(get_many(
ds['exchanges'],
either(
exclude(contains('unit', 'kilowatt hour')),
contains('name', 'market for electricity, high voltage'),
contains('name', 'market for electricity, medium voltage'),
contains('name', 'market for electricity, low voltage'),
contains('name', 'electricity voltage transformation')
)
))
return ds
When trying one of the example notebooks, I ran into issues when using ecoinvent 3.4. Is wurst compatible with ecoinvent 3.4?
data = w.extract_brightway2_databases(["ecoinvent 3.4 cutoff"])
AttributeError: 'list' object has no attribute 'items'
In the current schema, an activity has the field name
in its metadata, but this same field is called activity
in the exchange metadata. We can call it name
in both cases - this decreases cognitive load and unpleasant surprises.
Reported by @brianlcox
Hi Chris,
We need the efficiency parameter extracted with the database!
I have found (so far) three different ways that the efficiency parameter could be labelled:
['parameters']['efficiency']['amount']
['parameters']['efficiency_oil_country']['amount']
['parameters']['efficiency_electrical']['amount']
Sometimes it's also hidden in the comments section, but there isn't much we can do about that...
Thanks,
Brian
Trying to execute the marginal mixes wurst notebook example but got an error
ImportError: cannot import name 'ECOINVENT_ORDERED_GEO' from 'wurst.ecoinvent'
I see also that others have encountered the same issue. I contacted Laurant Vandepaer, who has no solution.
It seems that the wurst/ecoinvent/init_.py file is empty as per 28 sept 2017. I found the previuos file version in the commit history. copied the lines of code into my local init_.py file to resolve the issue.
I wanted to share this workaround in case others might be interested. I am new to github, and don't know how to contribute this? hence i made this post. Is it correct understood that I should make a "pull request" for the commit of 28 sept 2017, which deleted all lines of code from the init_.py file? I cant figure out how to do this :-)
Best regards, Simon
Hi Chris, the example for the above mentioned function is wrong. You have filters for biosphere and technosphere exchanges, but you are using 'name' as the key instead of 'activity'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.