Use bool rather than np.bool to avoid deprecation errors
This commit is contained in:
@@ -18,14 +18,14 @@ def calc_apply_additional_mask_from_file(results, pixel_mask_pf):
|
||||
# Support for hdf5 and npy
|
||||
if mask_file.endswith(".npy"):
|
||||
try:
|
||||
mask = np.load(mask_file).astype(np.bool)
|
||||
mask = np.load(mask_file).astype(bool)
|
||||
except Exception as error:
|
||||
results["mask_error"] = f"Error loading mask data from NumPy file {mask_file}:\n{error}"
|
||||
return
|
||||
else:
|
||||
try:
|
||||
with h5py.File(mask_file, "r") as h5f:
|
||||
mask = h5f[mask_dataset][:].astype(np.bool)
|
||||
mask = h5f[mask_dataset][:].astype(bool)
|
||||
except Exception as error:
|
||||
results["mask_error"] = f"Error loading mask from hdf5 file {mask_file}:\n{error}"
|
||||
return
|
||||
|
||||
@@ -86,7 +86,7 @@ def _generate_cryst_data(results, data, pf_pixel_mask) -> CrystData:
|
||||
else:
|
||||
mask_dataset = results.get("cbd_mask_dataset", "entry/instrument/detector/mask")
|
||||
with h5py.File(mask_data_file, "r") as hf:
|
||||
mask = hf[mask_dataset][:].astype(np.bool)
|
||||
mask = hf[mask_dataset][:].astype(bool)
|
||||
mask *= pf_pixel_mask
|
||||
|
||||
data = CrystData(
|
||||
|
||||
Reference in New Issue
Block a user