Skip to content
Snippets Groups Projects

Compute preview reductions before running addons

Merged David Hammer requested to merge fix/addons-can-mess-with-preview into master
1 file
+ 13
11
Compare changes
  • Side-by-side
  • Inline
+ 13
11
@@ -884,6 +884,19 @@ class BaseCorrection(PythonDevice):
@@ -884,6 +884,19 @@ class BaseCorrection(PythonDevice):
image_data, cell_table, *additional_data
image_data, cell_table, *additional_data
)
)
data_hash["corrections"] = corrections
data_hash["corrections"] = corrections
 
 
# write previews first so addons cannot mess with them
 
with self.warning_context(
 
"processingState", WarningLampType.PREVIEW_SETTINGS
 
) as warn:
 
self.preview_friend.write_outputs(
 
*previews,
 
timestamp=timestamp,
 
cell_table=cell_table,
 
pulse_table=pulse_table,
 
warn_fun=warn,
 
)
 
for addon in self._enabled_addons:
for addon in self._enabled_addons:
addon.post_correction(
addon.post_correction(
timestamp.getTrainId(),
timestamp.getTrainId(),
@@ -894,17 +907,6 @@ class BaseCorrection(PythonDevice):
@@ -894,17 +907,6 @@ class BaseCorrection(PythonDevice):
)
)
self.kernel_runner.reshape(processed_buffer, out=buffer_array)
self.kernel_runner.reshape(processed_buffer, out=buffer_array)
with self.warning_context(
"processingState", WarningLampType.PREVIEW_SETTINGS
) as warn:
self.preview_friend.write_outputs(
*previews,
timestamp=timestamp,
cell_table=cell_table,
pulse_table=pulse_table,
warn_fun=warn,
)
for addon in self._enabled_addons:
for addon in self._enabled_addons:
addon.post_reshape(
addon.post_reshape(
timestamp.getTrainId(), buffer_array, cell_table, pulse_table, data_hash
timestamp.getTrainId(), buffer_array, cell_table, pulse_table, data_hash
Loading