-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty characterization matrix arrays for MultiLCA #100
Comments
Hi Timo, I would be interested in the solution to this, since I am facing the same problem. |
@transfluxus I'm on bw2data=4.0.dev45, which is currently the latest version. |
@TimoDiepers |
@TimoDiepers @transfluxus Sorry about this. To support multiple method impact categories with a single list of data objects, we needed to filter the data objects per impact category (and normalization and weighting), which in turn meant that we needed to include the necessary information to apply filtering in the datapackage. I just ran into the same problem, as I hadn't changed my database, so the older datapackage was still being used, but this was missing the needed "name" attribute. Long story short, do this: import bw2data
for method in bw2data.methods:
bw2data.Method(method).process() |
Thanks @cmutel , nice. It runs for me now. However, MultiLCA often results in 0 results:
|
@transfluxus @cmutel My original example works now, but I could also reproduce the zero value above. However, I've come to notice that this only occurs if only one entry is in functional units. If there are two, it seems to work: heat_and_power_act = bd.get_node(database="ecoinvent-3.10-cutoff", name="heat and power co-generation, wood chips, 6667 kW, state-of-the-art 2014", location="DK", unit="kilowatt hour")
functional_units = {
"one": {heat_and_power_act.id: 1},
"two": {heat_and_power_act.id: 1}, # leaving this out results in a score of 0
}
config = {
"impact_categories": [
("EF v3.1", "climate change", "global warming potential (GWP100)"),
],
}
data_objs = bd.get_multilca_data_objs(
functional_units=functional_units, method_config=config
)
mlca = bc.MultiLCA(demands=functional_units, method_config=config, data_objs=data_objs)
mlca.lci()
mlca.lcia()
mlca.scores
# > {(('EF v3.1', 'climate change', 'global warming potential (GWP100)'),
# > 'one'): 0.05507812866658305,
# > (('EF v3.1', 'climate change', 'global warming potential (GWP100)'),
# > 'two'): 0.05507812866658305} |
And I think the problem lies here: brightway2-calc/bw2calc/multi_lca.py Lines 351 to 354 in ef9bac1
|
I'm not sure if this is an actual issue of bw2calc or even an issue at all (maybe I just don't fully understand how the new MultiLCA implementation works, sorry in that case), but I tried using the new MultiLCA calculation and keep getting an AllArraysEmpty Error - for the characterization matrix as it seems. What I did:
If I do a normal LCA with this same data it works just fine.
I tried to look into this but couldn't figure out why this part here in MultiLCA.load_lcia_data returned no values in the arrays:
https://github.com/brightway-lca/brightway2-calc/blob/ef9bac1565488290ccaf5c02e0d09798a9345725/bw2calc/multi_lca.py#L254C1-L260C15
Also, here's the complete error message I get when calling MultiLCA.lcia():
The text was updated successfully, but these errors were encountered: