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

extend reports #257

Merged
merged 9 commits into from
Jun 30, 2023
Merged

extend reports #257

merged 9 commits into from
Jun 30, 2023

Conversation

mwprestonjr
Copy link
Contributor

Addresses #256 by adding all arguments that can be passed to plts.fm.plot_fm().

add all arguments that can be passed to plts.fm.plot_fm().

adresses fooof-tools#256.
this function saves a detailed report for a single model fit within a
FOOOFGroup object
@mwprestonjr
Copy link
Contributor Author

The latter commit (6f185a6) addresses issue #258 .

@mwprestonjr mwprestonjr changed the title add flexibility to save_fm_report() extend reports Mar 24, 2023
@TomDonoghue
Copy link
Member

TomDonoghue commented Mar 27, 2023

Hey @mwprestonjr - thanks for digging into these ideas and creating the PR!

For #256 / adding plot arguments to report plot - I do agree that it would be nice to be able to customize the plots in the reports, and there's not really any reason not to allow this.

Couple thoughts:

  • The arguments would have to be added to FOOOF.save_report as well, right, in order to allow this when using the object method (which I take to be the standard method), rather than when using the separate function.
  • Because this leads to copied input parameters across multiple access points, I think I would suggest doing this by adding a **plt_kwargs keyword input to save_report _fm and to FOOOF.plot. This would be better for maintenance - it means that the report allow for passing through all possible arguments, but they don't have to be individually noted in the report functions, and it means any updates to the plot function wouldn't have to worry about maintaining consistency with upstream use by the report functions.

For #258 / saving individual model reports from a Group object, did you look at the get_fooof method on the group object? I think what you added largely replicates what can be done with that method.

For example, saving a specified individual model from a group object should be do-able like this:
fg.get_fooof(ind=index, regenerate=True).save_report()

I think that should do the same as what you added? (I didn't try running and comparing the code, so let me know if there is some difference I'm not noticing).

I do agree that the above code is not particularly obvious to be able to write out for the average user - so to make this more accessible, maybe FOOOFGroup should be given an extra convenience method for this, something like:

def save_model_report(self, index):
    """"Save out an individual model report for a specified model fit."""
    self.get_fooof(ind=index, regenerate=True).save_report()

@fooof-tools fooof-tools deleted a comment from codecov-commenter Mar 27, 2023
@mwprestonjr
Copy link
Contributor Author

Hey @TomDonoghue. Thanks for the quick response.
For #256: I appreciate the feedback. I will implement this as suggested.
For #258: I somehow missed this method. I think the save_model_report() is a great idea.

@TomDonoghue TomDonoghue added the 1.1 Targetted for a fooof 1.1 release. label Jun 28, 2023
mwprestonjr and others added 3 commits June 29, 2023 15:29
**plot_kwargs added to FOOOF.report, FOOOF.save_report, and save_report_fm.
FOOOF.plot and plot_fm already had a plot_kwargs argument; however, this argument was not accessed in plot_fm so it was removed.
and remove reports.save_report_fg_i
@TomDonoghue
Copy link
Member

Hey @mwprestonjr - I just approved the tests to run, and there seems to be some issue - I think because I'm not sure you actually want to remove the plot_kwargs argument from the plot_fm function?

@fooof-tools fooof-tools deleted a comment from codecov-commenter Jun 29, 2023
@mwprestonjr
Copy link
Contributor Author

mwprestonjr commented Jun 29, 2023

Yes, I think you're right. Adding it back now.

@fooof-tools fooof-tools deleted a comment from codecov-commenter Jun 29, 2023
@fooof-tools fooof-tools deleted a comment from codecov-commenter Jun 29, 2023
@fooof-tools fooof-tools deleted a comment from codecov-commenter Jun 30, 2023
@TomDonoghue TomDonoghue self-requested a review June 30, 2023 04:02
@TomDonoghue
Copy link
Member

Thanks for the work on this @mwprestonjr! Looks good!

I made a couple direct edits to merge this directly so we can include it in 1.1 (small clean ups and adding a test for the new save_model_report) - otherwise, everything looks great! Merging in now!

@TomDonoghue TomDonoghue merged commit b942280 into fooof-tools:main Jun 30, 2023
@mwprestonjr mwprestonjr deleted the flexible_report branch March 8, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.1 Targetted for a fooof 1.1 release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants