MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
348 stars 240 forks source link

BUG: can't initialize new run, unrecognized arguments error in __main__.py #1064

Closed vickerse1 closed 10 months ago

vickerse1 commented 10 months ago

Describe the issue:

When I try to initialize a run I get the following error and suite2p crashes:

ERROR<<< usage: main.py [-h] [--single_plane] [--ops OPS] [--db DB] [--version]

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:

(suite2p_new_Sept0123) C:\WINDOWS\system32>python -m suite2p
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\__init__.py", line 6, in <module>
    from .run_s2p import run_s2p, run_plane, pipeline
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\run_s2p.py", line 15, in <module>
    from . import extraction, io, registration, detection, classification, default_ops
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\extraction\__init__.py", line 5, in <module>
    from .extract import create_masks_and_extract, enhanced_mean_image, extract_traces_from_masks, extraction_wrapper
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\extraction\extract.py", line 11, in <module>
    from .masks import create_masks
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\extraction\masks.py", line 9, in <module>
    from ..detection.sparsedetect import extendROI
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\detection\__init__.py", line 4, in <module>
    from .detect import detect, detection_wrapper, bin_movie
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\detection\detect.py", line 11, in <module>
    from .denoise import pca_denoise
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\detection\denoise.py", line 8, in <module>
    from ..registration.nonrigid import make_blocks, spatial_taper
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\registration\__init__.py", line 4, in <module>
    from .register import (registration_wrapper, save_registration_outputs_to_ops,
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\registration\register.py", line 14, in <module>
    from . import utils, rigid, nonrigid
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\suite2p\registration\nonrigid.py", line 327, in <module>
    def block_interp(ymax1, xmax1, mshy, mshx, yup, xup):
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\decorators.py", line 241, in wrapper
    disp.compile(sig)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\dispatcher.py", line 965, in compile
    cres = self._compiler.compile(args, return_type)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\dispatcher.py", line 125, in compile
    status, retval = self._compile_cached(args, return_type)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\dispatcher.py", line 139, in _compile_cached
    retval = self._compile_core(args, return_type)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\dispatcher.py", line 152, in _compile_core
    cres = compiler.compile_extra(self.targetdescr.typing_context,
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler.py", line 762, in compile_extra
    return pipeline.compile_extra(func)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler.py", line 460, in compile_extra
    return self._compile_bytecode()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler.py", line 528, in _compile_bytecode
    return self._compile_core()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler.py", line 494, in _compile_core
    pm.run(self.state)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler_machinery.py", line 356, in run
    self._runPass(idx, pass_inst, state)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler_lock.py", line 35, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler_machinery.py", line 311, in _runPass
    mutated |= check(pss.run_pass, internal_state)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\compiler_machinery.py", line 273, in check
    mangled = func(compiler_state)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\typed_passes.py", line 466, in run_pass
    lower.lower()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\lowering.py", line 187, in lower
    self.lower_normal_function(self.fndesc)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\lowering.py", line 241, in lower_normal_function
    entry_block_tail = self.lower_function_body()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\lowering.py", line 271, in lower_function_body
    self.lower_block(block)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\lowering.py", line 285, in lower_block
    self.lower_inst(inst)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\parfors\parfor_lowering.py", line 51, in lower_inst
    _lower_parfor_parallel(self, inst)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\parfors\parfor_lowering.py", line 58, in _lower_parfor_parallel
    return _lower_parfor_parallel_std(lowerer, parfor)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\parfors\parfor_lowering.py", line 372, in _lower_parfor_parallel_std
    call_parallel_gufunc(
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\parfors\parfor_lowering.py", line 1957, in call_parallel_gufunc
    context.active_code_library.add_linking_library(info.library)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\codegen.py", line 720, in add_linking_library
    library._ensure_finalized()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\codegen.py", line 567, in _ensure_finalized
    self.finalize()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\codegen.py", line 762, in finalize
    self._optimize_final_module()
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\numba\core\codegen.py", line 682, in _optimize_final_module
    self._codegen._mpm_full.run(self._final_module)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\llvmlite\binding\passmanagers.py", line 683, in run
    return ffi.lib.LLVMPY_RunPassManager(self, module)
  File "C:\ProgramData\Anaconda3\envs\suite2p_new_Sept0123\lib\site-packages\llvmlite\binding\ffi.py", line 152, in __call__
    return self._cfn(*args, **kwargs)
KeyboardInterrupt
^C
(suite2p_new_Sept0123) C:\WINDOWS\system32>cd D:\Mesoscope_Analysis_IV_May27_2021-\E295_A1V1M2\test

(suite2p_new_Sept0123) C:\WINDOWS\system32>d:

(suite2p_new_Sept0123) D:\Mesoscope_Analysis_IV_May27_2021-\E295_A1V1M2\test>python -m suite2p
D:/Mesoscope_Analysis_IV_May27_2021-/E295_A1V1M2/spont_2_before_DOI/suite2p/plane0/stat.npy
no channel 2 labels found (redcell.npy)
time to draw and plot masks:  2.3180 sec
loaded default ops
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 25.3M/25.3M [00:01<00:00, 24.4MB/s]
{'data_path': ['D:/Mesoscope_Analysis_IV_May27_2021-/E295_A1V1M2/test'], 'subfolders': [], 'save_path0': 'D:/Mesoscope_Analysis_IV_May27_2021-/E295_A1V1M2/test/out', 'fast_disk': 'D:/Mesoscope_Analysis_IV_May27_2021-/E295_A1V1M2/test/fast_disk', 'input_format': 'tif'}
Running suite2p with command:
python -u -W ignore -m suite2p --ops C:\Users\McCormick Lab\.suite2p\ops\ops.npy --db C:\Users\McCormick Lab\.suite2p\ops\db.npy

Error message:

>>>ERROR<<<
usage: __main__.py [-h] [--single_plane] [--ops OPS] [--db DB] [--version]
                   [--suite2p_version SUITE2P_VERSION]
                   [--look_one_level_down LOOK_ONE_LEVEL_DOWN]
                   [--fast_disk FAST_DISK] [--delete_bin DELETE_BIN]
                   [--mesoscan MESOSCAN] [--bruker BRUKER]
                   [--bruker_bidirectional BRUKER_BIDIRECTIONAL] [--h5py H5PY]
                   [--h5py_key H5PY_KEY] [--nwb_file NWB_FILE]
                   [--nwb_driver NWB_DRIVER] [--nwb_series NWB_SERIES]
                   [--save_path0 SAVE_PATH0] [--save_folder SAVE_FOLDER]
                   [--subfolders SUBFOLDERS] [--move_bin MOVE_BIN]
                   [--nplanes NPLANES] [--nchannels NCHANNELS]
                   [--functional_chan FUNCTIONAL_CHAN] [--tau TAU] [--fs FS]
                   [--force_sktiff FORCE_SKTIFF]
                   [--frames_include FRAMES_INCLUDE]
                   [--multiplane_parallel MULTIPLANE_PARALLEL]
                   [--ignore_flyback IGNORE_FLYBACK]
                   [--preclassify PRECLASSIFY] [--save_mat SAVE_MAT]
                   [--save_NWB SAVE_NWB] [--combined COMBINED]
                   [--aspect ASPECT] [--do_bidiphase DO_BIDIPHASE]
                   [--bidiphase BIDIPHASE] [--bidi_corrected BIDI_CORRECTED]
                   [--do_registration DO_REGISTRATION]
                   [--two_step_registration TWO_STEP_REGISTRATION]
                   [--keep_movie_raw KEEP_MOVIE_RAW] [--nimg_init NIMG_INIT]
                   [--batch_size BATCH_SIZE] [--maxregshift MAXREGSHIFT]
                   [--align_by_chan ALIGN_BY_CHAN] [--reg_tif REG_TIF]
                   [--reg_tif_chan2 REG_TIF_CHAN2] [--subpixel SUBPIXEL]
                   [--smooth_sigma_time SMOOTH_SIGMA_TIME]
                   [--smooth_sigma SMOOTH_SIGMA] [--th_badframes TH_BADFRAMES]
                   [--norm_frames NORM_FRAMES] [--force_refImg FORCE_REFIMG]
                   [--pad_fft PAD_FFT] [--nonrigid NONRIGID]
                   [--block_size BLOCK_SIZE [BLOCK_SIZE ...]]
                   [--snr_thresh SNR_THRESH] [--maxregshiftNR MAXREGSHIFTNR]
                   [--1Preg 1PREG] [--spatial_hp_reg SPATIAL_HP_REG]
                   [--pre_smooth PRE_SMOOTH] [--spatial_taper SPATIAL_TAPER]
                   [--roidetect ROIDETECT] [--spikedetect SPIKEDETECT]
                   [--sparse_mode SPARSE_MODE] [--spatial_scale SPATIAL_SCALE]
                   [--connected CONNECTED] [--nbinned NBINNED]
                   [--max_iterations MAX_ITERATIONS]
                   [--threshold_scaling THRESHOLD_SCALING]
                   [--max_overlap MAX_OVERLAP] [--high_pass HIGH_PASS]
                   [--spatial_hp_detect SPATIAL_HP_DETECT] [--denoise DENOISE]
                   [--anatomical_only ANATOMICAL_ONLY] [--diameter DIAMETER]
                   [--cellprob_threshold CELLPROB_THRESHOLD]
                   [--flow_threshold FLOW_THRESHOLD]
                   [--spatial_hp_cp SPATIAL_HP_CP]
                   [--pretrained_model PRETRAINED_MODEL]
                   [--soma_crop SOMA_CROP]
                   [--neuropil_extract NEUROPIL_EXTRACT]
                   [--inner_neuropil_radius INNER_NEUROPIL_RADIUS]
                   [--min_neuropil_pixels MIN_NEUROPIL_PIXELS]
                   [--lam_percentile LAM_PERCENTILE]
                   [--allow_overlap ALLOW_OVERLAP]
                   [--use_builtin_classifier USE_BUILTIN_CLASSIFIER]
                   [--classifier_path CLASSIFIER_PATH]
                   [--chan2_thres CHAN2_THRES] [--baseline BASELINE]
                   [--win_baseline WIN_BASELINE] [--sig_baseline SIG_BASELINE]
                   [--prctile_baseline PRCTILE_BASELINE] [--neucoeff NEUCOEFF]
__main__.py: error: unrecognized arguments: Lab\.suite2p\ops\ops.npy Lab\.suite2p\ops\db.npy
Interrupted by error (not finished)

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

vickerse1 commented 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.

when i did the install things went well, but i failed the following test with either test method:

python setup.py test:

FAILED tests/smoke/test_cli.py::test_cli_reg_metrics_runs_with_output - AssertionError: assert ''


pytest -vs test:

FAILED tests/smoke/test_cli.py::test_cli_reg_metrics_runs_with_output - AssertionError: assert ''

thanks,

evan

vickerse1 commented 10 months ago

Hi, Do you have any insights into this? Thanks, Evan

chriski777 commented 10 months ago

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")?

chriski777 commented 10 months ago

Closing this as it's related to #1066.

vickerse1 commented 10 months ago

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: @.***>

chriski777 commented 10 months ago

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.

vickerse1 commented 10 months ago

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}"'

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: @.***>

vickerse1 commented 10 months ago

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}"'

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: @.***>

chriski777 commented 10 months ago

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"

vickerse1 commented 10 months ago

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: @.***>

vickerse1 commented 10 months ago

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