Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions activity_browser/layouts/tabs/LCA_results_tabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,9 @@ def get_default_demands() -> dict:

amounts = [exch.amount * scale for exch in technosphere if
exch.input.key != exch.output.key]
demands = {keys[i]: amounts[i] for i, _ in enumerate(keys)}
demands = {}
for key, amount in zip(keys, amounts):
demands[key] = demands.get(key, 0) + amount
return demands

def get_scenario_demands() -> dict:
Expand All @@ -1452,7 +1454,10 @@ def get_scenario_demands() -> dict:
amounts.append(_lca.technosphere_matrix[exch_idx, demand_idx] * scale)

# write al non-zero exchanges to demand dict
demands = {keys[i]: amounts[i] for i, _ in enumerate(keys) if amounts[i] != 0}
demands = {}
for key, amount in zip(keys, amounts):
if amount != 0:
demands[key] = demands.get(key, 0) + amount
return demands

# reuse LCA object from original calculation to skip 1 LCA
Expand Down