# sas.qtgui.Calculators.Shape2SAS package

## Subpackages

- sas.qtgui.Calculators.Shape2SAS.PlotAspects package
  - Submodules
  - sas.qtgui.Calculators.Shape2SAS.PlotAspects.plotAspects module
    - `Canvas`
      - `Canvas.staticMetaObject`
    - `ViewerPlotDesign`
      - `ViewerPlotDesign.colour`
  - Module contents
- sas.qtgui.Calculators.Shape2SAS.Tables package
  - Subpackages
    - sas.qtgui.Calculators.Shape2SAS.Tables.UI package
      - Submodules
      - sas.qtgui.Calculators.Shape2SAS.Tables.UI.subunitTableUI module
        - `Ui_SubunitTableController`
          - `Ui_SubunitTableController.retranslateUi()`
          - `Ui_SubunitTableController.setupUi()`
      - sas.qtgui.Calculators.Shape2SAS.Tables.UI.variableTableUI module
        - `Ui_VariableTable`
          - `Ui_VariableTable.retranslateUi()`
          - `Ui_VariableTable.setupUi()`
      - Module contents
  - Submodules
  - sas.qtgui.Calculators.Shape2SAS.Tables.subunitTable module
    - `CustomDelegate`
      - `CustomDelegate.createEditor()`
      - `CustomDelegate.setEditorData()`
      - `CustomDelegate.setModelData()`
      - `CustomDelegate.staticMetaObject`
    - `CustomStandardItem`
      - `CustomStandardItem.data()`
      - `CustomStandardItem.setData()`
    - `DoubleValidator`
      - `DoubleValidator.staticMetaObject`
      - `DoubleValidator.validate()`
    - `ExtendedEnum`
      - `ExtendedEnum.list()`
    - `ModelTableModel`
      - `ModelTableModel.staticMetaObject`
    - `OptionLayout`
      - `OptionLayout.COMX()`
      - `OptionLayout.COMY()`
      - `OptionLayout.COMZ()`
      - `OptionLayout.COM_x`
      - `OptionLayout.COM_y`
      - `OptionLayout.COM_z`
      - `OptionLayout.Colour`
      - `OptionLayout.RPX()`
      - `OptionLayout.RPY()`
      - `OptionLayout.RPZ()`
      - `OptionLayout.RP_x`
      - `OptionLayout.RP_y`
      - `OptionLayout.RP_z`
      - `OptionLayout.SLD()`
      - `OptionLayout.Subunit`
      - `OptionLayout.alpha()`
      - `OptionLayout.beta()`
      - `OptionLayout.colour()`
      - `OptionLayout.cube()`
      - `OptionLayout.cuboid()`
      - `OptionLayout.cyl_ring()`
      - `OptionLayout.cylinder()`
      - `OptionLayout.disc()`
      - `OptionLayout.ellipsoid()`
      - `OptionLayout.elliptical_cylinder()`
      - `OptionLayout.gamma()`
      - `OptionLayout.get_position()`
      - `OptionLayout.hollow_cube()`
      - `OptionLayout.hollow_sphere()`
      - `OptionLayout.sphere()`
      - `OptionLayout.x`
      - `OptionLayout.y`
      - `OptionLayout.z`
      - `OptionLayout.ΔSLD`
      - `OptionLayout.α`
      - `OptionLayout.β`
      - `OptionLayout.γ`
    - `SubunitTable`
      - `SubunitTable.initializeModel()`
      - `SubunitTable.initializeSignals()`
      - `SubunitTable.onAdding()`
      - `SubunitTable.onClearSubunitTable()`
      - `SubunitTable.onDeleting()`
      - `SubunitTable.setButtonSpinboxBounds()`
      - `SubunitTable.setSubunitOptions()`
      - `SubunitTable.setSubunitRestriction()`
      - `SubunitTable.setTableProperties()`
      - `SubunitTable.smallestInteger()`
      - `SubunitTable.staticMetaObject`
  - sas.qtgui.Calculators.Shape2SAS.Tables.variableTable module
    - `CustomDelegate`
      - `CustomDelegate.createEditor()`
      - `CustomDelegate.setEditorData()`
      - `CustomDelegate.setModelData()`
      - `CustomDelegate.staticMetaObject`
    - `ModelVariableTableModel`
      - `ModelVariableTableModel.headerData()`
      - `ModelVariableTableModel.staticMetaObject`
    - `VariableTable`
      - `VariableTable.getAllTableColumnsPos()`
      - `VariableTable.getAllTableNamesVariables()`
      - `VariableTable.getCheckedTableNamesVariables()`
      - `VariableTable.getCheckedVariables()`
      - `VariableTable.initializeVariableModel()`
      - `VariableTable.onClearTable()`
      - `VariableTable.removeTableData()`
      - `VariableTable.resetTable()`
      - `VariableTable.setDefaultLayout()`
      - `VariableTable.setUncheckToAllCheckBoxes()`
      - `VariableTable.setVariableTableData()`
      - `VariableTable.staticMetaObject`
  - Module contents
- sas.qtgui.Calculators.Shape2SAS.UI package
  - Submodules
  - sas.qtgui.Calculators.Shape2SAS.UI.ButtonOptionsUI module
    - `Ui_ButtonOptions`
      - `Ui_ButtonOptions.retranslateUi()`
      - `Ui_ButtonOptions.setupUi()`
  - sas.qtgui.Calculators.Shape2SAS.UI.ConstraintsUI module
    - `Ui_Constraints`
      - `Ui_Constraints.retranslateUi()`
      - `Ui_Constraints.setupUi()`
  - sas.qtgui.Calculators.Shape2SAS.UI.DesignWindowUI module
    - `Ui_Shape2SAS`
      - `Ui_Shape2SAS.retranslateUi()`
      - `Ui_Shape2SAS.setupUi()`
  - sas.qtgui.Calculators.Shape2SAS.UI.ViewerButtonsUI module
    - `Ui_ViewerButtons`
      - `Ui_ViewerButtons.retranslateUi()`
      - `Ui_ViewerButtons.setupUi()`
  - sas.qtgui.Calculators.Shape2SAS.UI.ViewerModelRadiusUI module
    - `Ui_ViewerModelRadius`
      - `Ui_ViewerModelRadius.retranslateUi()`
      - `Ui_ViewerModelRadius.setupUi()`
  - Module contents

## Submodules

## sas.qtgui.Calculators.Shape2SAS.ButtonOptions module

class sas.qtgui.Calculators.Shape2SAS.ButtonOptions.ButtonOptions(parent=None)

  Bases: `QWidget`, `Ui_ButtonOptions`

  close, reset and help options

  staticMetaObject = PySide6.QtCore.QMetaObject("ButtonOptions" inherits "QWidget": )

## sas.qtgui.Calculators.Shape2SAS.Constraints module

class sas.qtgui.Calculators.Shape2SAS.Constraints.Constraints(parent=None)

  Bases: `QWidget`, `Ui_Constraints`

  checkPythonSyntax(text: str)

    Check if text is valid python syntax

  clearConstraints()

    Clear text editor containing constraints

  extractValues(elt: AST) → str | int | float
  getConstraintText(constraints: str) → str

    Get default text for constraints

  getConstraints(constraintsStr: str, fitPar: [<class 'str'>], modelPars: [<class 'str'>], modelVals: [[<class 'float'>]], checkedPars: [<class 'str'>]) -> ([<class 'str'>], <class 'str'>, <class 'str'>, [[<class 'bool'>]])

    Read inputs from text editor

  getImportStatements(text: str) → [<class 'str'>]

    return all import statements that were written in the text editor

  getParameters(constraintsStr: str, fitPar: [<class 'str'>]) → str

    Get parameters from constraints

  getParametersFromConstraints(constraints_str: str, targetName: str) → []

    Extract parameters from constraints string

  static getPosition(item: str | int | float, itemLists: [[str | int | float]]) -> (<class 'int'>, <class 'int'>)

    Find position of an item in lists

  getTranslation(constraintsStr: str, importStatement: [<class 'str'>], modelPars: [[<class 'str'>]], modelVals: [[<class 'float'>]], checkedPars: [[<class 'str'>]]) -> (<class 'str'>, [[<class 'bool'>]])

    Get translation from constraints

  ifParameterExists(lineNames: [<class 'str'>], modelPars: [[<class 'str'>]]) → bool

    Check if parameter exists in model parameters

  isImportFromStatement(node: ImportFrom) → [<class 'str'>]

    Return list of ImportFrom statements

  isImportStatement(node: Import) → [<class 'str'>]

    Return list of Import statements

  onClosingConstraints()

    Close constraints page

  static removeFromList(listItems: [str | int | float], listToCompare: [str | int | float])

    Remove items from a list if in another list

  setConstraints(constraints: str)

    Set text to QTextEdit

  staticMetaObject = PySide6.QtCore.QMetaObject("Constraints" inherits "QWidget": )

## sas.qtgui.Calculators.Shape2SAS.DesignWindow module

class sas.qtgui.Calculators.Shape2SAS.DesignWindow.DesignWindow(parent=None)

  Bases: `QDialog`, `Ui_Shape2SAS`, `Perspective`

  Main window for the Shape2SAS fitting tool

  addToVariableTable()

    Set up parameters to the variable table

  checkStateOfConstraints(fitPar: list[str], modelPars: list[list[str]], modelVals: list[list[float]], checkedPars: list[list[bool]]) → tuple[str, str, str]

    Check if the user has written constraints. Otherwise return Default

  checkedVariables()

    Get checked variables from the variable table with inserted restricted rows

  deleteFromVariableTable()

    Delete parameters from the variable table

  enableButtons(toggle: bool)
  ext = 'data_file'
  getAllTableNames(condition: MethodType, **kwargs) → list[list[str]]

    Get all parameter names in the subunit table

  getConstraintsToTextEditor()

    Set translation and parameters constraints to the text editor

  getFitParameters() → list[str]

    return names of the chosen fit parameters

  getModelData(condition: MethodType, **kwargs) → list[list[float | str]]

    Get all data in the subunit table

  getModelProfile(condition: MethodType, **kwargs) → ModelProfile

    Get model profile

  getPluginModel()

    Generating a plugin model and sends it to the Plugin Models folder in SasView

  getSimulatedSAXSData()

    Generating simulated data and sends it to the Data Explorer in SasView

  getStandardReadOfTableData() → list[list[float | str]]

    Get a standard data read from subunit TableView

  getStructureFactorValues()

    Read structure factor options from chosen structure factor in Virtual SAXS experiment tab

  getSubunitTableCell(row: int, column: int) → float | str

    Get model data from a single cell.

  getSubunitTableRow(condition: MethodType, row: int, **kwargs) → list[float | str]

    Get model data from a single row

  getSubunitTableSets(condition: MethodType, rows: list[int], **kwargs) → list[list[float | str]]

    Get a set of rows per column in subunit table

  getTableName(column: int, row: int) → str

    Get the parameter name of a cell in the subunit table

  getTableNames(condition: MethodType, column: int, **kwargs) → list[str]

    Get the parameter names of a column in the subunit table

  getViewFeatures() → ViewerPlotDesign

    Get values affecting the illustrative aspect of Viewer

  static ifEmptyName(name: str, names: list[str], **kwargs)

    condition method. Append if not empty

  static ifEmptyValue(value: float | str, values: list[float | str], *args, **kwargs)

    condition method. Append if not empty

  static ifFitPar(value: float | str, values: list[float | str], *args, **kwargs)

    condition method. Append FitPar if condition. Otherwise append constant

  static ifNoCondition(name: str, names: list[str], **kwargs)

    condition method. Append

  name = 'Shape2SAS'
  onCheckingInput(input: str, default: str) → str

    Check if the input not None. Otherwise, return default value

  onClickingClose()

    Close Shape2SAS GUI

  onClickingPlot()

    Get 3D plot of the designed model in the Build model tab. If checked, plot theoretical scattering from the designed model.

  onConstraintReset()

    Reset Constraint window to default

  onHelp()

    Opening the help window

  onSAXSExperimentReset()

    Reset Virtual SAXS Experiment tab to default

  onSubunitTableReset()

    Reset subunit table to default

  plotSimulatedSAXSData()

    Plotting simulated SAXS data in the Virtual SAXS Experiment tab

  sendSimulatedSAXSToDataExplorer()

    Send simulated data to the Data Explorer in SasView

  setConstraintsToTextEditor()

    Set constraints to the text editor

  showConstraintWindow()

    Get the Constraint window

  showSimulatedSAXSData()

    Plotting simulated SAXS data in the Virtual SAXS Experiment tab

  showStructureFactorOptions()

    Show options for structure factor

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

    Window title

  updateDeleteButton()

## sas.qtgui.Calculators.Shape2SAS.ViewerAllOptions module

class sas.qtgui.Calculators.Shape2SAS.ViewerAllOptions.ViewerButtons(parent=None)

  Bases: `QWidget`, `Ui_ViewerButtons`

  XY, XZ, YZ view axis buttons

  staticMetaObject = PySide6.QtCore.QMetaObject("ViewerButtons" inherits "QWidget": )

class sas.qtgui.Calculators.Shape2SAS.ViewerAllOptions.ViewerModelRadius(parent=None)

  Bases: `QWidget`, `Ui_ViewerModelRadius`

  Model radius view

  staticMetaObject = PySide6.QtCore.QMetaObject("ViewerModelRadius" inherits "QWidget": )

## sas.qtgui.Calculators.Shape2SAS.ViewerModel module

class sas.qtgui.Calculators.Shape2SAS.ViewerModel.ViewerModel(parent=None)

  Bases: `QWidget`

  Graphics view of designed model

  initialiseAxis()

    Initialise axis for the model

  onXYClicked()

    XY view

  onYZClicked()

    YZ view

  onZXClicked()

    ZX view

  onZoomChanged()

    Change zoom value on doubleSpinBox

  scatter

    NOTE: Orignal intend was to create QScatter3DSeries() in setPlot() method. However, this causes some initialisation problems. Initialising setPlot() method might fix this, but then a fictive model would be needed. TODO: Investigate a better solution.

  setAxis(x_range: (<class 'float'>, <class 'float'>), y_range: (<class 'float'>, <class 'float'>), z_range: (<class 'float'>, <class 'float'>))

    Set axis for the model

  setClearModelPlot()

    Clear the model plot

  setClearScatteringPlot()

    Clear the Scattering plot

  setPlot(distr: ModelPointDistribution, design: ViewerPlotDesign)

    Plot the model

  setScatteringPlot(theo: TheoreticalScattering)

    Set the scattering plot

  setZoom()

    Zoom in/out

  staticMetaObject = PySide6.QtCore.QMetaObject("ViewerModel" inherits "QWidget": )

## sas.qtgui.Calculators.Shape2SAS.genPlugin module

sas.qtgui.Calculators.Shape2SAS.genPlugin.generateModel(prof: ~sas.sascalc.shape2sas.Shape2SAS.ModelProfile, constrainParameters: str, fitPar: [<class 'str'>], Npoints: int, pr_points: int, model_name: str) → str

  Generates a theoretical model

sas.qtgui.Calculators.Shape2SAS.genPlugin.generatePlugin(prof: ~sas.sascalc.shape2sas.Shape2SAS.ModelProfile, constrainParameters: str, fitPar: [<class 'str'>], Npoints: int, pr_points: int, file_name: str) -> (<class 'str'>, <class 'pathlib.Path'>)

  Generates a theoretical scattering plugin model

sas.qtgui.Calculators.Shape2SAS.genPlugin.parListFormat(par: [[str | float]]) → str

  Format a list of parameters to the model string. In this case the list is on element for each shape. For a single shape there will be only a single value. Mainly for delta Rho.

sas.qtgui.Calculators.Shape2SAS.genPlugin.parListsFormat(par: [str | float]) → str

  Format a list of list containing parameters to the model string. This is used for single shape parameter lists like the center of mass of the object which will be an element of the list of such COM for each shape in a multishape model.

## Module contents