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

Error running fg.fit and fg.save_report #12

Open
caroline-kelsey opened this issue May 27, 2024 · 1 comment
Open

Error running fg.fit and fg.save_report #12

caroline-kelsey opened this issue May 27, 2024 · 1 comment

Comments

@caroline-kelsey
Copy link

Hello! I hope this finds you well. Thank you so much for creating an R based tutorial for specparam. I am more than happy to provide any additional details needed to recreate this code. For reference, I am running R (version 4.3) on a PC computer. Thank you so much for your help.

I am running through the example and am getting stuck at fg.save_report

Here is the line: fg.save_report('EOP_demo', file_path = 'C:/Users/carol/Desktop/EEG/Infancy_Foof/Output')

Here is the error message:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\carol\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\fooof\objs\group.py", line 409, in save_report
save_report_fg(self, file_name, file_path)
File "C:\Users\carol\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\fooof\core\modutils.py", line 180, in wrapped_func
func(*args, **kwargs)
File "C:\Users\carol\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\fooof\core\reports.py", line 88, in save_report_fg
results_str = gen_results_fg_str(fg)
File "C:\Users\carol\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\fooof\core\strings.py", line 352, in gen_results_fg_str
n_peaks = len(fg.get_params('peak_params'))
File "C:\Users\carol\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\fooof\objs\group.py", line 378, in get_params
out = np.array([np.insert(getattr(data, name), 3, index, axis=1)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (60,) + inhomogeneous part.

@TomDonoghue
Copy link
Member

Hey @caroline-kelsey - do you know what version of fooof you have installed? I think that error relates to a change in numpy that has now been addressed in a new version of fooof - so if you are on version 1.0.0 (or older), I think you just need to update to 1.1.0

Can you try updating fooof, by running the following in terminal:
pip install -U fooof

Hopefully that fixes it - let me know if not!

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