Skip to content

Commit

Permalink
Fixed unmatched method signatures in Box&Wedge Interactor child classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehewins committed Aug 17, 2023
1 parent 58e9776 commit 975a1b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
15 changes: 10 additions & 5 deletions src/sas/qtgui/Plotting/Slicers/BoxSlicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class BoxInteractor(BaseInteractor, SlicerModel):
function of Q_x and BoxInteractorY averages all the points from
-x to +x as a function of Q_y
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
BaseInteractor.__init__(self, base, axes, color=color)
SlicerModel.__init__(self)
Expand Down Expand Up @@ -256,7 +257,7 @@ def setParams(self, params):

self.horizontal_lines.update(x=self.x, y=self.y)
self.vertical_lines.update(x=self.x, y=self.y)
self._post_data(nbins=None)
self._post_data()
self.draw()

def draw(self):
Expand All @@ -273,6 +274,7 @@ class HorizontalLines(BaseInteractor):
on the x direction. The two lines move symmetrically (in opposite
directions). It also defines the x and -x position of a box.
"""

def __init__(self, base, axes, color='black', zorder=5, x=0.5, y=0.5):
"""
"""
Expand Down Expand Up @@ -383,6 +385,7 @@ class VerticalLines(BaseInteractor):
on the y direction. The two lines move symmetrically (in opposite
directions). It also defines the y and -y position of a box.
"""

def __init__(self, base, axes, color='black', zorder=5, x=0.5, y=0.5):
"""
"""
Expand Down Expand Up @@ -493,12 +496,13 @@ class BoxInteractorX(BoxInteractor):
averaged together to provide a 1D array in Qx (to be plotted as a function
of Qx)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
BoxInteractor.__init__(self, base, axes, item=item, color=color)
self.base = base
self._post_data()
super()._post_data()

def _post_data(self):
def _post_data(self, new_slab=None, nbins=None, direction=None):
"""
Post data creating by averaging in Qx direction
"""
Expand Down Expand Up @@ -526,12 +530,13 @@ class BoxInteractorY(BoxInteractor):
averaged together to provide a 1D array in Qy (to be plotted as a function
of Qy)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
BoxInteractor.__init__(self, base, axes, item=item, color=color)
self.base = base
self._post_data()
super()._post_data()

def _post_data(self):
def _post_data(self, new_slab=None, nbins=None, direction=None):
"""
Post data creating by averaging in Qy direction
"""
Expand Down
16 changes: 10 additions & 6 deletions src/sas/qtgui/Plotting/Slicers/WedgeSlicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from sas.qtgui.Plotting.Slicers.RadiusInteractor import RadiusInteractor
from sas.qtgui.Plotting.Slicers.SectorSlicer import LineInteractor


class WedgeInteractor(BaseInteractor, SlicerModel):
"""
This WedgeInteractor is a cross between the SectorInteractor and the
Expand All @@ -29,6 +30,7 @@ class WedgeInteractor(BaseInteractor, SlicerModel):
AnnulusSlicer) and SectorInteractorQ averages all phi points at constant Q
(as for the SectorSlicer).
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):

BaseInteractor.__init__(self, base, axes, color=color)
Expand Down Expand Up @@ -115,7 +117,7 @@ def update(self):
self.phi = self.radial_lines.phi
self.inner_arc.update(phi=self.phi)
self.outer_arc.update(phi=self.phi)
if self.central_line.has_move:
if self.central_line.has_move:
self.central_line.update()
self.theta = self.central_line.theta
self.inner_arc.update(theta=self.theta)
Expand Down Expand Up @@ -206,7 +208,6 @@ def _post_data(self, new_sector=None, nbins=None):
new_plot.xaxis("\\rm{Q}", 'A^{-1}')
new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}")


new_plot.id = str(self.averager.__name__) + self.data.name
new_plot.group_id = new_plot.id
new_plot.is_data = True
Expand Down Expand Up @@ -327,18 +328,20 @@ def draw(self):
"""
self.base.draw()


class WedgeInteractorQ(WedgeInteractor):
"""
Average in Q direction. The data for all phi at a constant Q are
averaged together to provide a 1D array in Q (to be plotted as a function
of Q)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
WedgeInteractor.__init__(self, base, axes, item=item, color=color)
self.base = base
self._post_data()
super()._post_data()

def _post_data(self):
def _post_data(self, new_sector=None, nbins=None):
from sasdata.data_util.manipulations import SectorQ
super()._post_data(SectorQ)

Expand All @@ -349,12 +352,13 @@ class WedgeInteractorPhi(WedgeInteractor):
averaged together to provide a 1D array in phi (to be plotted as a function
of phi)
"""

def __init__(self, base, axes, item=None, color='black', zorder=3):
WedgeInteractor.__init__(self, base, axes, item=item, color=color)
self.base = base
self._post_data()
super()._post_data()

def _post_data(self):
def _post_data(self, new_sector=None, nbins=None):
from sasdata.data_util.manipulations import SectorPhi
super()._post_data(SectorPhi)

0 comments on commit 975a1b6

Please sign in to comment.