From 7d0745f3b8580dcd3999a1f5a57f7abdc175195f Mon Sep 17 00:00:00 2001 From: muelleram Date: Mon, 29 Jul 2024 13:05:07 +0200 Subject: [PATCH] assign edge_filter_function if provided --- bw_timex/timex_lca.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bw_timex/timex_lca.py b/bw_timex/timex_lca.py index 760ec5c..5df96ca 100644 --- a/bw_timex/timex_lca.py +++ b/bw_timex/timex_lca.py @@ -182,7 +182,7 @@ def build_timeline( bw_timex.timeline_builder.TimelineBuilder: Class that builds the timeline. """ - if not edge_filter_function: + if edge_filter_function is None: warnings.warn( "No edge filter function provided. Skipping all edges within background databases." ) @@ -190,6 +190,8 @@ def build_timeline( for db in self.database_date_dict_static_only.keys(): skippable.extend([node.id for node in bd.Database(db)]) self.edge_filter_function = lambda x: x in skippable + else: + self.edge_filter_function = edge_filter_function self.temporal_grouping = temporal_grouping self.interpolation_type = interpolation_type