Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove _roi_ranges dict from SpectrumViewerWindowModel #2297

Closed
Tracked by #2377
JackEAllen opened this issue Jul 31, 2024 · 0 comments · Fixed by #2416, #2423 or #2454
Closed
Tracked by #2377

Remove _roi_ranges dict from SpectrumViewerWindowModel #2297

JackEAllen opened this issue Jul 31, 2024 · 0 comments · Fixed by #2416, #2423 or #2454
Assignees
Labels
Ensemble Add to issues you wish to propose for an ensemble

Comments

@JackEAllen
Copy link
Collaborator

Originally SpectrumViewerWindowModel had the dictionary mapping names to ROIs for the spectrum window. This allows things like get_spectrum() to be passed a name. SpectrumWidget also has a dict of ROIs, which is probably more essential.

This requires code to keep them in sync, and has been a source of issues.

get_spectrum() needed to be updated to be able to receive a SensibleROI for the RITS export, so its less important that the model knows about the names. Maybe it is possible to remove _roi_ranges completely.

Step 1:
In SpectrumViewerWindowModel.get_spectrum() remove the option to call with a str as the name. Update all callers.

Find all other cases where model uses its own list of ROIs. Pass them as arguments instead.

Step N:
Remove set_new_roi, set_roi, get_roi, rename_roi, remove_roi, get_list_of_roi_names from the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment