sas.qtgui.MainWindow package

Subpackages

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

__annotations__ = {}
__doc__ = None
__init__(parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.AboutBox'
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.Acknowledgements module

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

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.MainWindow.UI.AcknowledgementsUI.Ui_Acknowledgements

__annotations__ = {}
__doc__ = None
__init__(parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.Acknowledgements'
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

__dict__ = mappingproxy({'__module__': 'sas.qtgui.MainWindow.CategoryManager', '__doc__': '\n    Container class for accessing model categories\n    ', '__init__': <function Categories.__init__>, 'readCategoryInfo': <function Categories.readCategoryInfo>, 'saveCategories': <function Categories.saveCategories>, 'setupModelDict': <function Categories.setupModelDict>, 'regenerateModelDict': <function Categories.regenerateModelDict>, 'regenerateMasterDict': <function Categories.regenerateMasterDict>, 'modelToCategory': <function Categories.modelToCategory>, 'modelDict': <function Categories.modelDict>, 'categoryDict': <function Categories.categoryDict>, 'categoryList': <function Categories.categoryList>, '__dict__': <attribute '__dict__' of 'Categories' objects>, '__weakref__': <attribute '__weakref__' of 'Categories' objects>, '__annotations__': {}})
__doc__ = '\n    Container class for accessing model categories\n    '
__init__()[source]
__module__ = 'sas.qtgui.MainWindow.CategoryManager'
__weakref__

list of weak references to the object (if defined)

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

__annotations__ = {}
__doc__ = None
__init__(parent=None, manager=None)[source]
__module__ = 'sas.qtgui.MainWindow.CategoryManager'
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

__annotations__ = {}
__doc__ = '\n    Dialog for adding/removing categories for a single model\n    '
__init__(parent=None, categories=None, model=None)[source]
__module__ = 'sas.qtgui.MainWindow.CategoryManager'
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.

__annotations__ = {}
__doc__ = '\n    Subclass from QStandardItemModel to allow displaying tooltips in\n    QTableView model.\n    '
__init__(parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.CategoryManager'
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

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

__dict__ = mappingproxy({'__module__': 'sas.qtgui.MainWindow.DataManager', '__doc__': '\n    Manage a list of data\n    ', '__init__': <function DataManager.__init__>, '__str__': <function DataManager.__str__>, 'create_gui_data': <function DataManager.create_gui_data>, 'rename': <function DataManager.rename>, 'add_data': <function DataManager.add_data>, 'update_data': <function DataManager.update_data>, 'update_theory': <function DataManager.update_theory>, 'get_message': <function DataManager.get_message>, 'get_by_id': <function DataManager.get_by_id>, 'freeze': <function DataManager.freeze>, 'freeze_theory': <function DataManager.freeze_theory>, 'delete_data': <function DataManager.delete_data>, 'remove_item_from_data_name_dict': <function DataManager.remove_item_from_data_name_dict>, 'delete_theory': <function DataManager.delete_theory>, 'delete_by_id': <function DataManager.delete_by_id>, 'get_by_name': <function DataManager.get_by_name>, 'delete_by_name': <function DataManager.delete_by_name>, 'update_stored_data': <function DataManager.update_stored_data>, 'get_data_state': <function DataManager.get_data_state>, 'get_all_data': <function DataManager.get_all_data>, 'assign': <function DataManager.assign>, 'save_to_writable': <function DataManager.save_to_writable>, 'load_from_readable': <function DataManager.load_from_readable>, '__dict__': <attribute '__dict__' of 'DataManager' objects>, '__weakref__': <attribute '__weakref__' of 'DataManager' objects>, '__annotations__': {}})
__doc__ = '\n    Manage a list of data\n    '
__init__()[source]

Store opened path and data object created at the loading time :param auto_plot: if True the datamanager sends data to plotting

plugin.

Parameters

auto_set_data – if True the datamanager sends to the current

perspective

__module__ = 'sas.qtgui.MainWindow.DataManager'
__str__()[source]

Return str(self).

__weakref__

list of weak references to the object (if defined)

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)

remove_item_from_data_name_dict(name)[source]

Remove ‘name’ or ‘name [n]’ from data_name_dict

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

__dict__ = mappingproxy({'__module__': 'sas.qtgui.MainWindow.DataState', '__doc__': '\n     Store information about data\n    ', '__init__': <function DataState.__init__>, '__str__': <function DataState.__str__>, 'clone': <function DataState.clone>, 'set_name': <function DataState.set_name>, 'get_name': <function DataState.get_name>, 'set_data': <function DataState.set_data>, 'get_data': <function DataState.get_data>, 'set_path': <function DataState.set_path>, 'get_path': <function DataState.get_path>, 'set_theory': <function DataState.set_theory>, 'get_theory': <function DataState.get_theory>, 'get_message': <function DataState.get_message>, '__dict__': <attribute '__dict__' of 'DataState' objects>, '__weakref__': <attribute '__weakref__' of 'DataState' objects>, '__annotations__': {}})
__doc__ = '\n     Store information about data\n    '
__init__(data=None, parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.DataState'
__str__()[source]

Return str(self).

__weakref__

list of weak references to the object (if defined)

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

__annotations__ = {}
__doc__ = '\n    Overwrite drag and drop methods in the base class\n    so users can drop files directly onto the Data Explorer\n    '
__init__(parent=None, guimanager=None)[source]
__module__ = 'sas.qtgui.MainWindow.DroppableDataLoadWidget'
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

__annotations__ = {}
__doc__ = None
__init__(screen_resolution, parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.MainWindow'
closeEvent(self, QCloseEvent)[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.NameChanger module

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

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

__annotations__ = {}
__doc__ = None
__init__(parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.NameChanger'
addActions()[source]

Add actions for buttons

close(retVal=False)[source]

Return a value - hide the window for now

property data
getNewText()[source]

Find the radio button that is selected and find its associated textbox

property model_item
removeData(data_list=None)[source]

Safely remove data from the window in the unlikely event a data deletion signal is sent to the modal window

sas.qtgui.MainWindow.PackageGatherer module

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

Bases: object

A class used to gather packages/modules used by SasView and their current installed version

Method log_installed_packages

Log version number of locally installed python packages

Method log_imported_packages

Log version number of python packages imported in this instance of SasView.

Method get_imported_packages

Get a dictionary of imported module version numbers

Method remove_duplicate_modules

Strip duplicate instances of each module

Method format_unattainable_packages_list

Format module names in the unattainable_modules list

__dict__ = mappingproxy({'__module__': 'sas.qtgui.MainWindow.PackageGatherer', '__doc__': ' A class used to gather packages/modules  used by SasView and their current installed version\n\n    :method log_installed_packages: Log version number of locally installed python packages\n    :method log_imported_packages: Log version number of python packages imported in this instance of SasView.\n    :method get_imported_packages: Get a dictionary of imported module version numbers\n    :method remove_duplicate_modules: Strip duplicate instances of each module\n    :method format_unattainable_packages_list: Format module names in the unattainable_modules list\n    ', 'log_installed_modules': <function PackageGatherer.log_installed_modules>, 'log_imported_packages': <function PackageGatherer.log_imported_packages>, 'get_imported_packages': <function PackageGatherer.get_imported_packages>, 'remove_duplicate_modules': <function PackageGatherer.remove_duplicate_modules>, 'format_no_version_list': <function PackageGatherer.format_no_version_list>, '__dict__': <attribute '__dict__' of 'PackageGatherer' objects>, '__weakref__': <attribute '__weakref__' of 'PackageGatherer' objects>, '__annotations__': {}})
__doc__ = ' A class used to gather packages/modules  used by SasView and their current installed version\n\n    :method log_installed_packages: Log version number of locally installed python packages\n    :method log_imported_packages: Log version number of python packages imported in this instance of SasView.\n    :method get_imported_packages: Get a dictionary of imported module version numbers\n    :method remove_duplicate_modules: Strip duplicate instances of each module\n    :method format_unattainable_packages_list: Format module names in the unattainable_modules list\n    '
__module__ = 'sas.qtgui.MainWindow.PackageGatherer'
__weakref__

list of weak references to the object (if defined)

format_no_version_list(modules_dict, no_version_list)[source]

Format module names in the no_version_list list

The unattainable_modules is a list of modules whose version number could not be found. This method rename each module in the unattainable_modules to it’s parent modules name, remove modules that already have a version number and remove duplicate modules from the no_version_list list. Entries may appear in the no_version_list if they are a class in a module, and the version number could not be ascertained from the class.

Parameters
  • modules_dict (dict) – A dictionary with the module names as the key, with their respective version numbers as the value.

  • no_version_list (list) – A list of modules whose version number could not be found.

Returns

A reduced / clean list of modules whose version number could not be found

Return type

dict

get_imported_packages()[source]

Get a dictionary of imported package version numbers

Use a variety of method, for example a module.version call, to attempt to get the module version of each module that has been imported in this instance of running SasView. The sys.modules command lists the imported modules. A list of modules whose version number cannot be found is also included.

Returns

A dictionary with the package names as the key, with their respective version numbers as the value.

Return type

dict

log_imported_packages()[source]

Log version number of python packages imported in this instance of SasView.

Use the get_imported_packages method to to create a dictionary of installed modules as the keys, with their respective version numbers as the values. There may be some packages whose version number is unattainable.

Returns

Nothing

Return type

None

log_installed_modules()[source]

Log version number of locally installed python packages

Use pip list to create a dictionary of installed modules as the keys, with their respective version numbers as the values. Only packages available through pip will be included.

:returns:Nothing :rtype: None

remove_duplicate_modules(modules_dict)[source]

Strip duplicate instances of each module

Multiple instances of one module can be keys of the dictionary of module version numbers generated by the method get_imported_packages. This is because if an individual class is imported from a module, then each class would be listed in sys.modules. For example the command from PyQt5.QtWidgets import QMainWindow, QMdiArea lead to both QMainWindow and QMdiArea being keys, when in reality they are both part of PyQt5. This method save the first instance of each module, unless the version numbers are different.

Parameters

modules_dict (dict) – A dictionary with the module names as the key, with their respective version numbers as the value.

Returns

A reduced / cleaned dictionary with the module names as the key, with their respective version numbers as the value.

Return type

dict

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

__annotations__ = {}
__doc__ = None
__init__(parent=None)[source]
__module__ = 'sas.qtgui.MainWindow.WelcomePanel'

Module contents