Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Nov 22, 2024
1 parent e745fab commit e120abc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions openmc_plotter/docks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ def __init__(self, model, font_metric, parent=None):

self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)


class MeshAnnotationDock(PlotterDock):
"""
Dock for mesh annotation options
"""
"""Dock for mesh annotation options"""

def __init__(self, model, font_metric, parent=None):
super().__init__(model, font_metric, parent)
Expand Down Expand Up @@ -84,6 +83,7 @@ def resizeEvent(self, event):

hideEvent = showEvent = moveEvent = resizeEvent


class DomainDock(PlotterDock):
"""
Domain options dock
Expand Down
27 changes: 14 additions & 13 deletions openmc_plotter/plotgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ def updatePixmap(self):
self.plotSourceSites()

# annotate mesh boundaries
for mid in cv.mesh_annotations:
self.annotate_mesh(mid)
for mesh_id in cv.mesh_annotations:
self.annotate_mesh(mesh_id)

# always make sure the data bounds are set correctly
self.ax.set_xbound(data_bounds[0], data_bounds[1])
Expand All @@ -658,22 +658,23 @@ def updatePixmap(self):

def current_view_data_bounds(self):
cv = self.model.currentView
data_bounds = [cv.origin[self.main_window.xBasis] - cv.width/2.,
cv.origin[self.main_window.xBasis] + cv.width/2.,
cv.origin[self.main_window.yBasis] - cv.height/2.,
cv.origin[self.main_window.yBasis] + cv.height/2.]
return data_bounds
return [cv.origin[self.main_window.xBasis] - cv.width/2.,
cv.origin[self.main_window.xBasis] + cv.width/2.,
cv.origin[self.main_window.yBasis] - cv.height/2.,
cv.origin[self.main_window.yBasis] + cv.height/2.]

def annotate_mesh(self, mesh_id):
mesh_bins = self.model.mesh_plot_bins(mesh_id)

data_bounds = self.current_view_data_bounds()
self.mesh_contours = self.ax.contour(mesh_bins,
origin='upper',
colors='k',
linestyles='solid',
levels=np.unique(mesh_bins),
extent=data_bounds)
self.mesh_contours = self.ax.contour(
mesh_bins,
origin='upper',
colors='k',
linestyles='solid',
levels=np.unique(mesh_bins),
extent=data_bounds
)

def plotSourceSites(self):
if not self.model.sourceSitesVisible or self.model.sourceSites is None:
Expand Down

0 comments on commit e120abc

Please sign in to comment.