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

Adding a 0.00 charge object results in crash #14

Open
ghost opened this issue Feb 27, 2019 · 0 comments
Open

Adding a 0.00 charge object results in crash #14

ghost opened this issue Feb 27, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 27, 2019

The contour plot crashes for some reason [1] with stacktrace [2] when a 0.00 charge is added as the only object.

A more fundamental question is whether to allow 0.00 charges and if that makes physics sense - then stop the user with a warning before even calling the python exec.

[1] https://github.com/palkiakerr/ProjectX_Workspace/blob/4ef9ed7e0f7dcdb1afa447e49966305854b87954/src/Plotter.py#L72

[2]

/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/contour.py:1230: UserWarning: No contour levels were found within the data range.
  warnings.warn("No contour levels were found"
Traceback (most recent call last):
  File "Plotter.py", line 82, in <module>
    main()
  File "Plotter.py", line 72, in main
    plt.colorbar()
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2320, in colorbar
    ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/figure.py", line 2098, in colorbar
    cb = cbar.colorbar_factory(cax, mappable, **cb_kw)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 1399, in colorbar_factory
    cb = Colorbar(cax, mappable, **kwargs)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 935, in __init__
    ColorbarBase.__init__(self, ax, **kw)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 327, in __init__
    self.draw_all()
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 353, in draw_all
    self._config_axes(X, Y)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 437, in _config_axes
    xy = self._outline(X, Y)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 485, in _outline
    x = np.take(np.ravel(np.transpose(X)), ii)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 189, in take
    return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
  File "/workspace/ProjectX_Workspace/venv/local/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
    return getattr(obj, method)(*args, **kwds)
IndexError: index 2 is out of bounds for size 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants