Skip to content

Commit

Permalink
Resurrect tests for columnfile.py, correct np.int
Browse files Browse the repository at this point in the history
In the Github Actions CI, the command "python -m pytest" is run to test ImageD11.
By default, this only runs test files with the naming convention `test_*.py`
Renamed `testcolumnfile.py` to `test_columnfile.py` to fix this.
Also, replaced `np.int` references `int` to fix numpy depreciation errors.
  • Loading branch information
jadball committed Jan 24, 2024
1 parent 0badaba commit 6184ee3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ImageD11/columnfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def removerows( self, column_name, values, tol = 0 ):
"""
col = self.getcolumn( column_name )
if tol <= 0: # integer comparisons
col = col.astype( np.int )
col = col.astype( int )
mskfun = lambda x, val, t: x == val
else: # floating point
mskfun = lambda x, val, t: np.abs( x - val ) < t
Expand Down Expand Up @@ -502,7 +502,7 @@ def colfile_to_hdf( colfile, hdffile, name=None, compression=None,
g.attrs['ImageD11_type'] = 'peaks'
for t in c.titles:
if t in INTS:
ty = np.int64
ty = int64
else:
ty = np.float64
# print "adding",t,ty
Expand Down Expand Up @@ -534,7 +534,7 @@ def colfileobj_to_hdf( cf, hdffile, name=None):
g.attrs['ImageD11_type'] = 'peaks'
for t in cf.titles:
if t in INTS:
ty = np.int64
ty = int64
else:
ty = np.float64
g.create_dataset( t, data = getattr(cf, t).astype( ty ) )
Expand Down
File renamed without changes.

0 comments on commit 6184ee3

Please sign in to comment.