Skip to content

Commit bf9cce9

Browse files
author
Marin Visscher
committed
Fix Product virtual exchanges
1 parent 8f2df49 commit bf9cce9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

bw_functional/node_classes.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def allocate(self, strategy_label: Optional[str] = None) -> None:
333333
Raises:
334334
ValueError: If no allocation strategy is found.
335335
"""
336-
if self.get("skip_allocation") or not self.multifunctional:
336+
if self.get("skip_allocation"):
337337
log.debug(f"Skipping allocation for {repr(self)} (id: {self.id})")
338338
return
339339

@@ -508,15 +508,17 @@ def virtual_edges(self) -> list[dict]:
508508
list[dict]: A list of dictionaries representing the virtual edges.
509509
"""
510510
virtual_exchanges = []
511+
512+
production = self.processing_edge.as_dict()
513+
production["output"] = self.key
514+
virtual_exchanges.append(production)
515+
511516
for exchange in self._edges_class(self.processor.key, ["technosphere", "biosphere"]):
512517
ds = exchange.as_dict()
513518
ds["amount"] = ds["amount"] * self.get("allocation_factor", 1)
514519
ds["output"] = self.key
515520
virtual_exchanges.append(ds)
516521

517-
production = self.processing_edge.as_dict()
518-
production["output"] = self.key
519-
520522
return virtual_exchanges
521523

522524
# def substitute(self, substitute_key: tuple | None = None, substitution_factor=1.0):

0 commit comments

Comments
 (0)