From 67e12554e6ed89963c863aed34ff4808514d4086 Mon Sep 17 00:00:00 2001 From: GuiMacielPereira Date: Fri, 13 Dec 2024 17:49:43 +0000 Subject: [PATCH] Fix bug with rerunning y-space fit Re-running y-space fit with subtraction of fse turned on was picking up the wrong workspace that also ended in 'fse'. This correction guarantees the right workspace is chosen. --- src/mvesuvio/analysis_fitting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mvesuvio/analysis_fitting.py b/src/mvesuvio/analysis_fitting.py index 725e8dd..d866764 100644 --- a/src/mvesuvio/analysis_fitting.py +++ b/src/mvesuvio/analysis_fitting.py @@ -59,9 +59,9 @@ def find_ws_name_fse_first_mass(ic): for ws_name in mtd.getObjectNames(): if ws_name.startswith(prefix) and ws_name.endswith('fse'): name_ending = ws_name.replace(prefix, "") - match = re.search(r'\d+\.?\d*', name_ending) + match = re.search(r'_(\d+(?:\.\d+)?)_', name_ending) if match: # If float found in ws name ending - ws_masses.append(float(match.group())) + ws_masses.append(float(match.group().replace('_', ''))) ws_names_fse.append(ws_name) return ws_names_fse[np.argmin(ws_masses)]