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

New s2p version cannot handle lists of h5 files #1149

Open
oterocoronel opened this issue Oct 4, 2024 · 0 comments
Open

New s2p version cannot handle lists of h5 files #1149

oterocoronel opened this issue Oct 4, 2024 · 0 comments

Comments

@oterocoronel
Copy link

oterocoronel commented Oct 4, 2024

Describe the issue:

If "h5py" in ops is a list, then the function find_files_open_binaries turns it into a list of lists when doing:

fs = [fs]

This causes the following error:

Traceback (most recent call last):

  Cell In[1], line 258
    ops_out = suite2p.run_s2p(ops=ops_folder)

  File ~\miniforge3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py:501 in run_s2p
    ops0 = convert_funs[ops["input_format"]](ops.copy())

  File ~\miniforge3\envs\suite2p\lib\site-packages\suite2p\io\h5.py:54 in h5py_to_binary
    with h5py.File(h5, "r") as f:

  File ~\miniforge3\envs\suite2p\lib\site-packages\h5py\_hl\files.py:536 in __init__
    name = filename_encode(name)

  File ~\miniforge3\envs\suite2p\lib\site-packages\h5py\_hl\compat.py:19 in filename_encode
    filename = fspath(filename)

TypeError: expected str, bytes or os.PathLike object, not list

The issue can be solved by replacing:

fs = [fs]

with:

if not isinstance(fs, list):
                fs = [fs]

I had not experienced this issue in the previous suite2p version

Reproduce the code example:

ops_out = suite2p.run_s2p(ops=ops_folder)

Error message:

No response

Version information:

v0.14.4

Context for the issue:

No response

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

1 participant