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

FrelonSegmenterGui: Extract choose_frame and segment_frame as functions #368

Open
loichuder opened this issue Jan 9, 2025 · 2 comments
Open

Comments

@loichuder
Copy link

For #358

@abmajith did some progress on #358 and would need to reuse some part of the FrelonSegmeterGui but without the Gui.

The two methods we are interested in are the choose_frame method and the segment_frame method. These are not tied to the ipywidgets so we could extract them to reuse them outside of the FrelonSegmeterGui which is tied to Jupyter.

Would that be ok if we extract the relevant code in functions ? We could them call them outside of FrelonSegmeterGui without any functional change to this class ?

Of course, we are happy to discuss this further if you think of another strategy 👍

@loichuder loichuder changed the title Extract choose_frame and segment_frame as functions FrelonSegmenterGui: Extract choose_frame and segment_frame as functions Jan 9, 2025
@jonwright
Copy link
Member

Extracting choose_frame is a good refactoring as it seems to be there twice, for both FrelonSegmenterGui and SegmenterGui.

For segment_frame - this is just calling frelon_peaksearch.worker which is a class with many attributes that come in via the options from the gui. I wonder if you are better off just creating your own worker instance and calling peaksearch on it with your own options? Or maybe we add the function you need within frelon_peaksearch.py.

If you can send a pull request then I don't see any reason not to merge it? Thanks!

@loichuder
Copy link
Author

Thanks for the encouraging words @jonwright !

@abmajith did a MR (#374) for the choose_frame extraction and we are working on the rest 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants