sas.qtgui.Utilities package

Subpackages

Submodules

sas.qtgui.Utilities.AddMultEditor module

Widget for simple add / multiply editor.

class sas.qtgui.Utilities.AddMultEditor.AddMultEditor(parent=None)

Bases: QDialog, Ui_AddMultEditorUI

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.AddMultEditor'
_checkIfLayered(model)

Check models for layered or conditional parameters. Add them to self.layered_models if criteria is met.

_updateModelLists()

Update the combo boxes for both lists of models. The models in layered_models can only be included a single time in a plugin model. The two combo boxes could be different if a layered model is selected.

onApply()

Validity check, save model to file

onHelp()

Display related help section

onNameCheck()

Check if proposed new model name does not already exists (if the overwriting is not allowed). If not an error message not show error message is displayed

onOperatorChange(index)

Respond to operator combo box changes

onOverwrite()

Modify state on checkbox change

readModels(std_only=False)

Generate list of all models

setupModels()

Add list of models to ‘Model1’ and ‘Model2’ comboboxes

setupSignals()

Signals from various elements

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

Update contents of combo boxes with new plugin models

write_new_model_to_file(fname, model1_name, model2_name, operator)

Write and Save file

sas.qtgui.Utilities.CategoryInstaller module

Class for making sure all category stuff is installed and works fine.

Copyright (c) Institut Laue-Langevin 2012

@author kieranrcampbell@gmail.com @modified by NIST/MD sasview team

class sas.qtgui.Utilities.CategoryInstaller.CategoryInstaller

Bases: object

Class for making sure all category stuff is installed

Note - class is entirely static!

__dict__ = mappingproxy({'__module__': 'sas.qtgui.Utilities.CategoryInstaller', '__doc__': '\n    Class for making sure all category stuff is installed\n\n    Note - class is entirely static!\n    ', '__init__': <function CategoryInstaller.__init__>, '_get_home_dir': <staticmethod(<function CategoryInstaller._get_home_dir>)>, '_regenerate_model_dict': <staticmethod(<function CategoryInstaller._regenerate_model_dict>)>, '_regenerate_master_dict': <staticmethod(<function CategoryInstaller._regenerate_master_dict>)>, 'get_user_file': <staticmethod(<function CategoryInstaller.get_user_file>)>, 'get_default_file': <staticmethod(<function CategoryInstaller.get_default_file>)>, 'check_install': <staticmethod(<function CategoryInstaller.check_install>)>, '__dict__': <attribute '__dict__' of 'CategoryInstaller' objects>, '__weakref__': <attribute '__weakref__' of 'CategoryInstaller' objects>, '__annotations__': {}})
__doc__ = '\n    Class for making sure all category stuff is installed\n\n    Note - class is entirely static!\n    '
__init__()

initialization

__module__ = 'sas.qtgui.Utilities.CategoryInstaller'
__weakref__

list of weak references to the object

static _get_home_dir()

returns the users sasview config dir

static _regenerate_master_dict(by_model_dict, model_enabled_dict)

regenerates master_category_dict from by_model_dict and model_enabled_dict returns the master category dictionary

static _regenerate_model_dict(master_category_dict)

regenerates self.by_model_dict which has each model name as the key and the list of categories belonging to that model along with the enabled mapping returns tuplet (by_model_dict, model_enabled_dict)

static check_install(homedir=None, model_list=None)

the main method of this class makes sure categories.json exists and if not compile it and install :param homefile: Override the default home directory :param model_list: List of model names except customized models

static get_default_file()
static get_user_file()

returns the user data file, eg .sasview/categories.json.json

sas.qtgui.Utilities.CodeEditor module

class sas.qtgui.Utilities.CodeEditor.QCodeEditor(parent=None)

Bases: QPlainTextEdit

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None) None
__init__(self, text: str, parent: PySide6.QtWidgets.QWidget | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.CodeEditor'
highlightCurrentLine()
lineNumberAreaPaintEvent(event)
lineNumberAreaWidth()
resizeEvent(self, e: PySide6.QtGui.QResizeEvent) None
staticMetaObject = PySide6.QtCore.QMetaObject("QCodeEditor" inherits "QPlainTextEdit": )
updateLineNumberArea(rect, dy)
updateLineNumberAreaWidth()
class sas.qtgui.Utilities.CodeEditor.QLineNumberArea(editor)

Bases: QWidget

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.CodeEditor'
paintEvent(self, event: PySide6.QtGui.QPaintEvent) None
sizeHint(self) PySide6.QtCore.QSize
staticMetaObject = PySide6.QtCore.QMetaObject("QLineNumberArea" inherits "QWidget": )

sas.qtgui.Utilities.ConnectionProxy module

class sas.qtgui.Utilities.ConnectionProxy.ConnectionProxy(url, timeout)

Bases: object

__dict__ = mappingproxy({'__module__': 'sas.qtgui.Utilities.ConnectionProxy', '__init__': <function ConnectionProxy.__init__>, '_get_addresses_of_proxy_pac': <function ConnectionProxy._get_addresses_of_proxy_pac>, '_parse_proxy_pac': <function ConnectionProxy._parse_proxy_pac>, '_set_proxy': <function ConnectionProxy._set_proxy>, 'connect': <function ConnectionProxy.connect>, '__dict__': <attribute '__dict__' of 'ConnectionProxy' objects>, '__weakref__': <attribute '__weakref__' of 'ConnectionProxy' objects>, '__doc__': None, '__annotations__': {}})
__doc__ = None
__init__(url, timeout)
__module__ = 'sas.qtgui.Utilities.ConnectionProxy'
__weakref__

list of weak references to the object

_get_addresses_of_proxy_pac()

Return a list of possible auto proxy .pac files being used, based on the system registry (win32) or system preferences (OSX). @return: list of urls

_parse_proxy_pac(pac_urls_list)

For every pac file url in pac_urls_list, it tryes to connect. If the connection is successful parses the file in search for http proxies. @param pac_urls_list: List with urls for the pac files @return: list with all found http proxies

_set_proxy(proxy_dic=None)

Sets connection proxy. if proxy_dic is None get’s teh proxy from the system. To disable autodetected proxy pass an empty dictionary: {} @param proxy_dic: format: {‘http’: ‘http://www.example.com:3128/’}

connect()

Performs the request and gets a response from self.url @return: response object from urllib2.urlopen

sas.qtgui.Utilities.DocRegenInProgess module

class sas.qtgui.Utilities.DocRegenInProgess.DocRegenProgress(parent=None)

Bases: QWidget, Ui_DocRegenProgress

__doc__ = None
__init__(parent=None)

The DocRegenProgress class is a window to display the progress of the documentation regeneration process.

Parameters:

parent – Any Qt object with a communicator that can trigger events.

__module__ = 'sas.qtgui.Utilities.DocRegenInProgess'
addSignals()

Adds triggers and signals to the window to ensure proper behavior.

close()

Override the close behavior to ensure the window always exists in memory.

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

This method is triggered whenever the file associated with the file_watcher object is changed.

sas.qtgui.Utilities.DocViewWidget module

class sas.qtgui.Utilities.DocViewWidget.DocGenThread(completefn=None, updatefn=None, yieldtime=0.03, worktime=0.03, reset_flag=False)

Bases: CalcThread

Thread performing the fit

__annotations__ = {}
__doc__ = 'Thread performing the fit '
__init__(completefn=None, updatefn=None, yieldtime=0.03, worktime=0.03, reset_flag=False)
__module__ = 'sas.qtgui.Utilities.DocViewWidget'
close()
compute(target=None)

Regen the docs in a separate thread

class sas.qtgui.Utilities.DocViewWidget.DocViewWindow(source: Path = None)

Bases: QDialog, Ui_DocViewerWindow

__doc__ = None
__init__(source: Path = None)

The DocViewWindow class is an HTML viewer built into SasView.

Parameters:
  • parent – Any Qt object with a communicator that can trigger events.

  • source – The Path to the html file.

__module__ = 'sas.qtgui.Utilities.DocViewWidget'
docRegenComplete(*args)

Tells Qt that regeneration of docs is done and emits signal tied to opening documentation viewer window. This method is likely called as a thread call back, but no value is used from that callback return.

initializeSignals()

Initialize all external signals that will trigger events for the window.

load404()
loadHtml()

Loads the HTML file specified when this python is called from another part of the program.

static newer(src: Path | str | PathLike, html: Path | str | PathLike) bool

Compare two files to determine if a file regeneration is required.

Parameters:
  • src – The ReST file that might need regeneration.

  • html – The HTML file built from the ReST file.

Returns:

Is the ReST file newer than the HTML file? Returned as a boolean.

onClose()

Close window Keep as a separate method to allow for additional functionality when closing

onEdit()

Open editor (TabbedModelEditor) window.

onShow()

Show window Keep as a separate method to allow for additional functionality when opening

processUrl() QUrl

Process path into proper QUrl for use in QWebViewer.

Returns:

A QtCore.QUrl object built using self.source.

refresh()
regenerateDocs(target: Path | str | PathLike = None)

Regenerates documentation for a specific file (target) in a subprocess

Parameters:

target – A file-path like object that needs regeneration.

regenerateHtml(file_name: Path | str | PathLike)

Regenerate the documentation for the file passed to the method

Parameters:

file_name – A file-path like object that needs regeneration.

regenerateIfNeeded()

Determines whether a file needs to be regenerated. If it does, it will regenerate based off whether it is detected as SasView docs or a model. The documentation window will open after the process of regeneration is completed. Otherwise, simply triggers a load of the documentation window with loadHtml()

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

Set the title of the window to include the name of the document, found in the first <h1> tags.

sas.qtgui.Utilities.FileConverter module

File Converter Widget

class sas.qtgui.Utilities.FileConverter.FileConverterWidget(parent=None)

Bases: QDialog, Ui_FileConverterUI

__doc__ = None
__init__(parent=None)

Parent here is the GUI Manager. Required for access to the help location and to the file loader.

__module__ = 'sas.qtgui.Utilities.FileConverter'
addSlots()

Create callbacks for UI elements and outside signals

askFrameRange(n_frames=1)

Display a dialog asking the user to input the range of frames they would like to export

Parameters:

n_frames – How many frames the loaded data file has

Returns:

A dictionary containing the parameters input by the user

convert1Ddata(qdata, iqdata, ofile, metadata)

Formats a 1D array of q_axis data and a 2D array of I axis data (where each row of iqdata is a separate row), into an array of Data1D objects

extractBSLdata(filename)

Extracts data from a 2D BSL file

Parameters:

filename – The header file to extract the data from

Return x_data:

A 1D array containing all the x coordinates of the data

Return y_data:

A 1D array containing all the y coordinates of the data

Return frame_data:

A dictionary of the form {frame_number: data}, where data is a 2D numpy array containing the intensity data

getDetectorMetadata()

Read the detector metadata fields and put them in the dictionary

getMetadata()

metadata getter

getSampleMetadata()

Read the sample metadata fields and put them in the dictionary

getSourceMetadata()

Read the source metadata fields and put them in the dictionary

onConvert()

Call the conversion method (and update DataExplorer with converted data)?

onHelp()

Display online help related to the file converter

onIFileOpen()

Show the path chooser for file with I

onInputFormat()

Enable/disable UI items based on input format spec

onNewFile()

show the save new file widget

onNewFileEdited()

Update the output file state on direct field edit

onQFileOpen()

Show the path chooser for file with Q

openFile()

Show the path chooser for existent file

readMetadata()

Read the metadata fields and put them in the dictionary

This reads the UI elements directly, but we don’t have a clear MVP distinction in this widgets, so there.

setValidators()

Apply validators for double precision numbers to numerical fields

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

Asserts presece of files for coversion. If all present -> enable the Convert button.

sas.qtgui.Utilities.FrameSelect module

FrameSelect class describes behaviour of the FrameSelect dialog

class sas.qtgui.Utilities.FrameSelect.FrameSelect(parent=None, frames=1, isBSL=True)

Bases: QDialog, Ui_FrameSelect

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.FrameSelect'
addSlots()

Describe behaviour of OK and Cancel buttons

addState()

Minor bookkeeping

addText()

Initialize view

getFrames()

Accessor for state values

onFirstChanged()

Manage view-model sync

onIncrementChanged()

Manage view-model sync

onLastChanged()

Manage view-model sync

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

manage model-view sync

sas.qtgui.Utilities.GenericReader module

Thread handler used to load data

class sas.qtgui.Utilities.GenericReader.GenReader(path, loader, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)

Bases: CalcThread

Load a sld data given a filename

__annotations__ = {}
__doc__ = '\n    Load a sld data given a filename\n    '
__init__(path, loader, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)
__module__ = 'sas.qtgui.Utilities.GenericReader'
compute()

Read some data

isquit()

@raise KeyboardInterrupt: when the thread is interrupted

sas.qtgui.Utilities.GridPanel module

class sas.qtgui.Utilities.GridPanel.BatchInversionOutputPanel(parent=None, output_data=None)

Bases: BatchOutputPanel

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, flags: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.GridPanel'
closeEvent(event)

Tell the parent window the window closed

onHelp()

Open a local url in the default browser

setupTable(widget=None, data=None)

Create tablewidget items and show them, based on params

staticMetaObject = PySide6.QtCore.QMetaObject("BatchInversionOutputPanel" inherits "BatchOutputPanel": )
class sas.qtgui.Utilities.GridPanel.BatchOutputPanel(parent=None, output_data=None)

Bases: QMainWindow, Ui_GridPanelUI

ERROR_COLUMN_CAPTION = ' (Err)'
IS_WIN = True
__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, flags: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.GridPanel'
actionLoadData()

Open file load dialog and load a .csv file

actionSaveFile()

Generate a .csv file and dump it do disk

actionSendToExcel()

Generates a .csv file and opens the default CSV reader

addFitResults(results)

Create a new tab with batch fitting results

addTabPage(name=None)

Add new tab page with QTableWidget

addToolbarActions()

Assing actions and callbacks to the File menu items

closeEvent(event)

Overwrite QDialog close method to allow for custom widget close

currentTable()

Returns the currently shown QTabWidget

classmethod dataFromTable(table)

Creates a dictionary {<parameter>:[list of values]} from the parameter table

onHelp()

Open a local url in the default browser

onPlot()

Plot selected fits by sending signal to the parent

setupTable(widget=None, data=None)

Create tablewidget items and show them, based on params

setupTableFromCSV(csv_data)

Create tablewidget items and show them, based on params

showContextMenu(position)

Show context specific menu in the tab table widget.

staticMetaObject = PySide6.QtCore.QMetaObject("BatchOutputPanel" inherits "QMainWindow": Methods:   #40 type=Signal, signature=windowClosedSignal() )
windowClosedSignal
classmethod writeBatchToFile(data, tmpfile, details='')

Helper to write result from batch into cvs file

sas.qtgui.Utilities.GuiUtils module

Global defaults and various utility functions usable by the general GUI

class sas.qtgui.Utilities.GuiUtils.Communicate

Bases: QObject

SaveFitParamsSignal
__doc__ = None
__module__ = 'sas.qtgui.Utilities.GuiUtils'
activeGraphName
activeGraphsSignal
changeDataExplorerTabSignal
closeSignal
copyExcelFitParamsSignal
copyFitParamsSignal
copyLatexFitParamsSignal
customModelDirectoryChanged
dataDeletedSignal
deleteIntermediateTheoryPlotsSignal
documentationRegenInProgressSignal
documentationRegeneratedSignal
documentationUpdateLogSignal
extMaskEditorSignal
fileDataReceivedSignal
fileReadSignal
forcePlotDisplaySignal
maskEditorSignal
pasteFitParamsSignal
perspectiveChangedSignal
plotFromNameSignal
plotRequestedSignal
plotUpdateSignal
progressBarUpdateSignal
resultPlotUpdateSignal
sendDataToGridSignal
sendDataToPanelSignal
staticMetaObject = PySide6.QtCore.QMetaObject("Communicate" inherits "QObject": Methods:   #5 type=Signal, signature=fileReadSignal(QVariantList), parameters=QVariantList   #6 type=Signal, signature=fileDataReceivedSignal(PyObject), parameters=PyObject   #7 type=Signal, signature=statusBarUpdateSignal(QString), parameters=QString   #8 type=Signal, signature=updatePerspectiveWithDataSignal(QVariantList), parameters=QVariantList   #9 type=Signal, signature=updateModelFromPerspectiveSignal(QStandardItem*), parameters=QStandardItem*   #10 type=Signal, signature=updateTheoryFromPerspectiveSignal(QStandardItem*), parameters=QStandardItem*   #11 type=Signal, signature=deleteIntermediateTheoryPlotsSignal(QString), parameters=QString   #12 type=Signal, signature=plotRequestedSignal(QVariantList,int), parameters=QVariantList, int   #13 type=Signal, signature=plotFromNameSignal(QString), parameters=QString   #14 type=Signal, signature=plotUpdateSignal(QVariantList), parameters=QVariantList   #15 type=Signal, signature=progressBarUpdateSignal(int), parameters=int   #16 type=Signal, signature=activeGraphsSignal(QVariantList), parameters=QVariantList   #17 type=Signal, signature=activeGraphName(PyObject), parameters=PyObject   #18 type=Signal, signature=perspectiveChangedSignal(QString), parameters=QString   #19 type=Signal, signature=dataDeletedSignal(QVariantList), parameters=QVariantList   #20 type=Signal, signature=sendDataToPanelSignal(PyObject), parameters=PyObject   #21 type=Signal, signature=updateModelFromDataOperationPanelSignal(QStandardItem*,PyObject), parameters=QStandardItem*, PyObject   #22 type=Signal, signature=customModelDirectoryChanged()   #23 type=Signal, signature=sendDataToGridSignal(QVariantList), parameters=QVariantList   #24 type=Signal, signature=maskEditorSignal(PyObject), parameters=PyObject   #25 type=Signal, signature=extMaskEditorSignal()   #26 type=Signal, signature=copyFitParamsSignal(QString), parameters=QString   #27 type=Signal, signature=copyExcelFitParamsSignal(QString), parameters=QString   #28 type=Signal, signature=copyLatexFitParamsSignal(QString), parameters=QString   #29 type=Signal, signature=SaveFitParamsSignal(QString), parameters=QString   #30 type=Signal, signature=pasteFitParamsSignal()   #31 type=Signal, signature=updateModelCategoriesSignal()   #32 type=Signal, signature=changeDataExplorerTabSignal(int), parameters=int   #33 type=Signal, signature=resultPlotUpdateSignal(QVariantList), parameters=QVariantList   #34 type=Signal, signature=forcePlotDisplaySignal(QVariantList), parameters=QVariantList   #35 type=Signal, signature=updateMaskedDataSignal()   #36 type=Signal, signature=documentationRegenInProgressSignal()   #37 type=Signal, signature=documentationRegeneratedSignal()   #38 type=Signal, signature=documentationUpdateLogSignal()   #39 type=Signal, signature=closeSignal() )
statusBarUpdateSignal
updateMaskedDataSignal
updateModelCategoriesSignal
updateModelFromDataOperationPanelSignal
updateModelFromPerspectiveSignal
updatePerspectiveWithDataSignal
updateTheoryFromPerspectiveSignal
class sas.qtgui.Utilities.GuiUtils.DoubleValidator

Bases: QDoubleValidator

__doc__ = None
__module__ = 'sas.qtgui.Utilities.GuiUtils'
fixup(input)

Correct (remove) potential preexisting content

staticMetaObject = PySide6.QtCore.QMetaObject("DoubleValidator" inherits "QDoubleValidator": )
validate(input, pos)

Return invalid for commas

class sas.qtgui.Utilities.GuiUtils.FormulaValidator(parent=None)

Bases: QValidator

__doc__ = None
__init__(self, parent: PySide6.QtCore.QObject | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.GuiUtils'
_setStyleSheet(value)
staticMetaObject = PySide6.QtCore.QMetaObject("FormulaValidator" inherits "QValidator": )
validate(self, arg__1: str, arg__2: int) object
class sas.qtgui.Utilities.GuiUtils.HashableStandardItem(parent=None)

Bases: QStandardItem

__doc__ = None
__hash__()

just a random hash value

__init__(self) None
__init__(self, icon: PySide6.QtGui.QIcon | PySide6.QtGui.QPixmap, text: str) None
__init__(self, other: PySide6.QtGui.QStandardItem) None
__init__(self, rows: int, columns: int = 1) None
__init__(self, text: str) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.GuiUtils'
clone()

Assure __hash__ is cloned as well

sas.qtgui.Utilities.GuiUtils.checkModel(path)

Check that the model save in file ‘path’ can run.

sas.qtgui.Utilities.GuiUtils.convertFromSVS(datasets)

Read in properties from SVS and convert into a simple dict

sas.qtgui.Utilities.GuiUtils.convertUnitToHTML(unit)

Convert ASCII unit display into HTML symbol

sas.qtgui.Utilities.GuiUtils.createModelItemWithPlot(update_data, name='')

Creates a checkboxed QStandardItem named “name” Adds ‘update_data’ to that row.

sas.qtgui.Utilities.GuiUtils.dataFromItem(item)

Retrieve Data1D/2D component from QStandardItem. The assumption - data stored in SasView standard, in child 0

sas.qtgui.Utilities.GuiUtils.deleteRedundantPlots(item, new_plots)

Checks all plots that are children of the given item; if any have an ID or name not included in new_plots, it is deleted. Useful for e.g. switching from P(Q)S(Q) to P(Q); this would remove the old S(Q) plot.

Ensure that new_plots contains ALL the relevant plots(!!!)

sas.qtgui.Utilities.GuiUtils.enum(*sequential, **named)

Create an enumeration object from a list of strings

sas.qtgui.Utilities.GuiUtils.findNextFilename(filename, directory)

Finds the next available (non-existing) name for ‘filename’ in ‘directory’. plugin.py -> plugin (n).py - for first ‘n’ for which the file doesn’t exist

sas.qtgui.Utilities.GuiUtils.formatNumber(value, high=False)

Return a float in a standardized, human-readable formatted string. This is used to output readable (e.g. x.xxxe-y) values to the panel.

sas.qtgui.Utilities.GuiUtils.formatValue(value)

Formats specific data types for the GUI.

This function accepts three types of data: numeric data castable to float, a numpy.ndarray of type castable to float, or None. Numeric data is returned in human-readable format by formatNumber(), numpy arrays are averaged over all axes, and the mean returned in human-readable format. If value=None then the string “NaN” is returned.

Parameters:

value (float, numeric type castable to float, numpy.ndarray, None) – The value to be formatted

Returns:

The formatted value

Return type:

str

sas.qtgui.Utilities.GuiUtils.getChildrenFromItem(root)

Recursively go down the model item looking for all children

sas.qtgui.Utilities.GuiUtils.getConstraints(fit_project)

Extracts constraints from fir_project dict and returns a dict where keys are the tab name and values are a list of constraints on that tab. The dict can then be passed to the updateFromConstraints method from the fitting perspective to apply the constraints with error checking mechanism

sas.qtgui.Utilities.GuiUtils.getMonospaceFont()

Convenience function; returns a monospace font to be used in any shells, code editors, etc.

sas.qtgui.Utilities.GuiUtils.get_sensible_default_open_directory()
Returns:

app_path - the path to the application directory

sas.qtgui.Utilities.GuiUtils.infoFromData(data)

Given Data1D/Data2D object, extract relevant Info elements and add them to a model item

sas.qtgui.Utilities.GuiUtils.itemFromDisplayName(name, model_item)

Returns the model item text=name in the model

sas.qtgui.Utilities.GuiUtils.onTXTSave(data, path)

Save file as formatted txt

Open a URL in an external browser. Check the URL first, though.

sas.qtgui.Utilities.GuiUtils.parseName(name, expression)

remove “_” in front of a name

sas.qtgui.Utilities.GuiUtils.plotsFromCheckedItems(model_item)

Returns the list of plots for items in the model which are checked

sas.qtgui.Utilities.GuiUtils.plotsFromDisplayName(name, model_item)

Returns the list of plots for the item with text=name in the model

sas.qtgui.Utilities.GuiUtils.plotsFromModel(model_name, model_item)

Returns the list of plots for the item with model name in the model

sas.qtgui.Utilities.GuiUtils.plotsOfType(model, datatype=<class 'sas.qtgui.Plotting.PlotterData.Data1D'>)

Returns the list of plots for the whole model of type datatype

sas.qtgui.Utilities.GuiUtils.readDataFromFile(fp)

Reads in Data1D/Data2 datasets from the file. Datasets are stored in the JSON format.

sas.qtgui.Utilities.GuiUtils.readProjectFromSVS(filepath)

Read old SVS file and convert to the project dictionary

sas.qtgui.Utilities.GuiUtils.replaceHTMLwithASCII(html)

Replace some important HTML-encoded characters with their ASCII equivalents

sas.qtgui.Utilities.GuiUtils.replaceHTMLwithUTF8(html)

Replace some important HTML-encoded characters with their UTF-8 equivalents

sas.qtgui.Utilities.GuiUtils.retrieveData1d(data)

Retrieve 1D data from file and construct its text representation

sas.qtgui.Utilities.GuiUtils.retrieveData2d(data)

Retrieve 2D data from file and construct its text representation

sas.qtgui.Utilities.GuiUtils.rstToHtml(s)
sas.qtgui.Utilities.GuiUtils.saveAnyData(data, wildcard_dict=None)

Generic file save routine called by SaveData1D and SaveData2D

Parameters:
  • data – Data 1D or Data2D object the data will be taken from

  • wildcard_dict – Dictionary in format {“Display Text”: “.ext”}

sas.qtgui.Utilities.GuiUtils.saveData(fp, data)

save content of data to fp (a .write()-supporting file-like object)

sas.qtgui.Utilities.GuiUtils.saveData1D(data)

Save 1D data points

Parameters:

data – Data1D object the data will be taken from

sas.qtgui.Utilities.GuiUtils.saveData2D(data)

Save data2d data points

Parameters:

data – Data2D object the data will be taken from

sas.qtgui.Utilities.GuiUtils.showHelp(url: Path | str | PathLike)
sas.qtgui.Utilities.GuiUtils.toDouble(value_string)

toFloat conversion which cares deeply about user’s locale

sas.qtgui.Utilities.GuiUtils.updateModelItem(item, update_data, name='')

Adds a simple named child to QStandardItem

sas.qtgui.Utilities.GuiUtils.updateModelItemStatus(model_item, filename='', name='', status=2)

Update status of checkbox related to high- and low-Q extrapolation choice in Invariant Panel

sas.qtgui.Utilities.GuiUtils.updateModelItemWithPlot(item, update_data, name='', checkbox_state=None)

Adds a checkboxed row named “name” to QStandardItem Adds ‘update_data’ to that row.

sas.qtgui.Utilities.GuiUtils.xyTransform(data, xLabel='', yLabel='')

Transforms x and y in View and set the scale

sas.qtgui.Utilities.HidableDialog module

class sas.qtgui.Utilities.HidableDialog.HidableDialog(window_title: str, message: str, parent=None, buttons=None)

Bases: QDialog

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.HidableDialog'
property show_again: bool
staticMetaObject = PySide6.QtCore.QMetaObject("HidableDialog" inherits "QDialog": )
class sas.qtgui.Utilities.HidableDialog.ShowAgainResult(result: bool, ask_again: bool)

Bases: NamedTuple

Data structure for the output of the hidable dialog

__annotations__ = {'ask_again': <class 'bool'>, 'result': <class 'bool'>}
__doc__ = ' Data structure for the output of the hidable dialog'
__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

__match_args__ = ('result', 'ask_again')
__module__ = 'sas.qtgui.Utilities.HidableDialog'
static __new__(_cls, result: bool, ask_again: bool)

Create new instance of ShowAgainResult(result, ask_again)

__orig_bases__ = (<function NamedTuple>,)
__repr__()

Return a nicely formatted representation string

__slots__ = ()
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('result', 'ask_again')
classmethod _make(iterable)

Make a new ShowAgainResult object from a sequence or iterable

_replace(**kwds)

Return a new ShowAgainResult object replacing specified fields with new values

ask_again: bool

Alias for field number 1

result: bool

Alias for field number 0

sas.qtgui.Utilities.HidableDialog.hidable_dialog(window_title: str, message: str, show: bool, parent=None, buttons=None) ShowAgainResult

A dialog with an ask again feature.

sas.qtgui.Utilities.HidableDialog.main()

sas.qtgui.Utilities.IPythonWidget module

class sas.qtgui.Utilities.IPythonWidget.IPythonWidget(**kwargs: Any)

Bases: RichJupyterWidget

__doc__ = None
__init__(parent=None, **kwargs)

Create a RichJupyterWidget.

__module__ = 'sas.qtgui.Utilities.IPythonWidget'
_all_trait_default_generators: dict[str, t.Any] = {'_display_banner': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, '_highlighter': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, '_jpg_supported': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'ansi_codes': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'banner': <traitlets.traitlets.DefaultHandler object>, 'buffer_size': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'clear_on_kernel_restart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'config': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'confirm_restart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'console_height': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'console_width': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'custom_edit': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'custom_interrupt': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'custom_restart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'editor': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'editor_line': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'enable_calltips': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'execute_on_complete_input': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'font_family': <function ConsoleWidget._font_family_default>, 'font_size': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'gui_completion': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'gui_completion_height': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'history_lock': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'in_prompt': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'include_other_output': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'input_sep': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'kernel_banner': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'kind': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'lexer': <function FrontendWidget._lexer_default>, 'lexer_class': <function FrontendWidget._lexer_class_default>, 'log': <traitlets.traitlets.DefaultHandler object>, 'other_output_prefix': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'out_prompt': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'output_sep': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'output_sep2': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'override_shortcuts': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'paging': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'parent': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'scrollbar_visibility': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'style_sheet': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'syntax_style': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>}
_descriptors = [<traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ValidateHandler object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.DottedObjectName object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>]
_instance_inits = [<bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ValidateHandler.instance_init of <traitlets.traitlets.ValidateHandler object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DottedObjectName object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>]
_static_immutable_initial_values: dict[str, t.Any] = {'_display_banner': False, '_highlighter': None, '_jpg_supported': False, 'ansi_codes': True, 'buffer_size': 500, 'clear_on_kernel_restart': True, 'confirm_restart': True, 'console_height': 25, 'console_width': 81, 'custom_edit': False, 'custom_interrupt': False, 'custom_restart': False, 'editor': 'notepad', 'editor_line': '', 'enable_calltips': True, 'execute_on_complete_input': True, 'font_size': 0, 'gui_completion_height': 0, 'history_lock': False, 'in_prompt': 'In [<span class="in-prompt-number">%i</span>]: ', 'include_other_output': False, 'input_sep': '\n', 'kernel_banner': '', 'other_output_prefix': '[remote] ', 'out_prompt': 'Out[<span class="out-prompt-number">%i</span>]: ', 'output_sep': '', 'output_sep2': '', 'override_shortcuts': False, 'parent': None, 'scrollbar_visibility': True, 'style_sheet': '', 'syntax_style': ''}
_trait_default_generators = {}
_traits: dict[str, t.Any] = {'_display_banner': <traitlets.traitlets.Bool object>, '_highlighter': <traitlets.traitlets.Instance object>, '_jpg_supported': <traitlets.traitlets.Bool object>, 'ansi_codes': <traitlets.traitlets.Bool object>, 'banner': <traitlets.traitlets.Unicode object>, 'buffer_size': <traitlets.traitlets.Int object>, 'clear_on_kernel_restart': <traitlets.traitlets.Bool object>, 'config': <traitlets.traitlets.Instance object>, 'confirm_restart': <traitlets.traitlets.Bool object>, 'console_height': <traitlets.traitlets.Int object>, 'console_width': <traitlets.traitlets.Int object>, 'custom_edit': <traitlets.traitlets.Bool object>, 'custom_interrupt': <traitlets.traitlets.Bool object>, 'custom_restart': <traitlets.traitlets.Bool object>, 'editor': <traitlets.traitlets.Unicode object>, 'editor_line': <traitlets.traitlets.Unicode object>, 'enable_calltips': <traitlets.traitlets.Bool object>, 'execute_on_complete_input': <traitlets.traitlets.Bool object>, 'font_family': <traitlets.traitlets.Unicode object>, 'font_size': <traitlets.traitlets.Int object>, 'gui_completion': <traitlets.traitlets.Enum object>, 'gui_completion_height': <traitlets.traitlets.Int object>, 'history_lock': <traitlets.traitlets.Bool object>, 'in_prompt': <traitlets.traitlets.Unicode object>, 'include_other_output': <traitlets.traitlets.Bool object>, 'input_sep': <traitlets.traitlets.Unicode object>, 'kernel_banner': <traitlets.traitlets.Unicode object>, 'kind': <traitlets.traitlets.Enum object>, 'lexer': <traitlets.traitlets.Any object>, 'lexer_class': <traitlets.traitlets.DottedObjectName object>, 'log': <traitlets.traitlets.Any object>, 'other_output_prefix': <traitlets.traitlets.Unicode object>, 'out_prompt': <traitlets.traitlets.Unicode object>, 'output_sep': <traitlets.traitlets.Unicode object>, 'output_sep2': <traitlets.traitlets.Unicode object>, 'override_shortcuts': <traitlets.traitlets.Bool object>, 'paging': <traitlets.traitlets.Enum object>, 'parent': <traitlets.traitlets.Instance object>, 'scrollbar_visibility': <traitlets.traitlets.Bool object>, 'style_sheet': <traitlets.traitlets.Unicode object>, 'syntax_style': <traitlets.traitlets.Unicode object>}
staticMetaObject = PySide6.QtCore.QMetaObject("IPythonWidget" inherits "RichJupyterWidget": )

sas.qtgui.Utilities.ImageViewer module

Image viewer widget.

class sas.qtgui.Utilities.ImageViewer.ImageViewer(parent=None)

Bases: QMainWindow, Ui_ImageViewerUI

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, flags: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.ImageViewer'
actionConvertToData()

Show the options dialog and if accepted, send data to conversion

actionCopyImage()

Copy MPL widget area to buffer

actionHowTo()

Send the image viewer help URL to the help viewer

actionLoadImage()

Image loader given files extensions

actionPrintImage()

Display printer dialog and print the MPL widget area

actionSaveImage()

Use the internal MPL method for saving to file

addPlotter()

Add a new plotter to the frame

addTriggers()

Trigger definitions for all menu/toolbar actions.

convertImage(rgb, xmin, xmax, ymin, ymax, zscale)

Convert image to data2D

disableMenus()

All menu items but “Load File” and “Help” should be disabled when no data is present

enableMenus()

Enable all menu items when data is present

rgb2gray(rgb)

RGB to Grey

showImage(filename)

Show the requested image in the main frame

staticMetaObject = PySide6.QtCore.QMetaObject("ImageViewer" inherits "QMainWindow": )
class sas.qtgui.Utilities.ImageViewer.ImageViewerOptions(parent=None)

Bases: QDialog, Ui_ImageViewerOptionsUI

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.ImageViewer'
addDefaults()

Fill out textedits with default values

addValidators()

Define simple validators on line edits

getState()

return current state of the widget

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

sas.qtgui.Utilities.ModelEditor module

class sas.qtgui.Utilities.ModelEditor.ModelEditor(parent=None, is_python=True)

Bases: QDialog, Ui_ModelEditor

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.ModelEditor'
addSignals()

Respond to signals in the widget

getModel()

Return the current model, as displayed in the window

modelModified
onEdit()

Respond to changes in the text browser.

setupWidgets()

Set up dialog widgets. Here - just the highlighter connected to the text edit.

staticMetaObject = PySide6.QtCore.QMetaObject("ModelEditor" inherits "QDialog": Methods:   #42 type=Signal, signature=modelModified() )

sas.qtgui.Utilities.ObjectLibrary module

sas.qtgui.Utilities.ObjectLibrary.addObject(obj_name, obj)
sas.qtgui.Utilities.ObjectLibrary.deleteObjectByName(obj_name)
sas.qtgui.Utilities.ObjectLibrary.deleteObjectByRef(obj)
sas.qtgui.Utilities.ObjectLibrary.getObject(obj_name)
sas.qtgui.Utilities.ObjectLibrary.listObjects()

sas.qtgui.Utilities.PlotView module

class sas.qtgui.Utilities.PlotView.EmbeddedPylab(canvas)

Bases: object

Define a ‘with’ context manager that lets you use pylab commands to plot on an embedded canvas. This is useful for wrapping existing scripts in a GUI, and benefits from being more familiar than the underlying object oriented interface.

As a convenience, the pylab module is returned on entry.

Example

The following example shows how to use the WxAgg backend in a wx panel:

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as Toolbar
from matplotlib.figure import Figure

class PlotPanel(wx.Panel):
    def __init__(self, *args, **kw):
        wx.Panel.__init__(self, *args, **kw)

        figure = Figure(figsize=(1,1), dpi=72)
        canvas = FigureCanvas(self, wx.ID_ANY, figure)
        self.pylab_interface = EmbeddedPylab(canvas)

        # Instantiate the matplotlib navigation toolbar and explicitly show it.
        mpl_toolbar = Toolbar(canvas)
        mpl_toolbar.Realize()

        # Create a vertical box sizer to manage the widgets in the main panel.
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(canvas, 1, wx.EXPAND|wx.LEFT|wx.RIGHT, border=0)
        sizer.Add(mpl_toolbar, 0, wx.EXPAND|wx.ALL, border=0)

        # Associate the sizer with its container.
        self.SetSizer(sizer)
        sizer.Fit(self)

    def plot(self, *args, **kw):
        with self.pylab_interface as pylab:
            pylab.clf()
            pylab.plot(*args, **kw)

Similar patterns should work for the other backends. Check the source code in matplotlib.backend_bases.* for examples showing how to use matplotlib with other GUI toolkits.

__dict__ = mappingproxy({'__module__': 'sas.qtgui.Utilities.PlotView', '__doc__': "\n    Define a 'with' context manager that lets you use pylab commands to\n    plot on an embedded canvas.  This is useful for wrapping existing\n    scripts in a GUI, and benefits from being more familiar than the\n    underlying object oriented interface.\n\n    As a convenience, the pylab module is returned on entry.\n\n    *Example*\n\n    The following example shows how to use the WxAgg backend in a wx panel::\n\n        from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas\n        from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as Toolbar\n        from matplotlib.figure import Figure\n\n        class PlotPanel(wx.Panel):\n            def __init__(self, *args, **kw):\n                wx.Panel.__init__(self, *args, **kw)\n\n                figure = Figure(figsize=(1,1), dpi=72)\n                canvas = FigureCanvas(self, wx.ID_ANY, figure)\n                self.pylab_interface = EmbeddedPylab(canvas)\n\n                # Instantiate the matplotlib navigation toolbar and explicitly show it.\n                mpl_toolbar = Toolbar(canvas)\n                mpl_toolbar.Realize()\n\n                # Create a vertical box sizer to manage the widgets in the main panel.\n                sizer = wx.BoxSizer(wx.VERTICAL)\n                sizer.Add(canvas, 1, wx.EXPAND|wx.LEFT|wx.RIGHT, border=0)\n                sizer.Add(mpl_toolbar, 0, wx.EXPAND|wx.ALL, border=0)\n\n                # Associate the sizer with its container.\n                self.SetSizer(sizer)\n                sizer.Fit(self)\n\n            def plot(self, *args, **kw):\n                with self.pylab_interface as pylab:\n                    pylab.clf()\n                    pylab.plot(*args, **kw)\n\n    Similar patterns should work for the other backends.  Check the source code\n    in matplotlib.backend_bases.* for examples showing how to use matplotlib\n    with other GUI toolkits.\n    ", '__init__': <function EmbeddedPylab.__init__>, '__enter__': <function EmbeddedPylab.__enter__>, '__exit__': <function EmbeddedPylab.__exit__>, '__dict__': <attribute '__dict__' of 'EmbeddedPylab' objects>, '__weakref__': <attribute '__weakref__' of 'EmbeddedPylab' objects>, '__annotations__': {}})
__doc__ = "\n    Define a 'with' context manager that lets you use pylab commands to\n    plot on an embedded canvas.  This is useful for wrapping existing\n    scripts in a GUI, and benefits from being more familiar than the\n    underlying object oriented interface.\n\n    As a convenience, the pylab module is returned on entry.\n\n    *Example*\n\n    The following example shows how to use the WxAgg backend in a wx panel::\n\n        from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas\n        from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as Toolbar\n        from matplotlib.figure import Figure\n\n        class PlotPanel(wx.Panel):\n            def __init__(self, *args, **kw):\n                wx.Panel.__init__(self, *args, **kw)\n\n                figure = Figure(figsize=(1,1), dpi=72)\n                canvas = FigureCanvas(self, wx.ID_ANY, figure)\n                self.pylab_interface = EmbeddedPylab(canvas)\n\n                # Instantiate the matplotlib navigation toolbar and explicitly show it.\n                mpl_toolbar = Toolbar(canvas)\n                mpl_toolbar.Realize()\n\n                # Create a vertical box sizer to manage the widgets in the main panel.\n                sizer = wx.BoxSizer(wx.VERTICAL)\n                sizer.Add(canvas, 1, wx.EXPAND|wx.LEFT|wx.RIGHT, border=0)\n                sizer.Add(mpl_toolbar, 0, wx.EXPAND|wx.ALL, border=0)\n\n                # Associate the sizer with its container.\n                self.SetSizer(sizer)\n                sizer.Fit(self)\n\n            def plot(self, *args, **kw):\n                with self.pylab_interface as pylab:\n                    pylab.clf()\n                    pylab.plot(*args, **kw)\n\n    Similar patterns should work for the other backends.  Check the source code\n    in matplotlib.backend_bases.* for examples showing how to use matplotlib\n    with other GUI toolkits.\n    "
__enter__()
__exit__(*args, **kw)
__init__(canvas)
__module__ = 'sas.qtgui.Utilities.PlotView'
__weakref__

list of weak references to the object

class sas.qtgui.Utilities.PlotView.PlotView(*args, **kw)

Bases: QWidget, _PlotViewShared

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.PlotView'
_is_shown()
staticMetaObject = PySide6.QtCore.QMetaObject("PlotView" inherits "QWidget": )
class sas.qtgui.Utilities.PlotView._PlotViewShared

Bases: object

__annotations__ = {}
__dict__ = mappingproxy({'__module__': 'sas.qtgui.Utilities.PlotView', 'title': 'Plot', 'default_size': (600, 400), 'pylab_interface': None, 'plot_state': None, 'model': None, '_calculating': False, '_need_plot': False, '_need_newmodel': False, 'set_model': <function _PlotViewShared.set_model>, 'update_model': <function _PlotViewShared.update_model>, 'update_parameters': <function _PlotViewShared.update_parameters>, '_show': <function _PlotViewShared._show>, '_redraw': <function _PlotViewShared._redraw>, 'get_state': <function _PlotViewShared.get_state>, 'set_state': <function _PlotViewShared.set_state>, 'menu': <function _PlotViewShared.menu>, 'newmodel': <function _PlotViewShared.newmodel>, 'plot': <function _PlotViewShared.plot>, '__dict__': <attribute '__dict__' of '_PlotViewShared' objects>, '__weakref__': <attribute '__weakref__' of '_PlotViewShared' objects>, '__doc__': None, '__annotations__': {'pylab_interface': 'EmbeddedPylab'}})
__doc__ = None
__module__ = 'sas.qtgui.Utilities.PlotView'
__weakref__

list of weak references to the object

_calculating = False
_need_newmodel = False
_need_plot = False
_redraw(newmodel=False)
_show()
default_size = (600, 400)
get_state()
menu()

Return a model specific menu

model = None
newmodel(model=None)

New or updated model structure. Do any sort or precalculation you need. plot will be called separately when you are done.

For long calculations, periodically perform wx.YieldIfNeeded() and then if self.cancel_calculation is True, return from the plot.

plot()

Plot to the current figure. If model has a plot method, just use that.

For long calculations, periodically perform wx.YieldIfNeeded() and then if self.cancel_calculation is True, return from the plot.

plot_state = None
pylab_interface: EmbeddedPylab = None
set_model(model)
set_state(state)
title = 'Plot'
update_model(model)
update_parameters(model)

sas.qtgui.Utilities.PluginDefinition module

class sas.qtgui.Utilities.PluginDefinition.PluginDefinition(parent=None)

Bases: QDialog, Ui_PluginDefinition

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.PluginDefinition'
addSignals()

Define slots for widget signals

addTooltip()

Add the default tooltip to the text field

addWidgets()

Initialize various widgets in the dialog

getModel()

Return the current plugin model

initializeModel()

Define the dictionary for internal data representation

modelModified
onDescriptionChanged()

Respond to changes in plugin description

onFunctionChanged()

Respond to changes in function body

onOverwrite()

Respond to change in file overwrite checkbox

onParamsChanged(row, column)

Respond to changes in non-polydisperse parameter table

onParamsPDChanged(row, column)

Respond to changes in non-polydisperse parameter table

onPluginNameChanged()

Respond to changes in plugin name

staticMetaObject = PySide6.QtCore.QMetaObject("PluginDefinition" inherits "QDialog": Methods:   #42 type=Signal, signature=modelModified() )

sas.qtgui.Utilities.PluginManager module

class sas.qtgui.Utilities.PluginManager.PluginManager(parent=None)

Bases: QDialog, Ui_PluginManagerUI

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.PluginManager'
addSignals()

Define slots for widget signals

onAdd()

Show the add new model dialog

onAddFile()

Open system Load FIle dialog, load a plugin and put it in the plugin directory

onDelete()

Remove the file containing the selected plugin

onDuplicate()

Creates a copy of the selected model(s)

onEdit()

Show the edit existing model dialog

onHelp()

Show the help page in the default browser

onSelectionChanged()

Respond to row selection

readModels()

Read in custom models from the default location

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

sas.qtgui.Utilities.PythonSyntax module

class sas.qtgui.Utilities.PythonSyntax.PythonHighlighter(document, is_python=True)

Bases: QSyntaxHighlighter

__doc__ = None
__init__(self, parent: PySide6.QtCore.QObject) None
__init__(self, parent: PySide6.QtGui.QTextDocument) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.PythonSyntax'
braces = ['\\{', '\\}', '\\(', '\\)', '\\[', '\\]']
c_keywords = ['auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', 'if', 'int', 'long', 'register', 'return', 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', 'typedef', 'union', 'unsigned', 'void', 'volatile', 'while']
highlightBlock(text)

Apply syntax highlighting to the given block of text.

match_multiline(text, delimiter, in_state, style)

Do highlighting of multi-line strings. delimiter should be a QRegExp for triple-single-quotes or triple-double-quotes, and in_state should be a unique integer to represent the corresponding state changes when inside those strings. Returns True if we’re still inside a multi-line string when this function is finished.

operators = ['=', '==', '!=', '<', '<=', '>', '>=', '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*', '\\+=', '-=', '\\*=', '/=', '\\%=', '\\^', '\\|', '\\&', '\\~', '>>', '<<']
python_keywords = ['and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'yield', 'None', 'True', 'False']
staticMetaObject = PySide6.QtCore.QMetaObject("PythonHighlighter" inherits "QSyntaxHighlighter": )
sas.qtgui.Utilities.PythonSyntax.format(color, style='')

Return a QTextCharFormat with the given attributes.

sas.qtgui.Utilities.ReactorCore module

This module provides support for Twisted to be driven by the Qt mainloop.

In order to use this support, simply do the following::
app = QApplication(sys.argv) # your code to init Qt
import qt5reactor
qt5reactor.install()

Then use twisted.internet APIs as usual. The other methods here are not intended to be called directly.

If you don’t instantiate a QApplication or QCoreApplication prior to installing the reactor, a QCoreApplication will be constructed by the reactor. QCoreApplication does not require a GUI so trial testing can occur normally.

Twisted can be initialized after QApplication.exec_() with a call to reactor.runReturn(). calling reactor.stop() will unhook twisted but leave your Qt application running

Qt5 Port: U{Burak Nehbit<mailto:burak@nehbit.net>}

Current maintainer: U{Christopher R. Wood<mailto:chris@leastauthority.com>}

Previous maintainer: U{Tarashish Mishra<mailto:sunu@sunu.in>} Previous maintainer: U{Glenn H Tarbox, PhD<mailto:glenn@tarbox.org>} Previous maintainer: U{Itamar Shtull-Trauring<mailto:twisted@itamarst.org>} Original port to QT4: U{Gabe Rudy<mailto:rudy@goldenhelix.com>} Subsequent port by therve

sas.qtgui.Utilities.ReactorCore.CreateEvent()
sas.qtgui.Utilities.ReactorCore.MsgWaitForMultipleObjects()
class sas.qtgui.Utilities.ReactorCore.QCoreApplication(self)
class sas.qtgui.Utilities.ReactorCore.QCoreApplication(self, arg__1: Sequence[str])

Bases: QObject

ApplicationFlags = 394243
__delattr__(name, /)

Implement delattr(self, name).

__doc__ = 'QCoreApplication(self) -> None\nQCoreApplication(self, arg__1: Sequence[str]) -> None'
__init__(self) None
__init__(self, arg__1: Sequence[str]) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'PySide6.QtCore'
__new__(**kwargs)
__setattr__(name, value, /)

Implement setattr(self, name, value).

aboutToQuit
static addLibraryPath(arg__1: str) None
static applicationDirPath() str
static applicationFilePath() str
static applicationName() str
applicationNameChanged
static applicationPid() int
static applicationVersion() str
applicationVersionChanged
static arguments() List[str]
static closingDown() bool
event(self, arg__1: PySide6.QtCore.QEvent) bool
static eventDispatcher() PySide6.QtCore.QAbstractEventDispatcher
static exec() int
exec_(**kwargs)
static exit(retcode: int = 0) None
installNativeEventFilter(self, filterObj: PySide6.QtCore.QAbstractNativeEventFilter) None
static installTranslator(messageFile: PySide6.QtCore.QTranslator) bool
static instance() PySide6.QtCore.QCoreApplication | None
static isQuitLockEnabled() bool
static isSetuidAllowed() bool
static libraryPaths() List[str]
notify(self, arg__1: PySide6.QtCore.QObject, arg__2: PySide6.QtCore.QEvent) bool
static organizationDomain() str
organizationDomainChanged
static organizationName() str
organizationNameChanged
static postEvent(receiver: PySide6.QtCore.QObject, event: PySide6.QtCore.QEvent, priority: int = Instance(Qt.NormalEventPriority)) None
static processEvents(flags: PySide6.QtCore.QEventLoop.ProcessEventsFlag, maxtime: int) None
static processEvents(flags: PySide6.QtCore.QEventLoop.ProcessEventsFlag = Instance(PySide6.QtCore.QEventLoop.AllEvents)) None
static quit() None
static removeLibraryPath(arg__1: str) None
removeNativeEventFilter(self, filterObj: PySide6.QtCore.QAbstractNativeEventFilter) None
static removePostedEvents(receiver: PySide6.QtCore.QObject, eventType: int = 0) None
static removeTranslator(messageFile: PySide6.QtCore.QTranslator) bool
resolveInterface(self, name: bytes, revision: int) int
static sendEvent(receiver: PySide6.QtCore.QObject, event: PySide6.QtCore.QEvent) bool
static sendPostedEvents(receiver: PySide6.QtCore.QObject | None = None, event_type: int = 0) None
static setApplicationName(application: str) None
static setApplicationVersion(version: str) None
static setAttribute(attribute: PySide6.QtCore.Qt.ApplicationAttribute, on: bool = True) None
static setEventDispatcher(eventDispatcher: PySide6.QtCore.QAbstractEventDispatcher) None
static setLibraryPaths(arg__1: Sequence[str]) None
static setOrganizationDomain(orgDomain: str) None
static setOrganizationName(orgName: str) None
static setQuitLockEnabled(enabled: bool) None
static setSetuidAllowed(allow: bool) None
shutdown(self) None
static startingUp() bool
staticMetaObject = PySide6.QtCore.QMetaObject("QCoreApplication" inherits "QObject": Properties:   #1 "applicationName", QString [writeable] [designable], notify=applicationNameChanged   #2 "applicationVersion", QString [writeable] [designable], notify=applicationVersionChanged   #3 "organizationName", QString [writeable] [designable], notify=organizationNameChanged   #4 "organizationDomain", QString [writeable] [designable], notify=organizationDomainChanged   #5 "quitLockEnabled", bool [writeable] [designable] Methods:   #5 type=Signal, signature=aboutToQuit()   #6 type=Signal, signature=organizationNameChanged()   #7 type=Signal, signature=organizationDomainChanged()   #8 type=Signal, signature=applicationNameChanged()   #9 type=Signal, signature=applicationVersionChanged()   #10 type=Slot, signature=quit()   #11 type=Slot, signature=exit(int), parameters=int   #12 type=Slot, signature=exit() )
static testAttribute(attribute: PySide6.QtCore.Qt.ApplicationAttribute) bool
static translate(context: bytes, key: bytes, disambiguation: bytes | None = None, n: int = -1) str
class sas.qtgui.Utilities.ReactorCore.QEventLoop(self, parent: PySide6.QtCore.QObject | None = None)

Bases: QObject

class ProcessEventsFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Flag

AllEvents = 0
ApplicationExec = 128
DialogExec = 64
EventLoopExec = 32
ExcludeSocketNotifiers = 2
ExcludeUserInputEvents = 1
WaitForMoreEvents = 4
X11ExcludeTimers = 8
__and__(other)
__doc__ = None
__invert__()
__module__ = 'PySide6.QtCore'
__new__(value)
__or__(other)

Return self|value.

__rand__(other)
__ror__(other)

Return value|self.

__rxor__(other)
__xor__(other)
_all_bits_ = 255
_boundary_ = 'keep'
_flag_mask_ = 239
_generate_next_value_(start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_values: the last value assigned or None

_inverted_ = None
_singles_mask_ = 239
__delattr__(name, /)

Implement delattr(self, name).

__doc__ = 'QEventLoop(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None'
__init__(self, parent: PySide6.QtCore.QObject | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'PySide6.QtCore'
__new__(**kwargs)
__setattr__(name, value, /)

Implement setattr(self, name, value).

event(self, event: PySide6.QtCore.QEvent) bool
exec(self, flags: PySide6.QtCore.QEventLoop.ProcessEventsFlag = Instance(PySide6.QtCore.QEventLoop.ProcessEventsFlag.AllEvents)) int
exec_(*args, **kwargs)
exit(self, returnCode: int = 0) None
isRunning(self) bool
processEvents(self, flags: PySide6.QtCore.QEventLoop.ProcessEventsFlag, maximumTime: int) None
processEvents(self, flags: PySide6.QtCore.QEventLoop.ProcessEventsFlag = Instance(PySide6.QtCore.QEventLoop.ProcessEventsFlag.AllEvents)) bool
quit(self) None
staticMetaObject = PySide6.QtCore.QMetaObject("QEventLoop" inherits "QObject": Enumerators:   #0 "ProcessEventsFlags" {AllEvents, ExcludeUserInputEvents, ExcludeSocketNotifiers, WaitForMoreEvents, X11ExcludeTimers, EventLoopExec, DialogExec, ApplicationExec} Methods:   #5 type=Slot, signature=exit(int), parameters=int   #6 type=Slot, signature=exit()   #7 type=Slot, signature=quit() )
wakeUp(self) None
class sas.qtgui.Utilities.ReactorCore.QObject(self, parent: PySide6.QtCore.QObject | None = None)

Bases: Object

__annotations__ = {}
__delattr__(name, /)

Implement delattr(self, name).

__doc__ = 'QObject(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None'
__getattribute__(name, /)

Return getattr(self, name).

__init__(self, parent: PySide6.QtCore.QObject | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'PySide6.QtCore'
__new__(**kwargs)
__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

blockSignals(self, b: bool) bool
childEvent(self, event: PySide6.QtCore.QChildEvent) None
children(self) List[PySide6.QtCore.QObject]
static connect(arg__1: PySide6.QtCore.QObject, arg__2: bytes, arg__3: Callable, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QMetaObject.Connection
static connect(self, arg__1: bytes, arg__2: Callable, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QMetaObject.Connection
static connect(self, arg__1: bytes, arg__2: PySide6.QtCore.QObject, arg__3: bytes, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QMetaObject.Connection
static connect(self, sender: PySide6.QtCore.QObject, signal: bytes, member: bytes, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QMetaObject.Connection
static connect(sender: PySide6.QtCore.QObject, signal: PySide6.QtCore.QMetaMethod, receiver: PySide6.QtCore.QObject, method: PySide6.QtCore.QMetaMethod, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QMetaObject.Connection
static connect(sender: PySide6.QtCore.QObject, signal: bytes, receiver: PySide6.QtCore.QObject, member: bytes, type: PySide6.QtCore.Qt.ConnectionType = Instance(Qt.AutoConnection)) PySide6.QtCore.QMetaObject.Connection
connectNotify(self, signal: PySide6.QtCore.QMetaMethod) None
customEvent(self, event: PySide6.QtCore.QEvent) None
deleteLater(self) None
destroyed
static disconnect(arg__1: PySide6.QtCore.QMetaObject.Connection) bool
static disconnect(arg__1: PySide6.QtCore.QObject, arg__2: bytes, arg__3: Callable) bool
static disconnect(self, arg__1: bytes, arg__2: Callable) bool
static disconnect(self, receiver: PySide6.QtCore.QObject, member: bytes | None = None) bool
static disconnect(self, signal: bytes, receiver: PySide6.QtCore.QObject, member: bytes) bool
static disconnect(sender: PySide6.QtCore.QObject, signal: PySide6.QtCore.QMetaMethod, receiver: PySide6.QtCore.QObject, member: PySide6.QtCore.QMetaMethod) bool
static disconnect(sender: PySide6.QtCore.QObject, signal: bytes, receiver: PySide6.QtCore.QObject, member: bytes) bool
disconnectNotify(self, signal: PySide6.QtCore.QMetaMethod) None
dumpObjectInfo(self) None
dumpObjectTree(self) None
dynamicPropertyNames(self) List[PySide6.QtCore.QByteArray]
emit(self, arg__1: bytes, *args: None) bool
event(self, event: PySide6.QtCore.QEvent) bool
eventFilter(self, watched: PySide6.QtCore.QObject, event: PySide6.QtCore.QEvent) bool
findChild(self, type: type, name: str = {}, options: PySide6.QtCore.Qt.FindChildOption = Instance(Qt.FindChildrenRecursively)) object
findChildren(self, type: type, name: str = {}, options: PySide6.QtCore.Qt.FindChildOption = Instance(Qt.FindChildrenRecursively)) Iterable
findChildren(self, type: type, pattern: PySide6.QtCore.QRegularExpression | str, options: PySide6.QtCore.Qt.FindChildOption = Instance(Qt.FindChildrenRecursively)) Iterable
inherits(self, classname: bytes) bool
installEventFilter(self, filterObj: PySide6.QtCore.QObject) None
isQuickItemType(self) bool
isSignalConnected(self, signal: PySide6.QtCore.QMetaMethod) bool
isWidgetType(self) bool
isWindowType(self) bool
killTimer(self, id: int) None
metaObject(self) PySide6.QtCore.QMetaObject
moveToThread(self, thread: PySide6.QtCore.QThread) None
objectName(self) str
objectNameChanged
parent(self) PySide6.QtCore.QObject
property(self, name: str) Any
receivers(self, signal: bytes) int
removeEventFilter(self, obj: PySide6.QtCore.QObject) None
sender(self) PySide6.QtCore.QObject
senderSignalIndex(self) int
setObjectName(self, name: str) None
setParent(self, parent: PySide6.QtCore.QObject) None
setProperty(self, name: str, value: Any) bool
signalsBlocked(self) bool
startTimer(self, interval: int, timerType: PySide6.QtCore.Qt.TimerType = Instance(Qt.CoarseTimer)) int
staticMetaObject = PySide6.QtCore.QMetaObject("QObject": Properties:   #0 "objectName", QString [writeable] [designable], notify=objectNameChanged Methods:   #0 type=Signal, signature=destroyed(QObject*), parameters=QObject*   #1 type=Signal, signature=destroyed()   #2 type=Signal, signature=objectNameChanged(QString), parameters=QString   #3 type=Slot, signature=deleteLater()   #4 type=Slot, signature=_q_reregisterTimers(void*), parameters=void* )
thread(self) PySide6.QtCore.QThread
timerEvent(self, event: PySide6.QtCore.QTimerEvent) None
tr(self, sourceText: str, disambiguation: str | None, n: int = -1) str
class sas.qtgui.Utilities.ReactorCore.QSocketNotifier(self, arg__1: object, arg__2: PySide6.QtCore.QSocketNotifier.Type, parent: PySide6.QtCore.QObject | None = None)
class sas.qtgui.Utilities.ReactorCore.QSocketNotifier(self, arg__1: PySide6.QtCore.QSocketNotifier.Type, parent: PySide6.QtCore.QObject | None = None)
class sas.qtgui.Utilities.ReactorCore.QSocketNotifier(self, socket: int, arg__2: PySide6.QtCore.QSocketNotifier.Type, parent: PySide6.QtCore.QObject | None = None)

Bases: QObject

class Type(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Exception = 2
Read = 0
Write = 1
__doc__ = None
__module__ = 'PySide6.QtCore'
_missing_()
__delattr__(name, /)

Implement delattr(self, name).

__doc__ = 'QSocketNotifier(self, arg__1: object, arg__2: PySide6.QtCore.QSocketNotifier.Type, parent: Optional[PySide6.QtCore.QObject] = None) -> None\nQSocketNotifier(self, arg__1: PySide6.QtCore.QSocketNotifier.Type, parent: Optional[PySide6.QtCore.QObject] = None) -> None\nQSocketNotifier(self, socket: int, arg__2: PySide6.QtCore.QSocketNotifier.Type, parent: Optional[PySide6.QtCore.QObject] = None) -> None'
__init__(self, arg__1: object, arg__2: PySide6.QtCore.QSocketNotifier.Type, parent: PySide6.QtCore.QObject | None = None) None
__init__(self, arg__1: PySide6.QtCore.QSocketNotifier.Type, parent: PySide6.QtCore.QObject | None = None) None
__init__(self, socket: int, arg__2: PySide6.QtCore.QSocketNotifier.Type, parent: PySide6.QtCore.QObject | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'PySide6.QtCore'
__new__(**kwargs)
__setattr__(name, value, /)

Implement setattr(self, name, value).

activated
event(self, arg__1: PySide6.QtCore.QEvent) bool
isEnabled(self) bool
isValid(self) bool
setEnabled(self, arg__1: bool) None
setSocket(self, socket: int) None
socket(self) int
staticMetaObject = PySide6.QtCore.QMetaObject("QSocketNotifier" inherits "QObject": Methods:   #5 type=Signal, signature=activated(QSocketDescriptor,QSocketNotifier::Type), parameters=QSocketDescriptor, QSocketNotifier::Type   #6 type=Signal, signature=activated(QSocketDescriptor), parameters=QSocketDescriptor   #7 type=Signal, signature=activated(int), parameters=int   #8 type=Slot, signature=setEnabled(bool), parameters=bool )
type(self) PySide6.QtCore.QSocketNotifier.Type
class sas.qtgui.Utilities.ReactorCore.QTimer(self, parent: PySide6.QtCore.QObject | None = None)

Bases: QObject

__delattr__(name, /)

Implement delattr(self, name).

__doc__ = 'QTimer(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None'
__init__(self, parent: PySide6.QtCore.QObject | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'PySide6.QtCore'
__new__(**kwargs)
__setattr__(name, value, /)

Implement setattr(self, name, value).

interval(self) int
isActive(self) bool
isSingleShot(self) bool
killTimer(self, arg__1: int) None
remainingTime(self) int
setInterval(self, msec: int) None
setSingleShot(self, singleShot: bool) None
setTimerType(self, atype: PySide6.QtCore.Qt.TimerType) None
static singleShot(arg__1: int, arg__2: Callable) None
static singleShot(msec: int, receiver: PySide6.QtCore.QObject, member: bytes) None
static singleShot(msec: int, timerType: PySide6.QtCore.Qt.TimerType, receiver: PySide6.QtCore.QObject, member: bytes) None
start(self) None
start(self, msec: int) None
staticMetaObject = PySide6.QtCore.QMetaObject("QTimer" inherits "QObject": Properties:   #1 "singleShot", bool [writeable] [designable]   #2 "interval", int [writeable] [designable]   #3 "remainingTime", int [designable]   #4 "timerType", Qt::TimerType [writeable] [designable]   #5 "active", bool [designable] Methods:   #5 type=Signal, signature=timeout()   #6 type=Slot, signature=start(int), parameters=int   #7 type=Slot, signature=start()   #8 type=Slot, signature=stop() )
stop(self) None
timeout
timerEvent(self, arg__1: PySide6.QtCore.QTimerEvent) None
timerId(self) int
timerType(self) PySide6.QtCore.Qt.TimerType
exception sas.qtgui.Utilities.ReactorCore.Qt5ReactorError

Bases: Exception

__doc__ = None
__module__ = 'sas.qtgui.Utilities.ReactorCore'
__weakref__

list of weak references to the object

class sas.qtgui.Utilities.ReactorCore.QtEventReactor(*args, **kwargs)

Bases: QtReactor

__annotations__ = {}
__doc__ = None
__init__(*args, **kwargs)
__module__ = 'sas.qtgui.Utilities.ReactorCore'
_runAction(action, fd)
addEvent(event, fd, action)

Add a new win32 event to the event loop.

doEvents()
iterate(delay=None, fromqt=False)

See twisted.internet.interfaces.IReactorCore.iterate.

removeEvent(event)

Remove an event.

class sas.qtgui.Utilities.ReactorCore.QtReactor

Bases: PosixReactorBase

__annotations__ = {}
__doc__ = None
__implemented__ = classImplements(QtReactor, IReactorFDSet)
__init__()
__module__ = 'sas.qtgui.Utilities.ReactorCore'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

_add(xer, primary, type)

Private method for adding a descriptor from the event loop.

It takes care of adding it if new or modifying it if already added for another state (read -> read/write for example).

_iterate(delay=None, fromqt=False)

See twisted.internet.interfaces.IReactorCore.iterate.

_remove(xer, primary)

Private method for removing a descriptor from the event loop.

It does the inverse job of _add, and also add a check in case of the fd has gone away.

addReader(reader)

Add a FileDescriptor for notification of data available to read.

addWriter(writer)

Add a FileDescriptor for notification of data available to write.

callLater(howlong, *args, **kargs)

See twisted.internet.interfaces.IReactorTime.callLater.

doIteration(delay=None, fromqt=False)

This method is called by a Qt timer or by network activity on a file descriptor

getReaders()
getWriters()
iterate(delay=None, fromqt=False)

See twisted.internet.interfaces.IReactorCore.iterate.

iterate_qt(delay=None)
reactorInvocation()
removeAll()

Remove all selectables, and return a list of them.

removeReader(reader)

Remove a Selectable for notification of data available to read.

removeWriter(writer)

Remove a Selectable for notification of data available to write.

run(installSignalHandlers=True)
runReturn(installSignalHandlers=True)
exception sas.qtgui.Utilities.ReactorCore.ReactorAlreadyInstalledError

Bases: AssertionError

Could not install reactor because one is already installed.

__doc__ = '\n    Could not install reactor because one is already installed.\n    '
__module__ = 'twisted.internet.error'
__weakref__

list of weak references to the object

class sas.qtgui.Utilities.ReactorCore.TwistedSocketNotifier(parent, reactor, watcher, socketType)

Bases: QObject

__doc__ = None
__init__(self, parent: PySide6.QtCore.QObject | None = None) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.ReactorCore'
read(fd)
shutdown()
staticMetaObject = PySide6.QtCore.QMetaObject("TwistedSocketNotifier" inherits "QObject": )
write(sock)
class sas.qtgui.Utilities.ReactorCore.implementer(*interfaces)

Bases: object

Declare the interfaces implemented by instances of a class.

This function is called as a class decorator.

The arguments are one or more interfaces or interface specifications (~zope.interface.interfaces.IDeclaration objects).

The interfaces given (including the interfaces in the specifications) are added to any interfaces previously declared, unless the interface is already implemented.

Previous declarations include declarations for base classes unless implementsOnly was used.

This function is provided for convenience. It provides a more convenient way to call classImplements. For example:

@implementer(I1)
class C(object):
    pass

is equivalent to calling:

classImplements(C, I1)

after the class has been created.

See also

classImplements The change history provided there applies to this function too.

__call__(ob)

Call self as a function.

__doc__ = '\n    Declare the interfaces implemented by instances of a class.\n\n    This function is called as a class decorator.\n\n    The arguments are one or more interfaces or interface specifications\n    (`~zope.interface.interfaces.IDeclaration` objects).\n\n    The interfaces given (including the interfaces in the specifications) are\n    added to any interfaces previously declared, unless the interface is\n    already implemented.\n\n    Previous declarations include declarations for base classes unless\n    implementsOnly was used.\n\n    This function is provided for convenience. It provides a more convenient\n    way to call `classImplements`. For example::\n\n        @implementer(I1)\n        class C(object):\n            pass\n\n    is equivalent to calling::\n\n        classImplements(C, I1)\n\n    after the class has been created.\n\n    .. seealso:: `classImplements`\n       The change history provided there applies to this function too.\n    '
__init__(*interfaces)
__module__ = 'zope.interface.declarations'
__slots__ = ('interfaces',)
interfaces
sas.qtgui.Utilities.ReactorCore.install()

Install the Qt reactor.

sas.qtgui.Utilities.ReactorCore.posixinstall()

Install the Qt reactor.

sas.qtgui.Utilities.ReactorCore.win32install()

Install the Qt reactor.

sas.qtgui.Utilities.ResultPanel module

FitPanel class contains fields allowing to fit models and data

class sas.qtgui.Utilities.ResultPanel.ResultPanel(parent, manager=None, *args, **kwargs)

Bases: QTabWidget

__doc__ = None
__init__(parent, manager=None, *args, **kwargs)
__module__ = 'sas.qtgui.Utilities.ResultPanel'
clearAnyData()

Clear any previous results and reset window to its base state.

closeEvent(event)

Overwrite QDialog close method to allow for custom widget close

onDataDeleted(data)

Check if the data set is shown in the window and close tabs as needed.

onPlotResults(results, optimizer='Unknown')
staticMetaObject = PySide6.QtCore.QMetaObject("ResultPanel" inherits "QTabWidget": Methods:   #43 type=Signal, signature=windowClosedSignal() )
updateBumps()

Monkeypatching bumps plot viewer to allow Qt

windowClosedSignal
window_name = 'Result panel'

sas.qtgui.Utilities.SasviewLogger module

class sas.qtgui.Utilities.SasviewLogger.QtHandler

Bases: Handler

Emit python log messages through a Qt signal. Receivers can connect to handler.postman.messageWritten with a method accepting the formatted log entry produced by the logger.

__doc__ = '\n    Emit python log messages through a Qt signal. Receivers can connect\n    to *handler.postman.messageWritten* with a method accepting the\n    formatted log entry produced by the logger.\n    '
__init__()

Initializes the instance - basically setting the formatter to None and the filter list to empty.

__module__ = 'sas.qtgui.Utilities.SasviewLogger'
emit(record)

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

class sas.qtgui.Utilities.SasviewLogger.QtPostman

Bases: QObject

__doc__ = None
__module__ = 'sas.qtgui.Utilities.SasviewLogger'
messageWritten
staticMetaObject = PySide6.QtCore.QMetaObject("QtPostman" inherits "QObject": Methods:   #5 type=Signal, signature=messageWritten(PyObject), parameters=PyObject )
class sas.qtgui.Utilities.SasviewLogger.SasViewLogFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)

Bases: Formatter

DATE_FORMAT = '%H:%M:%S'
LOG_COLORS = {'CRITICAL': 'red', 'ERROR': 'red', 'WARNING': 'orange'}
LOG_FORMAT = '%(asctime)s - <b{}>%(levelname)s</b>: %(message)s'
__doc__ = None
__module__ = 'sas.qtgui.Utilities.SasviewLogger'
format(record)

Give extra formatting on error messages

sas.qtgui.Utilities.SasviewLogger.setup_qt_logging()

sas.qtgui.Utilities.TabbedModelEditor module

class sas.qtgui.Utilities.TabbedModelEditor.TabbedModelEditor(parent=None, edit_only=False, model=False, load_file=None)

Bases: QDialog, Ui_TabbedModelEditor

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Utilities.TabbedModelEditor'
addSignals()

Define slots for common widget signals

addWidgets()

Populate tabs with widgets

canWriteModel(model=None, full_path='')

Determine if the current plugin can be written to file

checkModel(model_str)

Run the ast check and return True if the model is good. False otherwise.

closeEvent(event)

Overwrite the close even to assure intent

editorModelModified()

User modified the model in the Model Editor. Disable the plugin editor and show that the model is changed.

generateModel(model, fname)

generate model from the current plugin state

getModel()

Retrieves plugin model from the currently open tab

classmethod getParamHelper(param_str)

yield a sequence of name, value pairs for the parameters in param_str

Parameters can be defined by one per line by name=value, or multiple on the same line by separating the pairs by semicolon or comma. The value is optional and defaults to “1.0”.

isModelCorrect(full_path)

Run the sasmodels method for model check and return True if the model is good. False otherwise.

loadFile(filename)

Performs the load operation and updates the view

onApply()

Write the plugin and update the model editor if plugin editor open Write/overwrite the plugin if model editor open

onCancel()

Accept if document not modified, confirm intent otherwise.

onHelp()

Bring up the Model Editor Documentation whenever the HELP button is clicked. Calls Documentation Window with the path of the location within the documentation tree (after /doc/ ….”.

onLoad(at_launch=False)

Loads a model plugin file. at_launch is value of whether to attempt a load of a file from launch of the widget or not

onModifiedExit()
pluginTitleSet()

User modified the model name. Display the model name in the window title and allow for model save.

regenerateDocumentation()

Defer to subprocess the documentation regeneration process

saveClose()

Check if file needs saving before closing or model reloading

setPluginActive(is_active=True)

Enablement control for all the controls on the simple plugin editor

setTabEdited(is_edited)

Change the widget name to indicate unsaved state Unsaved state: add “*” to filename display saved state: remove “*” from filename display

staticMetaObject = PySide6.QtCore.QMetaObject("TabbedModelEditor" inherits "QDialog": )
classmethod strFromParamDict(param_dict)

Creates string from parameter dictionary

Example:

{
    0: ('variable','value'),
    1: ('variable','value'),
    ...
}
updateFromEditor()

Save the current state of the Model Editor

updateFromPlugin()

Write the plugin and update the model editor

classmethod writeFile(fname, model_str='')

Write model content to file “fname”

Module contents