Replace depricated dtype aliases
For numpy>=1.20
This commit is contained in:
parent
015eb095a4
commit
e318055304
@ -34,7 +34,7 @@ def normalize_dataset(dataset, monitor=100_000):
|
||||
|
||||
|
||||
def merge_duplicates(dataset):
|
||||
merged = np.zeros(len(dataset), dtype=np.bool)
|
||||
merged = np.zeros(len(dataset), dtype=bool)
|
||||
for ind_into, scan_into in enumerate(dataset):
|
||||
for ind_from, scan_from in enumerate(dataset[ind_into + 1 :], start=ind_into + 1):
|
||||
if _parameters_match(scan_into, scan_from) and not merged[ind_from]:
|
||||
@ -82,7 +82,7 @@ def merge_datasets(dataset_into, dataset_from):
|
||||
print(f"Scan motors mismatch between datasets: {scan_motors_into} vs {scan_motors_from}")
|
||||
return
|
||||
|
||||
merged = np.zeros(len(dataset_from), dtype=np.bool)
|
||||
merged = np.zeros(len(dataset_from), dtype=bool)
|
||||
for scan_into in dataset_into:
|
||||
for ind, scan_from in enumerate(dataset_from):
|
||||
if _parameters_match(scan_into, scan_from) and not merged[ind]:
|
||||
|
@ -47,9 +47,9 @@ def parse_h5meta(file):
|
||||
if variable in META_STR:
|
||||
pass
|
||||
elif variable in META_CELL:
|
||||
value = np.array(value.split(",")[:6], dtype=np.float)
|
||||
value = np.array(value.split(",")[:6], dtype=float)
|
||||
elif variable in META_MATRIX:
|
||||
value = np.array(value.split(",")[:9], dtype=np.float).reshape(3, 3)
|
||||
value = np.array(value.split(",")[:9], dtype=float).reshape(3, 3)
|
||||
else: # default is a single float number
|
||||
value = float(value)
|
||||
content[section][variable] = value
|
||||
@ -69,7 +69,7 @@ def read_detector_data(filepath, cami_meta=None):
|
||||
ndarray: A 3D array of data, omega, gamma, nu.
|
||||
"""
|
||||
with h5py.File(filepath, "r") as h5f:
|
||||
counts = h5f["/entry1/area_detector2/data"][:].astype(np.float64)
|
||||
counts = h5f["/entry1/area_detector2/data"][:].astype(float)
|
||||
|
||||
n, cols, rows = counts.shape
|
||||
if "/entry1/experiment_identifier" in h5f: # old format
|
||||
|
Loading…
x
Reference in New Issue
Block a user