Skip to content

Commit

Permalink
PEP8 fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Brianna Major <[email protected]>
  • Loading branch information
Brianna Major committed Dec 18, 2024
1 parent 94b808e commit 9ca3ae5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion hexrdgui/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
11 changes: 7 additions & 4 deletions hexrdgui/llnl_import_tool_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 9ca3ae5

Please sign in to comment.