Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def template_describe(params_path):
"""Describe a template dataset."""
model = load_model(params_path)
model.describe()
model.close()
def cli_alf_convert(ctx, subdirs, out_dir):
"""Convert an ephys dataset into ALF. If several directories are specified, it is assumed
that each directory contains the data for one probe of the same recording."""
from phylib.io.alf import EphysAlfCreator
from phylib.io.merge import Merger
from phylib.io.model import load_model
out_dir = Path(out_dir)
if len(subdirs) >= 2:
# Merge in the `merged` subdirectory inside the output directory.
m = Merger(subdirs, out_dir / '_tmp_merged')
model = m.merge()
else:
model = load_model(Path(subdirs[0]) / 'params.py')
c = EphysAlfCreator(model)
c.convert(out_dir)
def template_extract_waveforms(ctx, params_path): # pragma: no cover
"""Extract spike waveforms."""
from phylib.io.model import load_model
model = load_model(params_path)
model.save_spike_waveforms()
model.close()
def template_gui(params_path, **kwargs): # pragma: no cover
"""Launch the Template GUI."""
# Create a `phy.log` log file with DEBUG level.
p = Path(params_path)
dir_path = p.parent
_add_log_file(dir_path / 'phy.log')
create_app()
controller = TemplateController(model=load_model(params_path), dir_path=dir_path, **kwargs)
gui = controller.create_gui()
gui.show()
run_app()
gui.close()
controller.model.close()