Skip to content

Commit

Permalink
assign edge_filter_function if provided
Browse files Browse the repository at this point in the history
  • Loading branch information
muelleram committed Jul 29, 2024
1 parent ea4ae68 commit 7d0745f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bw_timex/timex_lca.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,16 @@ 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."
)
skippable = []
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
Expand Down

0 comments on commit 7d0745f

Please sign in to comment.