holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.71k stars 403 forks source link

Errors in importing Holoviews: No module named 'holoviews.ipython ; #4508

Closed Hanbing1999 closed 4 years ago

Hanbing1999 commented 4 years ago

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc) bokeh 2.1.1 python 3.7.7 panel 0.9.7 jupyter 1.0.0 jupyterlab 2.1.5 jupyterlab-server 1.1.5 browser: Chrome windows 10

Description of expected behavior and the observed behavior

When importing the holoviews, it is reported that No module named 'holoviews.ipython ;

# Import our plotting toolbox, and enable options for embedded notebook figures import holoviews as hv; %reload_ext holoviews.ipython ; %output widgets='embed';

philippjfr commented 4 years ago

Could you also post the HoloViews version you are trying?

Hanbing1999 commented 4 years ago

Could you also post the HoloViews version you are trying?

The version of holoviews is 1.13.3.

Hanbing1999 commented 4 years ago

Could you also post the HoloViews version you are trying?

Actually, I now resolved this problem. But another problem occurs, I am unable to see the output figure in Jupyter notebook (in terms of Suite2p). It seems the data can be processed, but just cannot be plotted. image

jlstevens commented 4 years ago

Could you post a screenshot of what is displayed (if anything) below the cell when you run it? From your screenshot above, it does look like the extension has loaded.

Hanbing1999 commented 4 years ago

%%opts Curve {+axiswise}

def plot_cell_regions(roi_polys, plot_neuropil=False): ''' Plot a single cell region, using holoviews. ''' out = hv.Overlay()

if plot_neuropil:
    # Plot the neuropil as well as the ROI
    n_region = len(roi_polys)
else:
    # Just plot the ROI, not the neuropil
    n_region = 1

for i_region in range(n_region):
    for part in roi_polys[i_region]:
        x = part[:, 1]
        y = part[:, 0]
        out *= hv.Curve(zip(x, y)).opts(color='w')

return out

i_trial = 0

Generate plots for all detected regions

region_plots = { i_cell: plot_cell_regions(exp.roi_polys[i_cell][i_trial]) for i_cell in range(exp.nCell) }

Generate plots for raw extracts and neuropil removed

traces_plots = { i_cell: hv.Curve(exp.raw[i_cell][i_trial][0, :], label='suite2p') * hv.Curve(exp.result[i_cell][i_trial][0, :], label='FISSA') for i_cell in range(exp.nCell) }

Generate average image

avg_img = hv.Raster(exp.means[i_trial])

Generate overlay plot showing each cell location

cell_locs = hv.Overlay() for c in range(exp.nCell): roi_poly = exp.roi_polys[c][i_trial][0][0] x = roi_poly[:, 1] y = roi_poly[:, 0] cell_locs *= hv.Curve(zip(x, y))

Render holoviews

avg_img cell_locs hv.HoloMap(region_plots, kdims=['Cell']) + hv.HoloMap(traces_plots, kdims=['Cell'])

Hanbing1999 commented 4 years ago

Could you post a screenshot of what is displayed (if anything) below the cell when you run it? From your screenshot above, it does look like the extension has loaded. Hi, I now can load the holoviews .

But it seems that the extraction process is a little bit strange, since it lacks some lines like 'NMF converged after 1158 iterations.' I only got the following lines: image

Besides, when plotting, it turns out a IndexError: list index out of range in the line of average image. image

Could you please help me deal with it? Thanks for your help!

jbednar commented 4 years ago

Those don't sound like HoloViews-related errors; seems like something in your own code, to me.

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.