Skip to content

Commit 26df668

Browse files
committed
chore: update raise syntax
1 parent 6e65ef0 commit 26df668

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

cyarray/carray.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ cdef class BaseArray:
220220
elif s_dims[0] <= d_dims[0]:
221221
self._npy_array[:s_dims[0]] = nparr
222222
else:
223-
raise ValueError, 'array size mismatch'
223+
raise ValueError('array size mismatch')
224224

225225
cpdef squeeze(self):
226226
"""Release any unused memory.

cyarray/carray.pyx.mako

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,17 @@ cdef class BaseArray:
191191
cpdef str get_c_type(self):
192192
"""Return the c data type of this array.
193193
"""
194-
raise NotImplementedError, 'BaseArray::get_c_type'
194+
raise NotImplementedError('BaseArray::get_c_type')
195195

196196
cpdef reserve(self, long size):
197197
"""Resizes the internal data to required size.
198198
"""
199-
raise NotImplementedError, 'BaseArray::reserve'
199+
raise NotImplementedError(BaseArray::reserve')
200200

201201
cpdef resize(self, long size):
202202
"""Resizes the array to the new size.
203203
"""
204-
raise NotImplementedError, 'BaseArray::resize'
204+
raise NotImplementedError(BaseArray::resize)
205205

206206
cpdef np.ndarray get_npy_array(self):
207207
"""Returns a numpy array of the data: do not keep its reference.
@@ -231,22 +231,22 @@ cdef class BaseArray:
231231
elif s_dims[0] <= d_dims[0]:
232232
self._npy_array[:s_dims[0]] = nparr
233233
else:
234-
raise ValueError, 'array size mismatch'
234+
raise ValueError('array size mismatch')
235235

236236
cpdef squeeze(self):
237237
"""Release any unused memory.
238238
"""
239-
raise NotImplementedError, 'BaseArray::squeeze'
239+
raise NotImplementedError('BaseArray::squeeze')
240240

241241
cpdef remove(self, np.ndarray index_list, bint input_sorted=0, int stride=1):
242242
"""Remove the particles with indices in index_list.
243243
"""
244-
raise NotImplementedError, 'BaseArray::remove'
244+
raise NotImplementedError('BaseArray::remove')
245245

246246
cpdef extend(self, np.ndarray in_array):
247247
"""Extend the array with data from in_array.
248248
"""
249-
raise NotImplementedError, 'BaseArray::extend'
249+
raise NotImplementedError('BaseArray::extend')
250250

251251
cpdef align_array(self, LongArray new_indices, int stride=1):
252252
"""Rearrange the array contents according to the new indices.
@@ -258,23 +258,23 @@ cdef class BaseArray:
258258
cpdef reset(self):
259259
"""Reset the length of the array to 0.
260260
"""
261-
raise NotImplementedError, 'BaseArray::reset'
261+
raise NotImplementedError('BaseArray::reset')
262262

263263
cpdef copy_values(self, LongArray indices, BaseArray dest, int stride=1, int start=0):
264264
"""Copy values of indexed particles from self to dest.
265265
"""
266-
raise NotImplementedError, 'BaseArray::copy_values'
266+
raise NotImplementedError('BaseArray::copy_values')
267267

268268
cpdef copy_subset(self, BaseArray source,
269269
long start_index=-1, long end_index=-1, int stride=1):
270270
"""Copy subset of values from source to self.
271271
"""
272-
raise NotImplementedError, 'BaseArray::copy_subset'
272+
raise NotImplementedError('BaseArray::copy_subset')
273273

274274
cpdef update_min_max(self):
275275
"""Update the min and max values of the array.
276276
"""
277-
raise NotImplementedError, 'BaseArray::update_min_max'
277+
raise NotImplementedError('BaseArray::update_min_max')
278278

279279
def __len__(self):
280280
return self.length

0 commit comments

Comments
 (0)