sas.qtgui.Utilities package

Submodules

sas.qtgui.Utilities.AddMultEditor module

Widget for simple add / multiply editor.

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[source]

Bases: object

Class for making sure all category stuff is installed

Note - class is entirely static!

static check_install(homedir=None, model_list=None)[source]

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()[source]
static get_user_file()[source]

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

sas.qtgui.Utilities.ConnectionProxy module

class sas.qtgui.Utilities.ConnectionProxy.ConnectionProxy(url, timeout)[source]

Bases: object

connect()[source]

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

sas.qtgui.Utilities.CustomDir module

sas.qtgui.Utilities.CustomDir.setup_conf_dir(path)[source]

Setup the custom config dir and cat file

sas.qtgui.Utilities.FileConverter module

File Converter Widget

sas.qtgui.Utilities.FrameSelect module

FrameSelect class describes behaviour of the FrameSelect dialog

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)[source]

Bases: sas.sascalc.data_util.calcthread.CalcThread

Load a sld data given a filename

compute()[source]

Read some data

isquit()[source]

@raise KeyboardInterrupt: when the thread is interrupted

sas.qtgui.Utilities.GridPanel module

sas.qtgui.Utilities.GuiUtils module

Global defaults and various utility functions usable by the general GUI

sas.qtgui.Utilities.GuiUtils.checkModel(path)[source]

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

sas.qtgui.Utilities.GuiUtils.convertFromSVS(datasets)[source]

Read in properties from SVS and convert into a simple dict

sas.qtgui.Utilities.GuiUtils.convertUnitToHTML(unit)[source]

Convert ASCII unit display into well rendering HTML

sas.qtgui.Utilities.GuiUtils.convertUnitToUTF8(unit)[source]

Convert ASCII unit display into UTF-8 symbol

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

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

sas.qtgui.Utilities.GuiUtils.dataFromItem(item)[source]

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

sas.qtgui.Utilities.GuiUtils.deleteRedundantPlots(item, new_plots)[source]

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)[source]

Create an enumeration object from a list of strings

sas.qtgui.Utilities.GuiUtils.findNextFilename(filename, directory)[source]

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)[source]

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.getChildrenFromItem(root)[source]

Recursively go down the model item looking for all children

sas.qtgui.Utilities.GuiUtils.getMonospaceFont()[source]

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

sas.qtgui.Utilities.GuiUtils.get_app_dir()[source]

The application directory is the one where the default custom_config.py file resides.

Returns

app_path - the path to the applicatin directory

sas.qtgui.Utilities.GuiUtils.get_user_directory()[source]

Returns the user’s home directory

sas.qtgui.Utilities.GuiUtils.infoFromData(data)[source]

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

sas.qtgui.Utilities.GuiUtils.itemFromFilename(filename, model_item)[source]

Returns the model item text=filename in the model

sas.qtgui.Utilities.GuiUtils.onTXTSave(data, path)[source]

Save file as formatted txt

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

sas.qtgui.Utilities.GuiUtils.parseName(name, expression)[source]

remove “_” in front of a name

sas.qtgui.Utilities.GuiUtils.plotsFromCheckedItems(model_item)[source]

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

sas.qtgui.Utilities.GuiUtils.plotsFromFilename(filename, model_item)[source]

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

sas.qtgui.Utilities.GuiUtils.plotsFromModel(model_name, model_item)[source]

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

sas.qtgui.Utilities.GuiUtils.readDataFromFile(fp)[source]

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

sas.qtgui.Utilities.GuiUtils.readProjectFromSVS(filepath)[source]

Read old SVS file and convert to the project dictionary

sas.qtgui.Utilities.GuiUtils.replaceHTMLwithASCII(html)[source]

Replace some important HTML-encoded characters with their ASCII equivalents

sas.qtgui.Utilities.GuiUtils.replaceHTMLwithUTF8(html)[source]

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

sas.qtgui.Utilities.GuiUtils.retrieveData1d(data)[source]

Retrieve 1D data from file and construct its text representation

sas.qtgui.Utilities.GuiUtils.retrieveData2d(data)[source]

Retrieve 2D data from file and construct its text representation

sas.qtgui.Utilities.GuiUtils.saveData(fp, data)[source]

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

sas.qtgui.Utilities.GuiUtils.saveData1D(data)[source]

Save 1D data points

sas.qtgui.Utilities.GuiUtils.saveData2D(data)[source]

Save data2d dialog

sas.qtgui.Utilities.GuiUtils.showHelp(url)[source]

Open a local url in the default browser

sas.qtgui.Utilities.GuiUtils.toDouble(value_string)[source]

toFloat conversion which cares deeply about user’s locale

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

Adds a simple named child to QStandardItem

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

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)[source]

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

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

Transforms x and y in View and set the scale

sas.qtgui.Utilities.IPythonWidget module

sas.qtgui.Utilities.ImageViewer module

sas.qtgui.Utilities.LocalConfig module

Application settings

sas.qtgui.Utilities.LocalConfig.printEVT(message)[source]

Post a debug message to console/file

sas.qtgui.Utilities.ModelEditor module

sas.qtgui.Utilities.ObjectLibrary module

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

sas.qtgui.Utilities.PlotView module

sas.qtgui.Utilities.PluginDefinition module

sas.qtgui.Utilities.PluginManager module

sas.qtgui.Utilities.PythonSyntax module

sas.qtgui.Utilities.PythonSyntax.format(color, style='')[source]

Return a QTextCharFormat with the given attributes.

sas.qtgui.Utilities.ReportDialog module

sas.qtgui.Utilities.ResultPanel module

FitPanel class contains fields allowing to fit models and data

sas.qtgui.Utilities.SasviewLogger module

sas.qtgui.Utilities.TabbedModelEditor module

Module contents