Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spiking activity fails to display #177

Closed
blakecaldwell opened this issue Jan 17, 2020 · 1 comment · Fixed by #294
Closed

Spiking activity fails to display #177

blakecaldwell opened this issue Jan 17, 2020 · 1 comment · Fixed by #294
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@blakecaldwell
Copy link
Member

When running this Param file, "View Simulation Spiking Activity" fails to open a dialog. The error message is below:

(mne) MacBook-Pro:hnn-new blake$ python hnn.py 
Starting simulation (8 cores). . .
making dout: /Users/blake/hnn_out/data/oldControl
Traceback (most recent call last):
  File "visrast.py", line 396, in <module>
    ex = SpikeGUI()
  File "visrast.py", line 276, in __init__
    self.initUI()
  File "visrast.py", line 359, in initUI
    self.initCanvas()
  File "visrast.py", line 345, in initCanvas
    self.m = SpikeCanvas(paramf, self.index, parent = self, width=12, height=10, dpi=getmplDPI())
  File "visrast.py", line 203, in __init__
    self.plot()
  File "visrast.py", line 256, in plot
    if bDrawHist: self.lax.append(drawhist(dhist,self.figure,self.G))
  File "visrast.py", line 122, in drawhist
    ax.plot(np.arange(binsz/2,tstop+binsz/2,binsz),dhist[ty]*fctr,dclr[ty],linestyle='--')
  File "/Users/blake/miniconda3/envs/mne/lib/python3.7/site-packages/matplotlib/__init__.py", line 1867, in inner
    return func(ax, *args, **kwargs)
  File "/Users/blake/miniconda3/envs/mne/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 1528, in plot
    for line in self._get_lines(*args, **kwargs):
  File "/Users/blake/miniconda3/envs/mne/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 406, in _grab_next_args
    for seg in self._plot_args(this, kwargs):
  File "/Users/blake/miniconda3/envs/mne/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 383, in _plot_args
    x, y = self._xy_from_xy(x, y)
  File "/Users/blake/miniconda3/envs/mne/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 242, in _xy_from_xy
    "have shapes {} and {}".format(x.shape, y.shape))
ValueError: x and y must have same first dimension, but have shapes (247,) and (246,)
@blakecaldwell blakecaldwell added bug Something isn't working good first issue Good for newcomers labels Aug 10, 2020
@blakecaldwell
Copy link
Member Author

Bug is still present after #232.

New exception:

Traceback (most recent call last):
  File "hnn.py", line 19, in <module>
    runqt5()
  File "hnn.py", line 15, in runqt5
    sys.exit(app.exec_())
  File "/Users/blake/repos/hnn/hnn/qt_main.py", line 384, in showRasterPlot
    self.show_plot('spike')
  File "/Users/blake/repos/hnn/hnn/qt_main.py", line 356, in show_plot
    'Spike Viewer')
  File "/Users/blake/repos/hnn/hnn/qt_spike.py", line 306, in __init__
    super(SpikeViewGUI, self).__init__(CanvasType, params, sim_data, title)
  File "/Users/blake/repos/hnn/hnn/DataViewGUI.py", line 37, in __init__
    self.initUI()
  File "/Users/blake/repos/hnn/hnn/DataViewGUI.py", line 146, in initUI
    self.initCanvas(True)
  File "/Users/blake/repos/hnn/hnn/DataViewGUI.py", line 119, in initCanvas
    dpi=getmplDPI())
  File "/Users/blake/repos/hnn/hnn/qt_spike.py", line 123, in __init__
    self.plot()
  File "/Users/blake/repos/hnn/hnn/qt_spike.py", line 279, in plot
    self.params['tstop']))
  File "/Users/blake/repos/hnn/hnn/qt_spike.py", line 139, in drawhist
    dhist[ty] * fctr, dclr[ty], linestyle='--')
  File "/Users/blake/miniconda3/envs/hackathon/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 1743, in plot
    lines = [*self._get_lines(*args, data=data, **kwargs)]
  File "/Users/blake/miniconda3/envs/hackathon/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 273, in __call__
    yield from self._plot_args(this, kwargs)
  File "/Users/blake/miniconda3/envs/hackathon/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 399, in _plot_args
    raise ValueError(f"x and y must have same first dimension, but "
ValueError: x and y must have same first dimension, but have shapes (247,) and (246,)

This file needs desperately to be recoded. Many functions could be reused from spikefn.py or even better, from hnn-core. Hi @rythorpe!

I'm following up with a quick fix to this issue.

blakecaldwell pushed a commit to blakecaldwell/hnn that referenced this issue Apr 1, 2021
When tstop is not divisible by 5.0 (global, yuck!), the histogram
that gets created is too small for the x-axis of the plots. Use
ceil() to round up.

Fixes jonescompneurolab#177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant