From 14b089d3c5932771101452f5c628d2b0e74b5460 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Sun, 16 Aug 2026 18:10:09 +0200 Subject: [PATCH] improve EIC matching Co-authored-by: stan-buren --- powerplantmatching/matching.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/powerplantmatching/matching.py b/powerplantmatching/matching.py index 0d95018..ea9a4f2 100644 --- a/powerplantmatching/matching.py +++ b/powerplantmatching/matching.py @@ -287,7 +287,12 @@ def reduce_matched_dataframe(df, show_orig_names=False, config=None): "DateRetrofit": "max", "DateOut": "max", "projectID": lambda x: dict(x.droplevel(0).dropna()), - "eic_code": set, + "EIC": lambda x: { + v + for val in x.dropna() + for v in (val if isinstance(val, set) else [val]) + if isinstance(v, str) + }, } ) props_for_groups = pd.Series(props_for_groups)[cols].to_dict()