We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since NumPy v1.12, indexing ndarray with the wrong type (e.g. a float) raises IndexError. I think that's what's happening here.
ndarray
IndexError
The example code:
from PyQt4.QtGui import QApplication import segyviewlib qapp = QApplication([]) l = segyviewlib.segyviewwidget.SegyViewWidget(fname) l.show()
...results in:
IndexError Traceback (most recent call last) <ipython-input-9-e587dc28b0c1> in <module>() 2 import segyviewlib 3 qapp = QApplication([]) ----> 4 l = segyviewlib.segyviewwidget.SegyViewWidget(fname) 5 l.show() ~/anaconda/envs/python36/lib/python3.6/site-packages/segyviewlib-1.1.3.dev2+gc4b38be-py3.6.egg/segyviewlib/segyviewwidget.py in __init__(self, filename, show_toolbar, color_maps, width, height, dpi, segyioargs, parent) 19 self._slice_data_source = slice_data_source 20 ---> 21 self._context = SliceViewContext(slice_models, slice_data_source) 22 self._context.show_indicators(True) 23 ~/anaconda/envs/python36/lib/python3.6/site-packages/segyviewlib-1.1.3.dev2+gc4b38be-py3.6.egg/segyviewlib/sliceviewcontext.py in __init__(self, slice_models, slice_data_source, colormap, interpolation, image_size, has_data) 77 78 if self._has_data: ---> 79 self._assign_indexes() 80 81 for model in self._available_slice_models: ~/anaconda/envs/python36/lib/python3.6/site-packages/segyviewlib-1.1.3.dev2+gc4b38be-py3.6.egg/segyviewlib/sliceviewcontext.py in _assign_indexes(self) 242 m.x_indexes = list(self._slice_data_source.indexes_for_direction(m.x_index_direction)) 243 m.y_indexes = list(self._slice_data_source.indexes_for_direction(m.y_index_direction)) --> 244 data = self._slice_data_source.read_slice(m.index_direction, m.index) 245 m.data = data 246 ~/anaconda/envs/python36/lib/python3.6/site-packages/segyviewlib-1.1.3.dev2+gc4b38be-py3.6.egg/segyviewlib/slicedatasource.py in read_slice(self, direction, index) 114 def read_slice(self, direction, index): 115 if direction == SliceDirection.inline: --> 116 iline_index = self._source.ilines[index] 117 return self._source.iline[iline_index].T 118 elif direction == SliceDirection.crossline: IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
The text was updated successfully, but these errors were encountered:
#37 This is probably the same issue.
Sorry, something went wrong.
No branches or pull requests
Since NumPy v1.12, indexing
ndarray
with the wrong type (e.g. a float) raisesIndexError
. I think that's what's happening here.The example code:
...results in:
The text was updated successfully, but these errors were encountered: