sas.qtgui.MainWindow package

Submodules

sas.qtgui.MainWindow.AboutBox module

class sas.qtgui.MainWindow.AboutBox.AboutBox(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.MainWindow.UI.AboutUI.Ui_AboutUI

addActions()[source]

Add actions to the logo push buttons

addText()[source]

Modify the labels so the text corresponds to the current version

sas.qtgui.MainWindow.CategoryManager module

class sas.qtgui.MainWindow.CategoryManager.Categories[source]

Bases: object

Container class for accessing model categories

categoryDict()[source]

Getter for the category dict

categoryList()[source]

Getter for the category list

modelDict()[source]

Getter for the model list

modelToCategory()[source]

Getter for the model->category dict

readCategoryInfo()[source]

Reads the categories in from file

regenerateMasterDict()[source]

regenerates self.master_category_dict from self.by_model_dict and self.model_enabled_dict

regenerateModelDict()[source]

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

saveCategories()[source]

Serializes categorization info to file

setupModelDict()[source]

create a dictionary for model->category mapping

class sas.qtgui.MainWindow.CategoryManager.CategoryManager(parent=None, manager=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.MainWindow.UI.CategoryManagerUI.Ui_CategoryManagerUI

initializeGlobals()[source]

Initialize global variables used in this class

initializeModelList()[source]

Model category combo setup

initializeModels()[source]

Set up models and views

initializeSignals()[source]
Returns

onClose()[source]

Save the category file before exiting

onEnableAll(isChecked)[source]

Respond to the Enable/Disable All checkbox

onListSelection()[source]

Respond to row selection and update GUI

onModify()[source]

Show the Change Category dialog - modal

onReset()[source]

Reload the saved categories

onSearch()[source]

Respond to text entered in search field

selectedModels()[source]

Returns a list of selected models

setTableProperties(table)[source]

Setting table properties

class sas.qtgui.MainWindow.CategoryManager.ChangeCategory(parent=None, categories=None, model=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.MainWindow.UI.ChangeCategoryUI.Ui_ChangeCategoryUI

Dialog for adding/removing categories for a single model

initializeElements()[source]

Initialize local GUI elements with information from the Categories object

initializeList()[source]

Initialize the category list for the given model

initializeSignals()[source]

Initialize signals for UI elements

listCategories()[source]

Returns the list of categories from the QListWidget

onAdd()[source]

Add the chosen category to the list

onAddChoice()[source]

Respond to the type selection for new category

onListSelection()[source]

Respond to selection in the category list view

onOK()[source]

Accept the new categories for the model

onRemove()[source]

Remove selected categories in the list

selectedModels()[source]

Returns a list of selected models

class sas.qtgui.MainWindow.CategoryManager.ToolTippedItemModel(parent=None)[source]

Bases: PyQt5.QtGui.QStandardItemModel

Subclass from QStandardItemModel to allow displaying tooltips in QTableView model.

headerData(section, orientation, role=0)[source]

Displays tooltip for each column’s header :param section: :param orientation: :param role: :return:

sas.qtgui.MainWindow.DataExplorer module

class sas.qtgui.MainWindow.DataExplorer.DataExplorerWindow(parent=None, guimanager=None, manager=None)[source]

Bases: sas.qtgui.MainWindow.DroppableDataLoadWidget.DroppableDataLoadWidget

addDataPlot2D(plot_set, item)[source]

Create a new 2D plot and add it to the workspace

addPlot(new_plot)[source]

Helper method for plot bookkeeping

add_data(data_list)[source]

Update the data manager with new items

allDataForModel(model)[source]
appendPlot()[source]

Add data set(s) to the existing matplotlib chart

changeTabs(tab=0)[source]

Switch tabs of the data explorer 0: data tab 1: theory tab

chooseFiles()[source]

Shows the Open file dialog and returns the chosen path(s)

cloneTheory(item_from)[source]

Manually clone theory items into a new HashableItem

closeAllPlots()[source]

Close all currently displayed plots

closeEvent(event)[source]

Overwrite the close event - no close!

closePlotsForItem(item)[source]

Given standard item, close all its currently displayed plots

contextMenu()[source]

Define actions and layout of the right click context menu

deleteAllItems()[source]

Deletes all datasets from both model and theory_model

deleteFile(event)[source]

Delete selected rows from the model

deleteIndices(indices)[source]

Delete model idices from the current view

deleteIntermediateTheoryPlotsByModelID(model_id)[source]

Given a model’s ID, deletes all items in the theory item model which reference the same ID. Useful in the case of intermediate results disappearing when changing calculations (in which case you don’t want them to be retained in the list).

deleteSelectedItem()[source]

Delete the current item

deleteTheory(event)[source]

Delete selected rows from the theory model

displayData(data_list, id=None)[source]

Forces display of charts for the given data set

displayFile(filename=None, is_data=True, id=None)[source]

Forces display of charts for the given filename

displayHelp()[source]

Show the “Loading data” section of help

enableGraphCombo(combo_text)[source]

Enables/disables “Assign Plot” elements

extShowEditDataMask()[source]
freezeCheckedData()[source]

Convert checked results (fitted model, residuals) into separate dataset.

freezeDataToItem(data=None)[source]

Freeze given set of data to main model

freezeItem(item=None)[source]

Freeze given item

freezeSelectedItems()[source]

Freeze selected items

freezeTheory(event)[source]

Freeze selected theory rows.

“Freezing” means taking the plottable data from the Theory item and copying it to a separate top-level item in Data.

getAllData()[source]

converts all datasets into serializable dictionary

getDataForID(id)[source]
getItemForID(id)[source]
getWlist()[source]

Wildcards of files we know the format of.

initPerspectives()[source]

Populate the Perspective combobox and define callbacks

isPlotShown(plot)[source]

Checks currently shown plots and returns true if match

itemFromFilename(filename)[source]

Retrieves model item corresponding to the given filename

loadAnalysis()[source]

Called when the “Open Analysis” menu item chosen.

loadComplete(output)[source]

Post message to status bar and update the data manager

loadFailed(reason)[source]
loadFile(event=None)[source]

Called when the “Load” button pressed. Opens the Qt “Open File…” dialog

loadFolder(event=None)[source]

Called when the “File/Load Folder” menu item chosen. Opens the Qt “Open Folder…” dialog

loadFromURL(url)[source]

Threaded file load

loadProject()[source]

Called when the “Open Project” menu item chosen.

minimizeAllPlots()[source]

Minimize all currently displayed plots

newPlot()[source]

Select checked data and plot it

onAnalysisUpdate(new_perspective='')[source]

Update the perspective combo index based on passed string

onCustomContextMenu(position)[source]

Show the right-click context menu in the data treeview

onTabSwitch(index)[source]

Callback for tab switching signal

plotData(plots, transform=True)[source]

Takes 1D/2D data and generates a single plot (1D) or multiple plots (2D)

quickData3DPlot()[source]

Slowish 3D plot

quickDataPlot()[source]

Frozen plot - display an image of the plot

readData(path)[source]
verbatim copy-paste from

sasgui.guiframe.local_perspectives.data_loader.data_loader.py

slightly modified for clarity

readProject(filename)[source]

Read out datasets and fitpages from file

recursivelyCloneItem(item)[source]

Clone QStandardItem() object

saveAnalysis(data, tab_id=1)[source]

Called when the “Save Analysis” menu item chosen.

saveAsAnalysisFile(tab_id=1)[source]

Show the save as… dialog and return the chosen filepath

saveDataAs()[source]

Save the data points as either txt or xml

saveDataToFile(outfile)[source]

Save every dataset to a json file

saveProject()[source]

Called when the “Save Project” menu item chosen.

selectData(index)[source]

Callback method for modifying the TreeView on Selection Options change

sendData(event=None)[source]

Send selected item data to the current perspective and set the relevant notifiers

sendItemToPerspective(item, tab_index=None)[source]

Send the passed item data to the current perspective and set the relevant notifiers

setItemsCheckability(model, dimension=None, checked=False)[source]

For a given model, check or uncheck all items of given dimension

showDataInfo()[source]

Show a simple read-only text edit with data information.

showEditDataMask(data=None)[source]

Mask Editor for 2D plots

updateGraphCombo(graph_list)[source]

Modify Graph combo box on graph add/delete

updateGraphCount(graph_list)[source]

Modify the graph name combo and potentially remove deleted graphs

updateModel(data, p_file)[source]

Add data and Info fields to the model item

updateModelFromData(data)[source]

Given data from analysis/project file, create indices and populate data/theory models

updateModelFromPerspective(model_item)[source]

Receive an update model item from a perspective Make sure it is valid and if so, replace it in the model

updatePerspectiveCombo(index)[source]

Notify the gui manager about the new perspective chosen.

updatePerspectiveWithProperties(key, value)[source]
updatePlot(data)[source]

Modify existing plot for immediate response and returns True. Returns false, if the plot does not exist already.

updatePlotName(name_tuple)[source]

Modify the name of the current plot

updateTheoryFromPerspective(model_item)[source]

Receive an update theory item from a perspective Make sure it is valid and if so, replace/add in the model

updateWithBatchPages(all_data)[source]

Checks all properties and see if there are any batch pages defined. If so, pull out relevant indices and recreate the batch page(s)

sas.qtgui.MainWindow.DataManager module

This module manages all data loaded into the application. Data_manager makes available all data loaded for the current perspective.

All modules “creating Data” posts their data to data_manager . Data_manager make these new data available for all other perspectives.

class sas.qtgui.MainWindow.DataManager.DataManager[source]

Bases: object

Manage a list of data

add_data(data_list)[source]

receive a list of data items for storage

assign(other)[source]
create_gui_data(data, path=None)[source]

Receive data from loader and create a data to use for guiframe

delete_by_id(id_list=None)[source]

save data and path

delete_by_name(name_list=None)[source]

save data and path

delete_data(data_id, theory_id=None, delete_all=False)[source]
delete_theory(data_id, theory_id)[source]
freeze(theory_id)[source]
freeze_theory(data_id, theory_id)[source]
get_all_data()[source]

return list of all available data

get_by_id(id_list=None)[source]
get_by_name(name_list=None)[source]

return a list of data given a list of data names

get_data_state(data_id)[source]

Send list of selected data

get_message()[source]

return message

load_from_readable(fp)[source]

load content from tp to stored_data (a .read()-supporting file-like object)

rename(name)[source]

rename data

save_to_writable(fp)[source]

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

update_data(prev_data, new_data)[source]
update_stored_data(name_list=None)[source]

update stored data after deleting files in Data Explorer

update_theory(theory, data_id=None, state=None)[source]

sas.qtgui.MainWindow.DataState module

class sas.qtgui.MainWindow.DataState.DataState(data=None, parent=None)[source]

Bases: object

Store information about data

clone()[source]
get_data()[source]
get_message()[source]

return message

get_name()[source]
get_path()[source]

return the path of the loaded data

get_theory()[source]
set_data(data)[source]
set_name(name)[source]
set_path(path)[source]

Set the path of the loaded data

set_theory(theory_data, theory_state=None)[source]

sas.qtgui.MainWindow.DroppableDataLoadWidget module

class sas.qtgui.MainWindow.DroppableDataLoadWidget.DroppableDataLoadWidget(parent=None, guimanager=None)[source]

Bases: PyQt5.QtWidgets.QTabWidget, sas.qtgui.MainWindow.UI.DataExplorerUI.Ui_DataLoadWidget

Overwrite drag and drop methods in the base class so users can drop files directly onto the Data Explorer

closeEvent(event)[source]

Overwrite the close event - no close!

dragEnterEvent(event)[source]

Called automatically on a drag into the treeview

dragIsOK(event)[source]

Return True if the event contain URLs

dragMoveEvent(event)[source]

Called automatically when a drag is moved inside the treeview

dropEvent(event)[source]

Called automatically when a drop is added to the treeview.

sas.qtgui.MainWindow.GuiManager module

sas.qtgui.MainWindow.MainWindow module

class sas.qtgui.MainWindow.MainWindow.MainSasViewWindow(screen_resolution, parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow, sas.qtgui.MainWindow.UI.MainWindowUI.Ui_SasView

closeEvent(event)[source]
sas.qtgui.MainWindow.MainWindow.SplashScreen()[source]

Displays splash screen as soon as humanely possible. The screen will disappear as soon as the event loop starts.

sas.qtgui.MainWindow.MainWindow.run_sasview()[source]

sas.qtgui.MainWindow.WelcomePanel module

class sas.qtgui.MainWindow.WelcomePanel.WelcomePanel(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.MainWindow.UI.WelcomePanelUI.Ui_WelcomePanelUI

Module contents