From 9ca3ae5cd70bb9b48676374fd0cffd7d66749af4 Mon Sep 17 00:00:00 2001 From: Brianna Major Date: Tue, 17 Dec 2024 16:54:48 -0500 Subject: [PATCH] PEP8 fixes Signed-off-by: Brianna Major --- hexrdgui/constants.py | 5 ++++- hexrdgui/llnl_import_tool_dialog.py | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hexrdgui/constants.py b/hexrdgui/constants.py index 9e177e922..84ca50da5 100644 --- a/hexrdgui/constants.py +++ b/hexrdgui/constants.py @@ -78,7 +78,10 @@ class PolarXAxisType: DOCUMENTATION_URL = 'https://hexrdgui.readthedocs.io/' -FIDDLE_HDF5_PATH = ['ATTRIBUTES/SHOT_IMAGE/ATTRIBUTES/FRAME_IMAGESFRAME_IMAGES/0/DATA', 'DATA'] +FIDDLE_HDF5_PATH = [ + 'ATTRIBUTES/SHOT_IMAGE/ATTRIBUTES/FRAME_IMAGESFRAME_IMAGES/0/DATA', + 'DATA' +] KNOWN_HDF5_PATHS = [ ['ATTRIBUTES/TARGET_ORIENTED_IMAGE/DATA', 'DATA'], diff --git a/hexrdgui/llnl_import_tool_dialog.py b/hexrdgui/llnl_import_tool_dialog.py index c8addcdc9..ec221f879 100644 --- a/hexrdgui/llnl_import_tool_dialog.py +++ b/hexrdgui/llnl_import_tool_dialog.py @@ -473,7 +473,7 @@ def load_detector_images(self): # Try to automatically find missing data and dark files for this and # remaining detectors. - file_name = Path(selected_file).stem + file_name = Path(selected_file).stem if file_name.endswith('999'): self.ui.detector_files_label.setText(file_name) self.loaded_images.append(selected_file) @@ -484,8 +484,10 @@ def load_detector_images(self): selected = self.detector_images[self.detector] # Create regex pattern to try to match data and dark images - # ex: TD_TC000-000_FIDDLE_CAMERA-02-DB_SHOT_RAW-FIDDLE-CAMERA_N240717-001-003.h5 - # -> TD_TC000-000_FIDDLE_CAMERA-*-DB_SHOT_RAW-FIDDLE-CAMERA_N240717-001-*.h5 + # ex: + # TD_TC000-000_FIDDLE_CAMERA-02-DB_SHOT_RAW-FIDDLE-CAMERA_N240717-001-003.h5 + # -> + # TD_TC000-000_FIDDLE_CAMERA-*-DB_SHOT_RAW-FIDDLE-CAMERA_N240717-001-*.h5 image = re.sub("CAMERA-\d{2}-", "CAMERA-*-", selected_file) data_files = re.sub("-\d{3}.h", "-999.h", image) dark_files = re.sub("-\d{3}.h", "-003.h", image) @@ -758,7 +760,8 @@ def finalize(self): img, panel_buffer = self.it.masked_image if self.instrument == 'PXRDIP': - panel_buffer = panel_buffer.T[::-1, :] # !!! need to rotate buffers + # !!! need to rotate buffers + panel_buffer = panel_buffer.T[::-1, :] tilt = self.it.rotation self.it.completed()