Skip to content

Commit

Permalink
Typing updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyer committed Feb 6, 2025
1 parent 6847aa3 commit 3c140c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nion/usim_device/CameraDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def __acquire_image(self, *, direct: bool, index: int = 0) -> ImportExportManage
self.__has_data_event.clear()
if xdata_buffer is None:
xdata_buffer = copy.deepcopy(self.__xdata_buffer)
else:
elif self.__xdata_buffer:
xdata_buffer += self.__xdata_buffer
self.__frame_number += 1
# note: the data element will include spatial calibrations; but the camera adapter won't use them
Expand Down
2 changes: 1 addition & 1 deletion nion/usim_device/InstrumentDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,4 +847,4 @@ def generate_scan_data(self, instrument: InstrumentDevice.Instrument, scan_frame
data = rotated_data
else:
data = data[extra // 2:extra // 2 + size.height, extra // 2:extra // 2 + size.width]
return (data + numpy.random.randn(size.height, size.width) * noise_factor) * pixel_time_us
return typing.cast(_NDArray, (data + numpy.random.randn(size.height, size.width) * noise_factor) * pixel_time_us)

0 comments on commit 3c140c1

Please sign in to comment.