Skip to content

Commit

Permalink
Merge branch 'release_6.0.0' into interpolation_for_operations
Browse files Browse the repository at this point in the history
  • Loading branch information
caitwolf authored Apr 2, 2024
2 parents 907b757 + 436b458 commit 5e42ae8
Show file tree
Hide file tree
Showing 30 changed files with 1,001 additions and 313 deletions.
11 changes: 9 additions & 2 deletions src/sas/qtgui/Perspectives/Corfunc/CorfuncCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,22 @@ class CorfuncCanvasMeta(type(FigureCanvas), ABCMeta):
class CorfuncCanvas(FigureCanvas, metaclass=CorfuncCanvasMeta):
""" Base class for the canvases in corfunc"""

def __init__(self, parent: CorfuncWindow, width=5, height=4, dpi=100):
self.parent = parent
def __init__(self, corfunc_window: CorfuncWindow, width=5, height=4, dpi=100):

self.corfunc_windows = corfunc_window

self.fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = self.fig.add_subplot(111)

FigureCanvas.__init__(self, self.fig)

self._data: Optional[List[Data1D]] = None

def parent(self):
""" Parent function is needed by the toolbar, and needs to return the appropriate figure canvas object,
which is `self`"""
return self

def clear(self):
""" Remove data from plots"""
self._data = None
Expand Down
16 changes: 8 additions & 8 deletions src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def model_changed(self, _):

self.mapper.toFirst()

self.slider.extrapolation_parameters = self.extrapolation_parmameters
self.slider.extrapolation_parameters = self.extrapolation_paramameters
self._q_space_plot.draw_data()

def _run(self):
Expand All @@ -292,7 +292,7 @@ def _run(self):

calculator = CorfuncCalculator(
data=self.data,
extrapolation_parameters=self.extrapolation_parmameters,
extrapolation_parameters=self.extrapolation_paramameters,
tangent_method=self._tangent_method,
long_period_method=self._long_period_method)

Expand Down Expand Up @@ -438,7 +438,7 @@ def allowSwap(self):
return False

@property
def extrapolation_parmameters(self) -> Optional[ExtrapolationParameters]:
def extrapolation_paramameters(self) -> Optional[ExtrapolationParameters]:
if self.data is not None:
return ExtrapolationParameters(
min(self.data.x),
Expand Down Expand Up @@ -508,7 +508,7 @@ def fractional_position(f):
# Reconnect model
self.model.itemChanged.connect(self.model_changed)

self.slider.extrapolation_parameters = self.extrapolation_parmameters
self.slider.extrapolation_parameters = self.extrapolation_paramameters
self.slider.setEnabled(True)

self.model_changed(None)
Expand Down Expand Up @@ -558,7 +558,7 @@ def on_extrapolation_text_changed_1(self, text):
# processed
#

params = self.extrapolation_parmameters._replace(point_1=safe_float(text))
params = self.extrapolation_paramameters._replace(point_1=safe_float(text))
self.slider.extrapolation_parameters = params
self._q_space_plot.update_lines(ExtrapolationInteractionState(params))
self.notify_extrapolation_text_box_validity(params)
Expand All @@ -572,7 +572,7 @@ def on_extrapolation_text_changed_2(self, text):
# processed
#

params = self.extrapolation_parmameters._replace(point_2=safe_float(text))
params = self.extrapolation_paramameters._replace(point_2=safe_float(text))
self.slider.extrapolation_parameters = params
self._q_space_plot.update_lines(ExtrapolationInteractionState(params))
self.notify_extrapolation_text_box_validity(params)
Expand All @@ -586,7 +586,7 @@ def on_extrapolation_text_changed_3(self, text):
# processed
#

params = self.extrapolation_parmameters._replace(point_3=safe_float(text))
params = self.extrapolation_paramameters._replace(point_3=safe_float(text))
self.slider.extrapolation_parameters = params
self._q_space_plot.update_lines(ExtrapolationInteractionState(params))
self.notify_extrapolation_text_box_validity(params)
Expand Down Expand Up @@ -850,4 +850,4 @@ def getReport(self) -> Optional[ReportData]:
report.add_plot(self.extraction_figure)
report.add_plot(self.idf_figure)

return report.report_data
return report.report_data
7 changes: 4 additions & 3 deletions src/sas/qtgui/Perspectives/Corfunc/QSpaceCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
class QSpaceCanvas(CorfuncCanvas):
""" Canvas for displaying input data and extrapolation parameters"""

def __init__(self, parent: CorfuncWindow, width=5, height=4, dpi=100):
super().__init__(parent, width, height, dpi)
def __init__(self, corfunc_window: CorfuncWindow, width=5, height=4, dpi=100):
super().__init__(corfunc_window, width, height, dpi)


self.extrap: Optional[Data1D] = None

Expand Down Expand Up @@ -78,7 +79,7 @@ def draw_data(self):

if self.data is not None:

extrapolation_params = self.parent.extrapolation_parmameters
extrapolation_params = self.corfunc_windows.extrapolation_paramameters

self.axes.errorbar(self.data[0].x,
self.data[0].y,
Expand Down
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5e42ae8

Please sign in to comment.