Skip to content

Commit

Permalink
Replace np.bool with bool (#255)
Browse files Browse the repository at this point in the history
* Replace np.bool with bool

* Increase tolerance on cmd_states pitch test

* Revert change in test_cmd_states tolerance
  • Loading branch information
jeanconn authored Jan 20, 2024
1 parent 0c7e1f1 commit 9f192dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cheta/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def _convert(dat):

if add_quality:
descrs = [(x,) + y[1:] for x, y in zip(colnames_out, dat.dtype.descr)]
quals = numpy.zeros((len(dat), len(colnames) + 1), dtype=numpy.bool)
descrs += [("QUALITY", numpy.bool, (len(colnames) + 1,))]
quals = numpy.zeros((len(dat), len(colnames) + 1), dtype=bool)
descrs += [("QUALITY", bool, (len(colnames) + 1,))]
arrays += [quals]
else:
descrs = [
Expand Down Expand Up @@ -563,7 +563,7 @@ def acisdeahk(dat):
quality = (False, False) + bads
outs.append((times[i0], quality) + vals)

dtype = [("TIME", numpy.float64), ("QUALITY", numpy.bool, (len(col_names) + 2,))]
dtype = [("TIME", numpy.float64), ("QUALITY", bool, (len(col_names) + 2,))]
dtype += [(col_name, numpy.float32) for col_name in col_names]

return numpy.rec.fromrecords(outs, dtype=dtype)
Expand Down
2 changes: 1 addition & 1 deletion cheta/update_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ def read_derived(i, filename, filetype, row, colnames, archfiles, db):

logger.info("Reading (%d / %d) %s" % (i, len(archfiles), filename))
vals = {}
bads = np.zeros((len(times), len(colnames)), dtype=np.bool)
bads = np.zeros((len(times), len(colnames)), dtype=bool)
for i, colname in enumerate(colnames):
if colname == "TIME":
vals[colname] = times
Expand Down

0 comments on commit 9f192dc

Please sign in to comment.