sas.qtgui.Perspectives.Inversion package

Subpackages

Submodules

sas.qtgui.Perspectives.Inversion.DMaxExplorerWidget module

Dialog panel to explore the P(r) inversion results for a range of D_max value. User picks a number of points and a range of distances, then can toggle between inversion outputs and see their distribution as a function of D_max.

class sas.qtgui.Perspectives.Inversion.DMaxExplorerWidget.DmaxWindow(pr_state: Invertor, nfunc: int, parent=None)

Bases: QDialog, Ui_DmaxExplorer

The controller which is responsible for managing signal slot connections for the GUI and providing an interface to the data model.

__doc__ = '\nThe controller which is responsible for managing signal slot connections\nfor the GUI and providing an interface to the data model.\n'
__firstlineno__ = 38
__init__(pr_state: Invertor, nfunc: int, parent=None)
__module__ = 'sas.qtgui.Perspectives.Inversion.DMaxExplorerWidget'
__static_attributes__ = ('communicator', 'hasPlot', 'mapper', 'model', 'nfunc', 'parent', 'plot', 'pr_state')
closeEvent(event: QEvent) → None

Override close event to clear the parent’s reference to this window.

modelChanged(item: QStandardItem | None) → None

Recompute and replot the D_max exploration results when the model changes.

name = 'Dmax Explorer'
setupMapper() → None

Configure the data widget mapper to bind model items to UI widgets.

setupModel() → None

Populate the model with initial values derived from the current P(r) state.

setupSlots() → None

Connect UI signals to their corresponding slots.

setupValidators() → None

Add validators on relevant line edits.

staticMetaObject = PySide6.QtCore.QMetaObject("DmaxWindow" inherits "QDialog": )

sas.qtgui.Perspectives.Inversion.InversionLogic module

class sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic(data_item: QStandardItem | None = None)

Bases: object

All the data-related logic. This class deals exclusively with Data1D/2D. No QStandardModelIndex here.

__annotations__ = {'_data_item': PySide6.QtGui.QStandardItem | None}
__dict__ = mappingproxy({'__module__': 'sas.qtgui.Perspectives.Inversion.InversionLogic', '__firstlineno__': 22, '__annotations__': {'_data_item': PySide6.QtGui.QStandardItem | None, 'data_is_loaded': 'bool', 'qmin': 'float', 'qmax': 'float'}, '__doc__': 'All the data-related logic. This class deals exclusively with Data1D/2D. No QStandardModelIndex here.', '__init__': <function InversionLogic.__init__>, 'data_item': <property object>, 'data': <property object>, 'isLoadedData': <function InversionLogic.isLoadedData>, 'new1DPlot': <function InversionLogic.new1DPlot>, 'newPRPlot': <function InversionLogic.newPRPlot>, 'add_errors': <function InversionLogic.add_errors>, 'computeDataRange': <function InversionLogic.computeDataRange>, 'computeRangeFromData': <function InversionLogic.computeRangeFromData>, '__static_attributes__': ('_data_item', 'data_is_loaded', 'qmax', 'qmin'), '__dict__': <attribute '__dict__' of 'InversionLogic' objects>, '__weakref__': <attribute '__weakref__' of 'InversionLogic' objects>})
__doc__ = 'All the data-related logic. This class deals exclusively with Data1D/2D. No QStandardModelIndex here.'
__firstlineno__ = 22
__init__(data_item: QStandardItem | None = None)
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionLogic'
__static_attributes__ = ('_data_item', 'data_is_loaded', 'qmax', 'qmin')
__weakref__

list of weak references to the object

_data_item: QStandardItem | None
add_errors(sigma: float = 0.05) → ndarray

Add errors to the data set if they are not available.

computeDataRange() → tuple[float | None, float | None]

Compute the data range based on the local dataset.

computeRangeFromData(data: Data1D) → tuple[float | None, float | None]

Compute the minimum and maximum range of the data. Returns the (qmin, qmax) tuple.

property data: Data1D

Return the Data1D object extracted from the current data item.

property data_item: QStandardItem | None

Return the raw QStandardItem held by this logic instance.

isLoadedData() → bool

Return whether data has been loaded into this logic instance.

new1DPlot(tab_id: int = 1, out: ndarray | None = None, pr: Invertor | None = None, q: ndarray | None = None) → Data1D

Create a new 1D data instance based on fitting results.

newPRPlot(out: ndarray, pr: Invertor, cov: ndarray | None = None) → Data1D

Create a new P(r) plot from the inversion results.

sas.qtgui.Perspectives.Inversion.InversionPerspective module

class sas.qtgui.Perspectives.Inversion.InversionPerspective.InversionWindow(parent=None, data=None)

Bases: QTabWidget, Perspective

The main window for the P(r) Inversion perspective. This is the main window where the tabs for each of the widgets are shown.

__doc__ = '\nThe main window for the P(r) Inversion perspective.\nThis is the main window where the tabs for each of the widgets are shown.\n'
__firstlineno__ = 22
__init__(parent=None, data=None)
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionPerspective'
__static_attributes__ = ('_allowClose', '_data', '_dataList', 'batchResults', 'batchResultsWindow', 'communicator', 'dataDeleted', 'is_batch', 'logic', 'mapper', 'maxIndex', 'model', 'parent', 'tabs')
addData(data: QStandardItem | None = None, is_batch: bool = False, tab_index: int | None = None) → None

Add a new tab for passed data.

allowBatch()

Tell the caller perspective accepts batch mode.

allowSwap() → bool

Tell the caller perspective accepts swapping data.

closeBatchResults() → None
closeDMax() → None
closeEvent(event: QEvent) → None

Overwrite QDialog close method to allow for custom widget close.

closeTabByIndex(index: int) → None

Close/delete a tab with the given index. No checks on validity of the index.

closeTabByName(tab_name: str) → None

Given name of the tab - close it.

property currentTab: InversionWidget

Returns the tab widget currently shown.

currentTabDataId() → list

Returns the data ID of the current tab.

ext = 'pr'
getSerializePage(index: int | None = None) → tuple[dict, bool]

Serialize and return a dictionary of {tab_id: inversion-state}. Return original dictionary if no data.

getTabName(is_batch: bool = False) → str

Get the new tab name, based on the number of fitting tabs so far.

help() → None

Open the P(r) Inversion help browser.

isClosable() → bool

Tell the caller if the widget can be closed.

isSerializable() → bool

Tell the caller that this perspective writes its state.

name = 'Inversion'
removeData(data_list: list[QStandardItem]) → None

Remove data from the perspective for requested data items.

reset() → None

Reset the Inversion perspective to an empty state.

resetTab(index: int) → None

Adds a new tab and removes the last tab as a way of resetting the tabs.

serializeAll() → dict

Serialize the inversion state for all active inversion pages.

Returns a dictionary mapping data IDs to inversion state: {data-id: {self.name: {inversion-state}}}.

serializeCurrentPage() → tuple[dict, bool]

Serialize current (active) page.

setClosable(value: bool = True) → None

Set the closability flag.

setData(data_item: list[QStandardItem] | None = None, is_batch: bool = False, tab_index: int | None = None) → None

Assign new data set(s) to the P(r) perspective. Obtain a QStandardItem object and parse it to get Data1D/2D. Pass it over to the calculator.

staticMetaObject = PySide6.QtCore.QMetaObject("InversionWindow" inherits "QTabWidget": )
property supports_fitting: bool

Tell caller perspective does not support fitting.

property supports_reports: bool

Tell caller perspective supports reports.

swapData(data: QStandardItem | None = None, tab_index: int | None = None) → None

Replace the data from the current tab.

tabCloses(index: int) → None

Update local bookkeeping on tab close.

property title: str

Returns the title of the perspective.

updateFromParameters(params: dict) → None

Update the current tab from parameters

sas.qtgui.Perspectives.Inversion.InversionUtils module

sas.qtgui.Perspectives.Inversion.InversionWidget module

class sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs(rg: float, iq0: float, background: float, calc_time: float, chi2: float, oscillations: float, pos_frac: float, pos_err: float)

Bases: object

__annotations__ = {'background': <class 'float'>, 'calc_time': <class 'float'>, 'chi2': <class 'float'>, 'iq0': <class 'float'>, 'oscillations': <class 'float'>, 'pos_err': <class 'float'>, 'pos_frac': <class 'float'>, 'rg': <class 'float'>}
__dataclass_fields__ = {'background': Field(name='background',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'calc_time': Field(name='calc_time',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'chi2': Field(name='chi2',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'iq0': Field(name='iq0',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'oscillations': Field(name='oscillations',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'pos_err': Field(name='pos_err',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'pos_frac': Field(name='pos_frac',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'rg': Field(name='rg',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__dict__ = mappingproxy({'__module__': 'sas.qtgui.Perspectives.Inversion.InversionWidget', '__firstlineno__': 27, '__annotations__': {'rg': <class 'float'>, 'iq0': <class 'float'>, 'background': <class 'float'>, 'calc_time': <class 'float'>, 'chi2': <class 'float'>, 'oscillations': <class 'float'>, 'pos_frac': <class 'float'>, 'pos_err': <class 'float'>}, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'CalculatedOutputs' objects>, '__weakref__': <attribute '__weakref__' of 'CalculatedOutputs' objects>, '__doc__': 'CalculatedOutputs(rg: float, iq0: float, background: float, calc_time: float, chi2: float, oscillations: float, pos_frac: float, pos_err: float)', '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'rg': Field(name='rg',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'iq0': Field(name='iq0',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'background': Field(name='background',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'calc_time': Field(name='calc_time',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'chi2': Field(name='chi2',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'oscillations': Field(name='oscillations',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'pos_frac': Field(name='pos_frac',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'pos_err': Field(name='pos_err',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function CalculatedOutputs.__init__>, '__repr__': <function CalculatedOutputs.__repr__>, '__eq__': <function CalculatedOutputs.__eq__>, '__match_args__': ('rg', 'iq0', 'background', 'calc_time', 'chi2', 'oscillations', 'pos_frac', 'pos_err')})
__doc__ = 'CalculatedOutputs(rg: float, iq0: float, background: float, calc_time: float, chi2: float, oscillations: float, pos_frac: float, pos_err: float)'
__eq__(other)

Return self==value.

__firstlineno__ = 27
__hash__ = None
__init__(rg: float, iq0: float, background: float, calc_time: float, chi2: float, oscillations: float, pos_frac: float, pos_err: float) → None
__match_args__ = ('rg', 'iq0', 'background', 'calc_time', 'chi2', 'oscillations', 'pos_frac', 'pos_err')
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionWidget'
__replace__(**changes)
__repr__()

Return repr(self).

__static_attributes__ = ()
__weakref__

list of weak references to the object

background: float
calc_time: float
chi2: float
iq0: float
oscillations: float
pos_err: float
pos_frac: float
rg: float
class sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters(reg_constant: float, nterms: int)

Bases: object

__annotations__ = {'nterms': <class 'int'>, 'reg_constant': <class 'float'>}
__dataclass_fields__ = {'nterms': Field(name='nterms',type=<class 'int'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'reg_constant': Field(name='reg_constant',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__dict__ = mappingproxy({'__module__': 'sas.qtgui.Perspectives.Inversion.InversionWidget', '__firstlineno__': 50, '__annotations__': {'reg_constant': <class 'float'>, 'nterms': <class 'int'>}, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'EstimatedParameters' objects>, '__weakref__': <attribute '__weakref__' of 'EstimatedParameters' objects>, '__doc__': 'EstimatedParameters(reg_constant: float, nterms: int)', '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'reg_constant': Field(name='reg_constant',type=<class 'float'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'nterms': Field(name='nterms',type=<class 'int'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function EstimatedParameters.__init__>, '__repr__': <function EstimatedParameters.__repr__>, '__eq__': <function EstimatedParameters.__eq__>, '__match_args__': ('reg_constant', 'nterms')})
__doc__ = 'EstimatedParameters(reg_constant: float, nterms: int)'
__eq__(other)

Return self==value.

__firstlineno__ = 50
__hash__ = None
__init__(reg_constant: float, nterms: int) → None
__match_args__ = ('reg_constant', 'nterms')
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionWidget'
__replace__(**changes)
__repr__()

Return repr(self).

__static_attributes__ = ()
__weakref__

list of weak references to the object

nterms: int
reg_constant: float
class sas.qtgui.Perspectives.Inversion.InversionWidget.InversionResult(logic: sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic, calculator: sas.sascalc.pr.invertor.Invertor, pr_plot: sas.qtgui.Plotting.PlotterData.Data1D | None, data_plot: sas.qtgui.Plotting.PlotterData.Data1D | None, outputs: sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None, estimated_parameters: sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None)

Bases: object

__annotations__ = {'calculator': <class 'sas.sascalc.pr.invertor.Invertor'>, 'data_plot': sas.qtgui.Plotting.PlotterData.Data1D | None, 'estimated_parameters': sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None, 'logic': <class 'sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic'>, 'outputs': sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None, 'pr_plot': sas.qtgui.Plotting.PlotterData.Data1D | None}
__dataclass_fields__ = {'calculator': Field(name='calculator',type=<class 'sas.sascalc.pr.invertor.Invertor'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'data_plot': Field(name='data_plot',type=sas.qtgui.Plotting.PlotterData.Data1D | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'estimated_parameters': Field(name='estimated_parameters',type=sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'logic': Field(name='logic',type=<class 'sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'outputs': Field(name='outputs',type=sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'pr_plot': Field(name='pr_plot',type=sas.qtgui.Plotting.PlotterData.Data1D | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False)
__dict__ = mappingproxy({'__module__': 'sas.qtgui.Perspectives.Inversion.InversionWidget', '__firstlineno__': 55, '__annotations__': {'logic': <class 'sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic'>, 'calculator': <class 'sas.sascalc.pr.invertor.Invertor'>, 'pr_plot': sas.qtgui.Plotting.PlotterData.Data1D | None, 'data_plot': sas.qtgui.Plotting.PlotterData.Data1D | None, 'outputs': sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None, 'estimated_parameters': sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None}, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'InversionResult' objects>, '__weakref__': <attribute '__weakref__' of 'InversionResult' objects>, '__doc__': 'InversionResult(logic: sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic, calculator: sas.sascalc.pr.invertor.Invertor, pr_plot: sas.qtgui.Plotting.PlotterData.Data1D | None, data_plot: sas.qtgui.Plotting.PlotterData.Data1D | None, outputs: sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None, estimated_parameters: sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None)', '__dataclass_params__': _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False,match_args=True,kw_only=False,slots=False,weakref_slot=False), '__dataclass_fields__': {'logic': Field(name='logic',type=<class 'sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'calculator': Field(name='calculator',type=<class 'sas.sascalc.pr.invertor.Invertor'>,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'pr_plot': Field(name='pr_plot',type=sas.qtgui.Plotting.PlotterData.Data1D | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'data_plot': Field(name='data_plot',type=sas.qtgui.Plotting.PlotterData.Data1D | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'outputs': Field(name='outputs',type=sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'estimated_parameters': Field(name='estimated_parameters',type=sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD)}, '__replace__': <function _replace>, '__hash__': None, '__init__': <function InversionResult.__init__>, '__repr__': <function InversionResult.__repr__>, '__eq__': <function InversionResult.__eq__>, '__match_args__': ('logic', 'calculator', 'pr_plot', 'data_plot', 'outputs', 'estimated_parameters')})
__doc__ = 'InversionResult(logic: sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic, calculator: sas.sascalc.pr.invertor.Invertor, pr_plot: sas.qtgui.Plotting.PlotterData.Data1D | None, data_plot: sas.qtgui.Plotting.PlotterData.Data1D | None, outputs: sas.qtgui.Perspectives.Inversion.InversionWidget.CalculatedOutputs | None, estimated_parameters: sas.qtgui.Perspectives.Inversion.InversionWidget.EstimatedParameters | None)'
__eq__(other)

Return self==value.

__firstlineno__ = 55
__hash__ = None
__init__(logic: InversionLogic, calculator: Invertor, pr_plot: Data1D | None, data_plot: Data1D | None, outputs: CalculatedOutputs | None, estimated_parameters: EstimatedParameters | None) → None
__match_args__ = ('logic', 'calculator', 'pr_plot', 'data_plot', 'outputs', 'estimated_parameters')
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionWidget'
__replace__(**changes)
__repr__()

Return repr(self).

__static_attributes__ = ()
__weakref__

list of weak references to the object

calculator: Invertor
data_plot: Data1D | None
estimated_parameters: EstimatedParameters | None
logic: InversionLogic
outputs: CalculatedOutputs | None
pr_plot: Data1D | None
class sas.qtgui.Perspectives.Inversion.InversionWidget.InversionWidget(window, parent=None, data=None, tab_id=1, tab_name='')

Bases: QWidget, Ui_PrInversion

__annotations__ = {'batchResultsWindow': 'BatchInversionOutputPanel | None', 'batch_dict': 'dict[str, Any] | None', 'communicator': 'Communicate', 'dmaxWindow': 'DmaxWindow | None', 'isCalculating': 'bool', 'results': 'list[InversionResult]'}
__doc__ = None
__firstlineno__ = 83
__init__(window, parent=None, data=None, tab_id=1, tab_name='')
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionWidget'
__static_attributes__ = ('batchResultsWindow', 'batch_dict', 'calcThread', 'communicator', 'currentData', 'dmaxWindow', 'input_boxes', 'isCalculating', 'parent', 'results', 'tab_id', 'tab_name', 'window')
acceptsData() → bool
applyNumTermsEstimate()
applyRegConstantEstimate()
batchCalculationComplete(totalElapsed)
batchCalculationOutput
batchResultsWindow: BatchInversionOutputPanel | None
batch_dict: dict[str, Any] | None
calculationComplete
calculationCompleted(out, cov, pr, elapsed)
changeBackgroundMode
clearGuiValues()
communicator: Communicate
property currentData: Data1D | None
property currentDataIndex: int
property currentDataItem: QStandardItem | None
property currentResult: InversionResult
dmaxWindow: DmaxWindow | None
enableButtons()

Enable buttons when data is present, else disable them

endEstimateParameters(nterms, alpha, message, elapsed)
estimateAvailable()
estimationComplete
events()
getPage() → dict[str, Any]
handleBackgroundModeChange()
handleCurrentDataChanged()
handleRemove()
handleShowResults()
initResult() → InversionResult
isCalculating: bool
property is_batch: bool
makePlots(out, cov, pr, elapsed, result=None)
onHelp()
onNewData()
openExplorerWindow()
property q_max: float
property q_min: float
results: list[InversionResult]
serialiseResult(result: InversionResult) → dict[str, Any]
setupValidators()

Apply validators to editable line edits

showBatchCalculationWindow(batch_dict)
showCurrentPlots()
showPlots(result: InversionResult)
startEstimateParameters()
startThread()
startThreadAll()
staticMetaObject = PySide6.QtCore.QMetaObject("InversionWidget" inherits "QWidget": Methods:   #33 type=Signal, signature=calculationComplete()   #34 type=Signal, signature=batchCalculationOutput(PyObject), parameters=PyObject   #35 type=Signal, signature=estimationComplete()   #36 type=Signal, signature=changeBackgroundMode() )
threadError(error: str)
updateFromParameters(params: dict[str, Any])
updateGuiSuggested(nterms, alpha)
updateGuiValues()
updateMaxQ(new_q_max: float)
updateMinQ(new_q_min: float)
updateParams()
updateTab(data: HashableStandardItem | list[HashableStandardItem], tab_id: int)
sas.qtgui.Perspectives.Inversion.InversionWidget.format_float(f: float)
sas.qtgui.Perspectives.Inversion.InversionWidget.format_float_scientific(f: float)

Formats a float in scientific notation with 3 significant figures.

sas.qtgui.Perspectives.Inversion.InversionWidget.get_outputs(invertor: Invertor, elapsed: float)

sas.qtgui.Perspectives.Inversion.Thread module

class sas.qtgui.Perspectives.Inversion.Thread.CalcBatchPr(prs: list[Invertor], nfuncs: list[int] | None = None, tab_id: int | None = None, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)

Bases: CalcThread

Compute P(r) inversion for a batch of data sets in a background thread.

__annotations__ = {}
__doc__ = 'Compute P(r) inversion for a batch of data sets in a background thread.'
__firstlineno__ = 45
__init__(prs: list[Invertor], nfuncs: list[int] | None = None, tab_id: int | None = None, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
__static_attributes__ = ('error_func', 'nfuncs', 'prs', 'starttime')
compute() → None

Perform P(r) inversion for each invertor in the batch.

class sas.qtgui.Perspectives.Inversion.Thread.CalcPr(pr: Invertor, nfunc: int = 5, tab_id: int | None = None, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)

Bases: CalcThread

Compute P(r) inversion in a background thread.

__annotations__ = {'error_func': 'Callable | None', 'nfunc': 'int', 'pr': 'Invertor', 'starttime': 'float', 'tab_id': 'int | None'}
__doc__ = 'Compute P(r) inversion in a background thread.'
__firstlineno__ = 9
__init__(pr: Invertor, nfunc: int = 5, tab_id: int | None = None, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
__static_attributes__ = ('error_func', 'nfunc', 'pr', 'starttime', 'tab_id')
compute() → None

Perform P(r) inversion.

error_func: Callable | None
nfunc: int
pr: Invertor
starttime: float
tab_id: int | None
class sas.qtgui.Perspectives.Inversion.Thread.EstimateNT(pr: Invertor, nfunc: int = 5, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)

Bases: CalcThread

Estimate the number of terms for P(r) inversion in a background thread.

__annotations__ = {'_sleep_delay': 'float', '_time_for_sleep': 'float', 'error_func': 'Callable | None', 'nfunc': 'int', 'pr': 'Invertor', 'starttime': 'float'}
__doc__ = 'Estimate the number of terms for P(r) inversion in a background thread.'
__firstlineno__ = 115
__init__(pr: Invertor, nfunc: int = 5, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
__static_attributes__ = ('_sleep_delay', '_time_for_sleep', 'error_func', 'nfunc', 'pr', 'starttime')
_sleep_delay: float
_time_for_sleep: float
compute() → None

Calculate the estimated number of terms and optimal alpha.

error_func: Callable | None
isquit() → None

Check for quit signal and throttle with a short sleep if needed.

nfunc: int
pr: Invertor
starttime: float
class sas.qtgui.Perspectives.Inversion.Thread.EstimatePr(pr: Invertor, nfunc: int = 5, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)

Bases: CalcThread

Estimate the regularisation parameter alpha for P(r) in a background thread.

__annotations__ = {'error_func': 'Callable | None', 'nfunc': 'int', 'pr': 'Invertor', 'starttime': 'float'}
__doc__ = 'Estimate the regularisation parameter alpha for P(r) in a background thread.'
__firstlineno__ = 82
__init__(pr: Invertor, nfunc: int = 5, error_func: Callable | None = None, completefn: Callable | None = None, updatefn: Callable | None = None, yieldtime: float = 0.01, worktime: float = 0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
__static_attributes__ = ('error_func', 'nfunc', 'pr', 'starttime')
compute() → None

Calculate the alpha estimate.

error_func: Callable | None
nfunc: int
pr: Invertor
starttime: float

Module contents