From 00b6dace7edf250bdcb5d2cd0b2f38a2717b1605 Mon Sep 17 00:00:00 2001 From: Alexander Puck Neuwirth Date: Tue, 20 Feb 2024 15:38:35 +0100 Subject: [PATCH] fix: Do not overwrite `rwgt` weights with `weights` weights Hotfix for #230 --- src/pylhe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pylhe/__init__.py b/src/pylhe/__init__.py index 8f92e1a3..657f6239 100644 --- a/src/pylhe/__init__.py +++ b/src/pylhe/__init__.py @@ -354,7 +354,7 @@ def read_lhe_with_attributes(filepath): read_lhe_init(filepath) ) for i, w in enumerate(sub.text.split()): - if w: + if w and not index_map[i] in eventdict["weights"]: eventdict["weights"][index_map[i]] = float(w) if sub.tag == "rwgt": for r in sub: