Skip to content

Commit

Permalink
Fix bug with rerunning y-space fit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GuiMacielPereira committed Dec 13, 2024
1 parent 6e733e9 commit 67e1255
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mvesuvio/analysis_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 67e1255

Please sign in to comment.