How to use the phylib.io.model.load_model function in phylib

To help you get started, we’ve selected a few phylib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cortex-lab / phy / phy / apps / template / gui.py View on Github external
def template_describe(params_path):
    """Describe a template dataset."""
    model = load_model(params_path)
    model.describe()
    model.close()
github cortex-lab / phy / phy / apps / __init__.py View on Github external
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)
github cortex-lab / phy / phy / apps / __init__.py View on Github external
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()
github cortex-lab / phy / phy / apps / template / gui.py View on Github external
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()