# sas.qtgui.Perspectives.Invariant package

## Subpackages

- sas.qtgui.Perspectives.Invariant.UI package
  - Submodules
  - sas.qtgui.Perspectives.Invariant.UI.InvariantDetailsUI module
    - `Ui_Dialog`
      - `Ui_Dialog.retranslateUi()`
      - `Ui_Dialog.setupUi()`
  - sas.qtgui.Perspectives.Invariant.UI.TabbedInvariantUI module
    - `Ui_tabbedInvariantUI`
      - `Ui_tabbedInvariantUI.retranslateUi()`
      - `Ui_tabbedInvariantUI.setupUi()`
  - Module contents

## Submodules

## sas.qtgui.Perspectives.Invariant.InvariantDetails module

class sas.qtgui.Perspectives.Invariant.InvariantDetails.DetailsDialog(parent)

  Bases: `QDialog`, `Ui_Dialog`

  This class stores some values resulting from invariant calculations. Given the value of total invariant, this class can also determine the percentage of invariants resulting from extrapolation.

  checkValues()

    Create a warning message to be displayed in panel if problems with values

  closeEvent(event)

    Re-enables the status button when closed

  setModel(model)
  showDialog()

    Fill the dialog with values of calculated Q, progress bars

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

## sas.qtgui.Perspectives.Invariant.InvariantPerspective module

class sas.qtgui.Perspectives.Invariant.InvariantPerspective.InvariantWindow(parent=None)

  Bases: `QDialog`, `Ui_tabbedInvariantUI`, `Perspective`

  allowBatch()

    Tell the caller that we don’t accept multiple data instances

  allowSwap()

    Tell the caller that we can’t swap data

  allow_calculation()
  calculate_invariant() → None

    Use twisted to thread the calculations away

  calculate_thread(extrapolation: str) → None

    Perform Invariant calculations.

  checkLength()

    Validators of number of points for extrapolation. Error if it is larger than the distribution length

  checkQExtrapolatedData()

    Match status of low or high-Q extrapolated data checkbox in DataExplorer with low or high-Q extrapolation checkbox in invariant panel

  checkQMaxRange(value=None)
  checkQMinRange(value=None)
  checkQRange()

    Validate the Q range for the upper and lower bounds

    Valid: q_low_max < q_high_min, q_low_min < q_low_max, q_high_min > q_low_max, q_high_max > q_high_min

  closeEvent(event)

    Overwrite QDialog close method to allow for custom widget close

  deferredPlot(model: QStandardItemModel) → None

    Run the GUI/model update in the main thread

  enabling()
  ext = 'inv'
  get_high_q_extrapolation_lower_limit()
  get_low_q_extrapolation_upper_limit()
  hiFitAndFixToggle(toggle)

    Enable editing of power exponent if Fix for high Q is checked Disable otherwise

  highQToggle(clicked)

    Disable/enable High Q extrapolation

  isSerializable()

    Tell the caller that this perspective writes its state

  lowFitAndFixToggle(toggle)

    Fit and Fix radiobuttons cannot be selected at the same time

  lowGuinierAndPowerToggle(toggle)

    Guinier and Power radio buttons cannot be selected at the same time If Power is selected, Fit and Fix radio buttons are visible and Power line edit can be edited if Fix is selected

  lowQToggle(clicked)

    Disable / enable Low Q extrapolation

  modelChanged(item)

    Update when model changed

  name = 'Invariant'
  onHelp()

    Display help when clicking on Help button

  onStatus()

    Display Invariant Details panel when clicking on Status button

  on_calculation_failed(reason) → None
  plot_result(model: QStandardItemModel) → None

    Plot result of calculation

  removeData(data_list: list = None)

    Remove the existing data reference from the Invariant Persepective

  serializeAll()

    Serialize the invariant state so data can be saved Invariant is not batch-ready so this will only effect a single page :return: {data-id: {self.name: {invariant-state}}}

  serializeCurrentPage()

    Serialize and return a dictionary of {data_id: invariant-state} Return empty dictionary if no data :return: {data-id: {self.name: {invariant-state}}}

  serializePage() → dict

    Serializes full state of this invariant page Called by Save Analysis :return: {invariant-state}

  serializeState() → dict

    Collects all active params into a dictionary of {name: value} :return: {name: value}

  setClosable(value: bool = True)

    Allow outsiders close this widget

  setData(data_item: QStandardItem = None, is_batch: bool = False)

    Obtain a QStandardItem object and dissect it to get Data1D/2D Pass it over to the calculator

  set_high_q_extrapolation_lower_limit(value)
  set_low_q_extrapolation_upper_limit(value)
  setupMapper()
  setupModel()
  setupSlots()
  stateChanged()

    Catch modifications from low- and high-Q extrapolation check boxes

  staticMetaObject = PySide6.QtCore.QMetaObject("InvariantWindow" inherits "QDialog": )
  property title

    Perspective name

  updateFromGui()

    Update model when new user inputs

  updateFromModel()

    Update the globals based on the data in the model

  updateFromParameters(params)

    Called by Open Project and Open Analysis :param params: {param_name: value} :return: None

  updateGuiFromFile(data: Data1D = None)

    update display in GUI and plot

  update_details_widget() → None

    On demand update of the details widget

  update_model_from_thread(row: int, value: float) → None

    Update the model in the main thread

## sas.qtgui.Perspectives.Invariant.InvariantUtils module

## Module contents