Skip to content

Commit fbecb92

Browse files
committed
Rename attrivute colorbar to property_colorbar for clarity of intent
1 parent 16b7993 commit fbecb92

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

openmc_plotter/plotgui.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, model: PlotModel, parent, main_window):
4444
self.x_plot_origin = None
4545
self.y_plot_origin = None
4646

47-
self.colorbar = None
47+
self.property_colorbar = None
4848
self.data_indicator = None
4949
self.tally_data_indicator = None
5050
self.tally_colorbar = None
@@ -533,21 +533,21 @@ def updatePixmap(self):
533533
alpha=cv.domainAlpha)
534534

535535
# add colorbar
536-
self.colorbar = self.figure.colorbar(self.image,
537-
anchor=(1.0, 0.0))
538-
self.colorbar.set_label(cmap_label,
539-
rotation=-90,
540-
labelpad=15)
536+
self.property_colorbar = self.figure.colorbar(self.image,
537+
anchor=(1.0, 0.0))
538+
self.property_colorbar.set_label(cmap_label,
539+
rotation=-90,
540+
labelpad=15)
541541
# draw line on colorbar
542-
dl = self.colorbar.ax.dataLim.get_points()
542+
dl = self.property_colorbar.ax.dataLim.get_points()
543543
self.data_indicator = mlines.Line2D(dl[:][0],
544544
[0.0, 0.0],
545545
linewidth=3.,
546546
color='blue',
547547
clip_on=True)
548548
self.data_indicator.set_animated(True)
549-
self.colorbar.ax.add_line(self.data_indicator)
550-
self.colorbar.ax.margins(0.0, 0.0)
549+
self.property_colorbar.ax.add_line(self.data_indicator)
550+
self.property_colorbar.ax.margins(0.0, 0.0)
551551
self.updateDataIndicatorVisibility()
552552
self.updateColorMinMax(cv.colorby)
553553

@@ -665,7 +665,7 @@ def updatePixmap(self):
665665

666666
self.draw()
667667
self._cache_colorbar_backgrounds()
668-
self._blit_indicator(self.data_indicator, self.colorbar)
668+
self._blit_indicator(self.data_indicator, self.property_colorbar)
669669
self._blit_indicator(self.tally_data_indicator, self.tally_colorbar)
670670
return "Done"
671671

@@ -757,9 +757,9 @@ def _cache_colorbar_backgrounds(self):
757757
self._data_colorbar_bg = None
758758
self._tally_colorbar_bg = None
759759

760-
if self.colorbar and self.data_indicator:
760+
if self.property_colorbar and self.data_indicator:
761761
self._data_colorbar_bg = self.copy_from_bbox(
762-
self.colorbar.ax.bbox)
762+
self.property_colorbar.ax.bbox)
763763

764764
if self.tally_colorbar and self.tally_data_indicator:
765765
self._tally_colorbar_bg = self.copy_from_bbox(
@@ -773,7 +773,7 @@ def _blit_indicator(self, indicator, colorbar):
773773
if not indicator.get_visible():
774774
return False
775775

776-
if colorbar is self.colorbar:
776+
if colorbar is self.property_colorbar:
777777
background = self._data_colorbar_bg
778778
else:
779779
background = self._tally_colorbar_bg
@@ -832,36 +832,36 @@ def updateDataIndicatorValue(self, y_val):
832832
dl_color = invert_rgb(self.image.get_cmap()(y_val), True)
833833
self.data_indicator.set_c(dl_color)
834834

835-
if not self._blit_indicator(self.data_indicator, self.colorbar):
835+
if not self._blit_indicator(self.data_indicator, self.property_colorbar):
836836
self.draw_idle()
837837

838838
def updateDataIndicatorVisibility(self):
839839
cv = self.model.currentView
840840
if self.data_indicator and cv.colorby in _MODEL_PROPERTIES:
841841
val = cv.data_indicator_enabled[cv.colorby]
842842
self.data_indicator.set_visible(val)
843-
if not self._blit_indicator(self.data_indicator, self.colorbar):
843+
if not self._blit_indicator(self.data_indicator, self.property_colorbar):
844844
self.draw_idle()
845845

846846
def updateColorMap(self, colormap_name, property_type):
847-
if self.colorbar and property_type == self.model.activeView.colorby:
847+
if self.property_colorbar and property_type == self.model.activeView.colorby:
848848
self.image.set_cmap(colormap_name)
849849
self.figure.draw_without_rendering()
850850
self.draw()
851851
self._cache_colorbar_backgrounds()
852-
self._blit_indicator(self.data_indicator, self.colorbar)
852+
self._blit_indicator(self.data_indicator, self.property_colorbar)
853853

854854
def updateColorMinMax(self, property_type):
855855
av = self.model.activeView
856-
if self.colorbar and property_type == av.colorby:
856+
if self.property_colorbar and property_type == av.colorby:
857857
clim = av.getColorLimits(property_type)
858-
self.colorbar.mappable.set_clim(*clim)
858+
self.property_colorbar.mappable.set_clim(*clim)
859859
self.data_indicator.set_data(clim[:2],
860860
(0.0, 0.0))
861861
self.figure.draw_without_rendering()
862862
self.draw()
863863
self._cache_colorbar_backgrounds()
864-
self._blit_indicator(self.data_indicator, self.colorbar)
864+
self._blit_indicator(self.data_indicator, self.property_colorbar)
865865

866866

867867
class ColorDialog(QDialog):

0 commit comments

Comments
 (0)