From 128fca9cf9c44217ef97d9becdef0bc469130399 Mon Sep 17 00:00:00 2001 From: Arthur Jakobs Date: Thu, 11 Jul 2024 16:55:01 +0200 Subject: [PATCH] small optimisation in biospherebuilder --- bw_timex/dynamic_biosphere_builder.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bw_timex/dynamic_biosphere_builder.py b/bw_timex/dynamic_biosphere_builder.py index f405c08..0388fce 100644 --- a/bw_timex/dynamic_biosphere_builder.py +++ b/bw_timex/dynamic_biosphere_builder.py @@ -172,7 +172,7 @@ def build_dynamic_biosphere_matrix( if from_timeline: demand = self.demand_from_timeline(row, original_db) else: - demand = self.demand_from_technosphere(idx) + demand = self.demand_from_technosphere(idx, process_col_index) self.lca_obj.redo_lci(demand) @@ -232,11 +232,10 @@ def demand_from_timeline(self, row, original_db): demand[timed_act_id] = amount return demand - def demand_from_technosphere(self, idx): + def demand_from_technosphere(self, idx, process_col_index): """ Returns a demand dict based on the technosphere colummn. """ - process_col_index = self.activity_dict[idx] # get the matrix column index technosphere_column = ( self.technosphere_matrix[:, process_col_index].toarray().ravel() ) # 1-d np.array