neurodroid / haussmeister

Handling 2-photon imaging datasets in Python
7 stars 7 forks source link

Check if ops['fast_disk'] is empty #3

Closed sblumenstock closed 4 years ago

sblumenstock commented 4 years ago

In the current version, fast_disk is not overwritten if it contains an empty list, which produces the following error if suite2p.run_s2p is called without a declared fast_disk parameter:

\envs\suite2p\lib\site-packages\haussmeister\haussio.py in tosuite2p(self, ops) [line 309]
      307             if ('fast_disk' not in ops) or len(ops['fast_disk'])>0:
      308                 ops['fast_disk'] = ops['save_path0']
--> 309             ops['fast_disk'] = os.path.join(ops['fast_disk'], 'suite2p', 'plane%d'%j)

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

By changing the operator, it should fix the problem. In the meantime, we've found a workaround, which is to set ops['fast_disk'] to the same as ops['save_path0'] when calling run_s2p().

neurodroid commented 4 years ago

Thank you very much for the patch!