|
28 | 28 |
|
29 | 29 | import h5py # type: ignore
|
30 | 30 | import numpy
|
31 |
| -from typing_extensions import TypedDict |
32 | 31 | from numpy.typing import NDArray
|
| 32 | +from typing_extensions import TypedDict |
33 | 33 |
|
34 | 34 | from om.lib.peakfinder8_extension import peakfinder_8 # type: ignore
|
35 | 35 | from om.utils import parameters as param_utils
|
@@ -207,7 +207,7 @@ class Peakfinder8PeakDetection:
|
207 | 207 | def __init__(
|
208 | 208 | self,
|
209 | 209 | *,
|
210 |
| - radius_pixel_map: NDArray[numpy.float], |
| 210 | + radius_pixel_map: NDArray[numpy.float_], |
211 | 211 | parameters: Dict[str, Any],
|
212 | 212 | ) -> None:
|
213 | 213 | """
|
@@ -385,38 +385,38 @@ def __init__(
|
385 | 385 | map_hdf5_file_handle: Any
|
386 | 386 | with h5py.File(bad_pixel_map_filename, "r") as map_hdf5_file_handle:
|
387 | 387 | self._bad_pixel_map: Union[
|
388 |
| - NDArray[numpy.int], None |
| 388 | + NDArray[numpy.int_], None |
389 | 389 | ] = map_hdf5_file_handle[bad_pixel_map_hdf5_path][:]
|
390 | 390 | except (IOError, OSError, KeyError) as exc:
|
391 | 391 | exc_type, exc_value = sys.exc_info()[:2]
|
392 | 392 | # TODO: Fix type check
|
393 |
| - exc_type_name = exc_type.__name__ |
394 | 393 | raise RuntimeError(
|
395 |
| - f"The following error occurred while reading the " |
| 394 | + "The following error occurred while reading the " # type: ignore |
396 | 395 | f"{bad_pixel_map_hdf5_path} field from the "
|
397 | 396 | f"{bad_pixel_map_filename} bad pixel map HDF5 file:"
|
398 |
| - f"{exc_type_name}: {exc_value}" |
| 397 | + f"{exc_type.__name__}: {exc_value}" |
399 | 398 | ) from exc
|
400 | 399 | else:
|
401 | 400 | self._bad_pixel_map = None
|
402 | 401 |
|
403 |
| - self._radius_pixel_map: NDArray[numpy.float] = radius_pixel_map |
| 402 | + self._mask: Union[NDArray[numpy.int_], None] = None |
| 403 | + self._radius_pixel_map: NDArray[numpy.float_] = radius_pixel_map |
404 | 404 |
|
405 | 405 | def set_peakfinder8_info(self, peakfinder8_info: TypePeakfinder8Info) -> None:
|
406 | 406 | self._asic_nx = peakfinder8_info["asic_nx"]
|
407 | 407 | self._asic_ny = peakfinder8_info["asic_ny"]
|
408 | 408 | self._nasics_x = peakfinder8_info["nasics_x"]
|
409 | 409 | self._nasics_y = peakfinder8_info["nasics_y"]
|
410 | 410 |
|
411 |
| - def get_bad_pixel_mask(self) -> Union[NDArray[numpy.int], None]: |
| 411 | + def get_bad_pixel_mask(self) -> Union[NDArray[numpy.int_], None]: |
412 | 412 | return self._bad_pixel_mask
|
413 | 413 |
|
414 | 414 | def set_bad_pixel_mask(
|
415 |
| - self, bad_pixel_mask: Union[NDArray[numpy.int], None] |
| 415 | + self, bad_pixel_mask: Union[NDArray[numpy.int_], None] |
416 | 416 | ) -> None:
|
417 | 417 | self._bad_pixel_mask = bad_pixel_mask
|
418 | 418 |
|
419 |
| - def set_radius_pixel_map(self, radius_pixel_map: NDArray[numpy / float]) -> None: |
| 419 | + def set_radius_pixel_map(self, radius_pixel_map: NDArray[numpy.float_]) -> None: |
420 | 420 | self._radius_pixel_map = radius_pixel_map.astype(numpy.float32)
|
421 | 421 |
|
422 | 422 | def get_adc_thresh(self) -> float:
|
@@ -621,7 +621,7 @@ def set_max_res(self, max_res: int) -> None:
|
621 | 621 | self._max_res = max_res
|
622 | 622 | self._mask = None
|
623 | 623 |
|
624 |
| - def find_peaks(self, *, data: NDArray[numpy.float]) -> TypePeakList: |
| 624 | + def find_peaks(self, *, data: NDArray[numpy.float_]) -> TypePeakList: |
625 | 625 | """
|
626 | 626 | Finds peaks in a detector data frame.
|
627 | 627 |
|
|
0 commit comments