Skip to content

Commit

Permalink
PEP 8 fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Brianna Major <[email protected]>
  • Loading branch information
bnmajor committed Sep 20, 2023
1 parent 85194d0 commit 9c2b7ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 7 additions & 3 deletions hexrd/ui/interactive_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

from skimage.draw import polygon

from hexrd.ui.constants import KEY_ROTATE_ANGLE_FINE, KEY_TRANSLATE_DELTA, ViewType
from hexrd.ui.constants import (
KEY_ROTATE_ANGLE_FINE, KEY_TRANSLATE_DELTA, ViewType
)
from hexrd.ui.hexrd_config import HexrdConfig
from hexrd.ui.utils import has_nan

Expand All @@ -25,7 +27,8 @@ def __init__(self, canvas, detector, axes=None, instrument=None):
self.detector = detector
self.instrument = instrument
self._static = True
self.axis_image = axes.get_images()[0] if axes else canvas.axes_images[0]
self.axis_image = (
axes.get_images()[0] if axes else canvas.axes_images[0])
self._key_angle = KEY_ROTATE_ANGLE_FINE

self.button_press_cid = None
Expand Down Expand Up @@ -112,7 +115,8 @@ def update_style(self, style=None, width=None, color=None):
def update_position(self):
pos = None
if self.instrument is not None:
pos = HexrdConfig().boundary_position(self.instrument, self.detector)
pos = HexrdConfig().boundary_position(
self.instrument, self.detector)
if pos is None:
self.center = self.get_midpoint()
else:
Expand Down
7 changes: 6 additions & 1 deletion hexrd/ui/llnl_import_tool_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,12 @@ def swap_bounds_for_cropped(self):
module=hexrd_resources,
file_name=f'TARDIS_IMAGE-PLATE-3_bnd_cropped.txt'
)
kwargs = {'fill': False, 'lw': width, 'color': color, 'linestyle': '--'}
kwargs = {
'fill': False,
'lw': width,
'color': color,
'linestyle': '--'
}
self.it.create_polygon(verts, **kwargs)
self.update_bbox_width(1330)
self.update_bbox_height(238)
Expand Down
4 changes: 2 additions & 2 deletions hexrd/ui/mask_regions_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create_interactive_template(self):
}
self.interactive_template = InteractiveTemplate(
self.canvas, self.det, axes=self.axes)
self.interactive_template.create_polygon([[0,0]], **kwargs)
self.interactive_template.create_polygon([[0, 0]], **kwargs)
self.interactive_template.update_style(color='red')
self.interactive_template.key_rotation_angle = KEY_ROTATE_ANGLE_COARSE
self.added_templates.append(self.det)
Expand Down Expand Up @@ -220,7 +220,7 @@ def button_pressed(self, event):
self.create_interactive_template()

# For animating the patch
self.canvas.draw() # Force canvas re-draw before caching
self.canvas.draw() # Force canvas re-draw before caching
self.bg_cache = self.canvas.copy_from_bbox(self.axes.bbox)

self.drawing_axes = self.axes
Expand Down

0 comments on commit 9c2b7ee

Please sign in to comment.