Closed vickerse1 closed 10 months ago
It looks like the classifier and ops paths are in my user folder by default, but this path (i'm in windows 10) unfortunately includes a space character that is hard for me to change.
Can I move the classifier and ops folders in .suite2p to be in the C:/ base folder or something, or just manually add quotes around the path or change it so that the space is included as a literal string in the path? where would i do this in the code?
by the way this is still a bug with the newest developer version, which i just installed.
python setup.py test:
FAILED tests/smoke/test_cli.py::test_cli_reg_metrics_runs_with_output - AssertionError: assert ''
pytest -vs test:
thanks,
evan
Hi, Do you have any insights into this? Thanks, Evan
Hi @vickerse1, you should be able to move/copy your ops and classifier files to some easier directory to work with. You can specify the path to those files using the command line arguments --ops
and --classifier_path
when calling suite2p. Also, does the command above not work if you just surround the specified path with quotes (ie, "C:\Users\McCormick Lab\.suite2p\ops\ops.npy"
)?
Closing this as it's related to #1066.
Hi,
I tried those things already, and I get the illegal indents and spaces error I mentioned earlier. Do you have any idea why changing the location/path produces this error?
I also tried installing suite2p under a different admin account, and got the same errors...
I will try again and give you more details tomorrow when I'm back at work.
Thanks,
Evan
Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Chris Ki @.> Sent: Sunday, December 10, 2023 12:07:03 PM To: MouseLand/suite2p @.> Cc: Evan Vickers @.>; Mention @.> Subject: Re: [MouseLand/suite2p] BUG: can't initialize new run, unrecognized arguments error in main.py (Issue #1064)
Hi @vickerse1https://urldefense.com/v3/__https://github.com/vickerse1__;!!C5qS4YX3!ENnXTRWs1XpFt0U_uyFOF-H9dhWVNuVqMGo5qj2UOWTy-w6f6zEsq_PLUi67HJut0wTv1wNahtbcfHkzTJ_G6G8Bl8Wf$, you should be able to move/copy your ops and classifier files to some easier directory to work with. You can specify the path to those files using the command line arguments --ops and --classifier_path when calling suite2p. Also, does the command above not work if you just surround the specified path with quotes (ie, "C:\Users\McCormick Lab.suite2p\ops\ops.npy")?
— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/MouseLand/suite2p/issues/1064*issuecomment-1849068530__;Iw!!C5qS4YX3!ENnXTRWs1XpFt0U_uyFOF-H9dhWVNuVqMGo5qj2UOWTy-w6f6zEsq_PLUi67HJut0wTv1wNahtbcfHkzTJ_G6IEZjC6O$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AJGCDZQKKL3QN4DSBSUWXDTYIYI6PAVCNFSM6AAAAABAABYTA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA3DQNJTGA__;!!C5qS4YX3!ENnXTRWs1XpFt0U_uyFOF-H9dhWVNuVqMGo5qj2UOWTy-w6f6zEsq_PLUi67HJut0wTv1wNahtbcfHkzTJ_G6Mj2Sx4z$. You are receiving this because you were mentioned.Message ID: @.***>
Hi @vickerse1, Python files don't allow the mixing of tabs and spaces in the .py file. This is different from Matlab which doesn't really care. I've noticed in the error you posted:
print(self.db)
print("Running suite2p with command:")
cmd = f'-u -W ignore -m suite2p --ops "{ops_file}" --db "{db_file}"'
#cmd = f"-u -W ignore -m suite2p --ops {ops_file} --db {db_file}"
print("python " + cmd)
that the line Carsen suggested adding is not aligned with the print statements above. To prevent this error, it should look something like:
print(self.db)
print("Running suite2p with command:")
cmd = f'-u -W ignore -m suite2p --ops "{ops_file}" --db "{db_file}"'
print("python " + cmd)
Notice how all the lines are aligned. If you have any indentations, make sure to either only use tabs OR 4 spaces. Python does NOT let you mix tabs and spaces.
Ok i'll try that
I already noticed the alignment issue and tried to fix it as you mentioned, but u can try again
I guess they should all be tabs in this case?
-evan
Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Chris Ki @.> Sent: Sunday, December 10, 2023 12:49:09 PM To: MouseLand/suite2p @.> Cc: Evan Vickers @.>; Mention @.> Subject: Re: [MouseLand/suite2p] BUG: can't initialize new run, unrecognized arguments error in main.py (Issue #1064)
Hi @vickerse1https://urldefense.com/v3/__https://github.com/vickerse1__;!!C5qS4YX3!BVMS15cUDKPkIVMJBW5OqCXZft7moM-8NJiphOxKTFhbbjp0dN53U2rqauEhp6AFbmaMr0hCcjFA_9v-g64F4tB-x1iS$, Python files don't allow the mixing of tabs and spaces in the .py file. This is different from Matlab which doesn't really care. I've noticed in the error you posted:
print(self.db) print("Running suite2p with command:") cmd = f'-u -W ignore -m suite2p --ops "{ops_file}" --db "{db_file}"'
print("python " + cmd)
that the line Carsen suggested adding is not aligned with the print statements above. To prevent this error, it should look something like:
print(self.db)
print("Running suite2p with command:")
cmd = f'-u -W ignore -m suite2p --ops "{ops_file}" --db "{db_file}"'
print("python " + cmd)
Notice how all the lines are aligned. If you have any indentations, make sure to either only use tabs OR 4 spaces. Python does NOT let you mix tabs and spaces.
— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/MouseLand/suite2p/issues/1064*issuecomment-1849080413__;Iw!!C5qS4YX3!BVMS15cUDKPkIVMJBW5OqCXZft7moM-8NJiphOxKTFhbbjp0dN53U2rqauEhp6AFbmaMr0hCcjFA_9v-g64F4t2t7DBh$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AJGCDZTCGYCTUYUUS62NVFLYIYN4LAVCNFSM6AAAAABAABYTA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA4DANBRGM__;!!C5qS4YX3!BVMS15cUDKPkIVMJBW5OqCXZft7moM-8NJiphOxKTFhbbjp0dN53U2rqauEhp6AFbmaMr0hCcjFA_9v-g64F4pCBwRFg$. You are receiving this because you were mentioned.Message ID: @.***>
Also when you say "does the command not work with just quotes...." which exact command are you referring to? The one in the .py file? Can you send me the exact code so i can just copy paste it? Or are you referring to the run command in which case can you also send me the full literal command to copy paste?
Thanks,
Evan
Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Evan Vickers @.> Sent: Sunday, December 10, 2023 12:54:52 PM To: MouseLand/suite2p @.> Subject: Re: [MouseLand/suite2p] BUG: can't initialize new run, unrecognized arguments error in main.py (Issue #1064)
Ok i'll try that
I already noticed the alignment issue and tried to fix it as you mentioned, but u can try again
I guess they should all be tabs in this case?
-evan
Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Chris Ki @.> Sent: Sunday, December 10, 2023 12:49:09 PM To: MouseLand/suite2p @.> Cc: Evan Vickers @.>; Mention @.> Subject: Re: [MouseLand/suite2p] BUG: can't initialize new run, unrecognized arguments error in main.py (Issue #1064)
Hi @vickerse1https://urldefense.com/v3/__https://github.com/vickerse1__;!!C5qS4YX3!BVMS15cUDKPkIVMJBW5OqCXZft7moM-8NJiphOxKTFhbbjp0dN53U2rqauEhp6AFbmaMr0hCcjFA_9v-g64F4tB-x1iS$, Python files don't allow the mixing of tabs and spaces in the .py file. This is different from Matlab which doesn't really care. I've noticed in the error you posted:
print(self.db) print("Running suite2p with command:") cmd = f'-u -W ignore -m suite2p --ops "{ops_file}" --db "{db_file}"'
print("python " + cmd)
that the line Carsen suggested adding is not aligned with the print statements above. To prevent this error, it should look something like:
print(self.db)
print("Running suite2p with command:")
cmd = f'-u -W ignore -m suite2p --ops "{ops_file}" --db "{db_file}"'
print("python " + cmd)
Notice how all the lines are aligned. If you have any indentations, make sure to either only use tabs OR 4 spaces. Python does NOT let you mix tabs and spaces.
— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/MouseLand/suite2p/issues/1064*issuecomment-1849080413__;Iw!!C5qS4YX3!BVMS15cUDKPkIVMJBW5OqCXZft7moM-8NJiphOxKTFhbbjp0dN53U2rqauEhp6AFbmaMr0hCcjFA_9v-g64F4t2t7DBh$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AJGCDZTCGYCTUYUUS62NVFLYIYN4LAVCNFSM6AAAAABAABYTA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA4DANBRGM__;!!C5qS4YX3!BVMS15cUDKPkIVMJBW5OqCXZft7moM-8NJiphOxKTFhbbjp0dN53U2rqauEhp6AFbmaMr0hCcjFA_9v-g64F4pCBwRFg$. You are receiving this because you were mentioned.Message ID: @.***>
This is the same command Carsen posted in #1066:
python -u -W ignore -m suite2p --ops "C:\Users\McCormick Lab\.suite2p\ops\ops.npy" --db "C:\Users\McCormick Lab\.suite2p\ops\db.npy"
Hi Chris,
Yes I'm sure then that I just copy pasted this command and still got the indentation and spaces error when I try to start a new run.
I will try again I guess, but I don't know why this would be an issue from the command line. It makes sense that it might be an issue when changing the .py file.
Can't the source code just be modified to load the ops file correctly even when there's a space in the path name? It was always like this before...this is only an issue for me now when I upgraded to the new version.
Thanks,
Evan
Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Chris Ki @.> Sent: Sunday, December 10, 2023 12:59:55 PM To: MouseLand/suite2p @.> Cc: Evan Vickers @.>; Mention @.> Subject: Re: [MouseLand/suite2p] BUG: can't initialize new run, unrecognized arguments error in main.py (Issue #1064)
This is the same command Carsen posted in #1066https://urldefense.com/v3/__https://github.com/MouseLand/suite2p/issues/1066__;!!C5qS4YX3!HaUzc3UkBVQ7JcynHJsUC0C_6tmkzBrKIwdWencmMBbm-JFrmY7fGdizIjfolSf3QaS7wmNNeSZW3E3vwvJQaLyUt23u$:
python -u -W ignore -m suite2p --ops "C:\Users\McCormick Lab.suite2p\ops\ops.npy" --db "C:\Users\McCormick Lab.suite2p\ops\db.npy"
— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/MouseLand/suite2p/issues/1064*issuecomment-1849083027__;Iw!!C5qS4YX3!HaUzc3UkBVQ7JcynHJsUC0C_6tmkzBrKIwdWencmMBbm-JFrmY7fGdizIjfolSf3QaS7wmNNeSZW3E3vwvJQaBkO0kWM$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AJGCDZTX4QV6BQOTKYN6PADYIYPD3AVCNFSM6AAAAABAABYTA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA4DGMBSG4__;!!C5qS4YX3!HaUzc3UkBVQ7JcynHJsUC0C_6tmkzBrKIwdWencmMBbm-JFrmY7fGdizIjfolSf3QaS7wmNNeSZW3E3vwvJQaEjbqBRD$. You are receiving this because you were mentioned.Message ID: @.***>
Hi,
I want to change the code so that this is not a problem anymore.
That way I can do runs in the GUI.
The change that Carsen suggested in rungui.py no longer produces an error after changing the indentation to all spaces instead of tab.
However, there is somewhere else in the code still calling the path with the space in it, without using quotes.
You suggested that this might be in run_s2p.py. Could you please tell me where? I cannot find it.
Hopefully someday we are online at the same time so I can fix this issue. : )
Thanks,
Evan
Describe the issue:
When I try to initialize a run I get the following error and suite2p crashes:
main.py: error: unrecognized arguments: Lab.suite2p\ops\ops.npy Lab.suite2p\ops\db.npy Interrupted by error (not finished)
Can you help me?
Reproduce the code example:
Error message:
Version information:
Sept 01 2023 github
Context for the issue:
i may have saved current ops as new default ops yesterday, not sure if this is related. i tried reverting to built in ops, didn't work. also tried using older version of suite2p (different environment), got same error
thanks,
evan