How to use the nwbwidgets.base.lazy_show_over_data function in nwbwidgets

To help you get started, we’ve selected a few nwbwidgets 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 NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / icephys.py View on Github external
Returns
    -------
    widgets.Accordion or widgets.Tabs

    """
    if 'stimulus_type' in node:
        labels, data = zip(*[(stim_label, stim_df)
                             for stim_label, stim_df in node.to_dataframe().groupby('stimulus_type')])
        func_ = show_sweep_sequence_reps
    else:
        data = node['sweeps']
        labels = None
        func_ = show_single_sweep_sequence
    func_ = partial(func_, **kwargs)
    return lazy_show_over_data(data, func_, labels=labels, style=style)
github NeurodataWithoutBorders / nwb-jupyter-widgets / nwbwidgets / file.py View on Github external
elif isinstance(value[0], bytes):
                    lbl_names = widgets.Label(b', '.join(value).decode(), layout=field_lay)
                else:
                    raise ValueError('unrecognized type for experimenter')
            else:
                lbl_names = widgets.Label(value, layout=field_lay)
            hbox_exp = widgets.HBox(children=[lbl_experimenter, lbl_names])
            info.append(hbox_exp)
        elif (isinstance(value, Iterable) and len(value)) or value:
            neuro_data.append(value)
            if hasattr(nwbfile.fields[key], 'description') and nwbfile.fields[key].description:
                labels.append(key + ': ' + nwbfile.fields[key].description)
            else:
                labels.append(key)
    func_ = partial(view.nwb2widget, neurodata_vis_spec=neurodata_vis_spec)
    accordion = lazy_show_over_data(neuro_data, func_, labels=labels, style=widgets.Accordion)

    return widgets.VBox(info + [accordion])