mhhennig / HS2

Software for high density electrophysiology
GNU General Public License v3.0
26 stars 17 forks source link

`probe.py` path does not exist error when `RecordingExtractor` is called from SpikeToolkit #43

Closed jamesjun closed 5 years ago

jamesjun commented 5 years ago

probes and probe_info directories do not exist and create_probe_files function throws an error when it tries to write to the file. I suggest following changes to probe.py functions.

OLD:

def in_probes_dir(file): return os.path.join(this_file_path, 'probes', file)

JJJ: directory created if not exist

def in_probe_info_dir(file): return os.path.join(this_file_path, 'probe_info', file)


NEW:

def in_probes_dir(file): str_dir = os.path.join(this_file_path, 'probes') if not os.path.isdir(str_dir): os.mkdir(str_dir) return os.path.join(str_dir, file)

def in_probe_info_dir(file): str_dir = os.path.join(this_file_path, 'probe_info') if not os.path.isdir(str_dir): os.mkdir(str_dir)
return os.path.join(str_dir, file)