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

Handle case if benchmark results contain only one simulation #27

Open
jhnnsnk opened this issue Dec 10, 2021 · 0 comments · May be fixed by #30
Open

Handle case if benchmark results contain only one simulation #27

jhnnsnk opened this issue Dec 10, 2021 · 0 comments · May be fixed by #30
Assignees
Labels
enhancement New feature or request

Comments

@jhnnsnk
Copy link
Collaborator

jhnnsnk commented Dec 10, 2021

Raises currently an IndexError:

Traceback (most recent call last):
  File "../analysis/analysis.py", line 50, in <module>
    plot(
  File "/p/project/cjinb33/jinb3320/repositories/beNNch/analysis/plot_helper.py", line 59, in plot
    B.plot_fractions(axis=ax1,
  File "/p/project/cjinb33/jinb3320/repositories/beNNch/plot/benchplot/bench_plot.py", line 247, in plot_fractions
    axis.fill_between(np.squeeze(self.df[self.x_axis]),
  File "/p/software/jurecadc/stages/2020/software/SciPy-Stack/2021-gcccoremkl-10.3.0-2021.2.0-Python-3.8.5/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-linux-x86_64.egg/matplotlib/__init__.py", line 1438, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/p/software/jurecadc/stages/2020/software/SciPy-Stack/2021-gcccoremkl-10.3.0-2021.2.0-Python-3.8.5/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-linux-x86_64.egg/matplotlib/axes/_axes.py", line 5301, in fill_between
    return self._fill_between_x_or_y(
  File "/p/software/jurecadc/stages/2020/software/SciPy-Stack/2021-gcccoremkl-10.3.0-2021.2.0-Python-3.8.5/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-linux-x86_64.egg/matplotlib/axes/_axes.py", line 5229, in _fill_between_x_or_y
    for idx0, idx1 in cbook.contiguous_regions(where):
  File "/p/software/jurecadc/stages/2020/software/SciPy-Stack/2021-gcccoremkl-10.3.0-2021.2.0-Python-3.8.5/lib/python3.8/site-packages/matplotlib-3.3.1-py3.8-linux-x86_64.egg/matplotlib/cbook/__init__.py", line 1253, in contiguous_regions
    idx, = np.nonzero(mask[:-1] != mask[1:])
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

Decide if just one data point shall be plotted or if the plotting should fail with a message that the function is not applicable for the provided type of data.

@jasperalbers jasperalbers self-assigned this Mar 2, 2022
@jasperalbers jasperalbers added the enhancement New feature or request label Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants