sas.qtgui.MainWindow package¶
Subpackages¶
- sas.qtgui.MainWindow.UI package
- Submodules
- sas.qtgui.MainWindow.UI.AboutUI module
- sas.qtgui.MainWindow.UI.AcknowledgementsUI module
- sas.qtgui.MainWindow.UI.CategoryManagerUI module
- sas.qtgui.MainWindow.UI.ChangeCategoryUI module
- sas.qtgui.MainWindow.UI.ChangeNameUI module
- sas.qtgui.MainWindow.UI.DataExplorerUI module
- sas.qtgui.MainWindow.UI.MainWindowUI module
- sas.qtgui.MainWindow.UI.TabbedFileLoadUI module
- sas.qtgui.MainWindow.UI.WelcomePanelUI module
- Module contents
Submodules¶
sas.qtgui.MainWindow.AboutBox module¶
- class sas.qtgui.MainWindow.AboutBox.AboutBox(parent=None)[source]¶
Bases:
QDialog
,Ui_AboutUI
- __doc__ = None¶
- __module__ = 'sas.qtgui.MainWindow.AboutBox'¶
sas.qtgui.MainWindow.Acknowledgements module¶
- class sas.qtgui.MainWindow.Acknowledgements.Acknowledgements(parent=None)[source]¶
Bases:
QDialog
,Ui_Acknowledgements
- __doc__ = None¶
- __module__ = 'sas.qtgui.MainWindow.Acknowledgements'¶
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 '¶
- __module__ = 'sas.qtgui.MainWindow.CategoryManager'¶
- __weakref__¶
list of weak references to the object (if defined)
- regenerateMasterDict()[source]¶
regenerates self.master_category_dict from self.by_model_dict and self.model_enabled_dict
- class sas.qtgui.MainWindow.CategoryManager.CategoryManager(parent=None, manager=None)[source]¶
Bases:
QDialog
,Ui_CategoryManagerUI
- __doc__ = None¶
- __module__ = 'sas.qtgui.MainWindow.CategoryManager'¶
- class sas.qtgui.MainWindow.CategoryManager.ChangeCategory(parent=None, categories=None, model=None)[source]¶
Bases:
QDialog
,Ui_ChangeCategoryUI
Dialog for adding/removing categories for a single model
- __doc__ = '\n Dialog for adding/removing categories for a single model\n '¶
- __module__ = 'sas.qtgui.MainWindow.CategoryManager'¶
- class sas.qtgui.MainWindow.CategoryManager.ToolTippedItemModel(parent=None)[source]¶
Bases:
QStandardItemModel
Subclass from QStandardItemModel to allow displaying tooltips in QTableView model.
- __doc__ = '\n Subclass from QStandardItemModel to allow displaying tooltips in\n QTableView model.\n '¶
- __module__ = 'sas.qtgui.MainWindow.CategoryManager'¶
sas.qtgui.MainWindow.DataExplorer module¶
- class sas.qtgui.MainWindow.DataExplorer.DataExplorerWindow(parent=None, guimanager=None, manager=None)[source]¶
Bases:
DroppableDataLoadWidget
- __doc__ = None¶
- __module__ = 'sas.qtgui.MainWindow.DataExplorer'¶
- closeResultPanelOnDelete(data)[source]¶
Given a data1d/2d object, close the fitting results panel if currently populated with the data
- 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).
- displayDataByName(name=None, is_data=True, id=None)[source]¶
Forces display of charts for the given name
- flatDataForModel(model)[source]¶
Get a flat “name:data1d/2d” dict for all items in the model, including children
- freezeCheckedData()[source]¶
Convert checked results (fitted model, residuals) into separate dataset.
- 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.
- 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
- onAnalysisUpdate(new_perspective_name: str)[source]¶
Update the perspective combo index based on passed string
- onFileListChanged(item)[source]¶
Slot for model (data/theory) changes. Currently only reacting to checkbox selection.
- plotData(plots, transform=True)[source]¶
Takes 1D/2D data and generates a single plot (1D) or multiple plots (2D)
- readData(path)[source]¶
verbatim copy-paste from
sasgui.guiframe.local_perspectives.data_loader.data_loader.py
slightly modified for clarity
- saveAsAnalysisFile(tab_id=1, extension='fitv')[source]¶
Show the save as… dialog and return the chosen filepath
- 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
- 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
- updatePlot(data)[source]¶
Modify existing plot for immediate response and returns True. Returns false, if the plot does not exist already.
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'¶
- __weakref__¶
list of weak references to the object (if defined)
- create_gui_data(data, path=None)[source]¶
Receive data from loader and create a data to use for guiframe
- load_from_readable(fp)[source]¶
load content from tp to stored_data (a .read()-supporting file-like object)
- save_to_writable(fp)[source]¶
save content of stored_data to fp (a .write()-supporting file-like object)
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 '¶
- __module__ = 'sas.qtgui.MainWindow.DataState'¶
- __weakref__¶
list of weak references to the object (if defined)
sas.qtgui.MainWindow.DroppableDataLoadWidget module¶
- class sas.qtgui.MainWindow.DroppableDataLoadWidget.DroppableDataLoadWidget(parent=None, guimanager=None)[source]¶
Bases:
QTabWidget
,Ui_DataLoadWidget
Overwrite drag and drop methods in the base class so users can drop files directly onto the Data Explorer
- __doc__ = '\n Overwrite drag and drop methods in the base class\n so users can drop files directly onto the Data Explorer\n '¶
- __module__ = 'sas.qtgui.MainWindow.DroppableDataLoadWidget'¶
sas.qtgui.MainWindow.GuiManager module¶
- class sas.qtgui.MainWindow.GuiManager.GuiManager(parent=None)[source]¶
Bases:
object
Main SasView window functionality
- __dict__ = mappingproxy({'__module__': 'sas.qtgui.MainWindow.GuiManager', '__doc__': '\n Main SasView window functionality\n ', '__init__': <function GuiManager.__init__>, 'info': <function GuiManager.info>, 'addWidgets': <function GuiManager.addWidgets>, 'loadAllPerspectives': <function GuiManager.loadAllPerspectives>, 'closeAllPerspectives': <function GuiManager.closeAllPerspectives>, 'addCategories': <function GuiManager.addCategories>, 'updatePlotItems': <function GuiManager.updatePlotItems>, 'addPlotItemsInWindowsMenu': <function GuiManager.addPlotItemsInWindowsMenu>, 'plotSelectedSlot': <function GuiManager.plotSelectedSlot>, 'removePlotItemsInWindowsMenu': <function GuiManager.removePlotItemsInWindowsMenu>, 'updateLogContextMenus': <function GuiManager.updateLogContextMenus>, 'updateContextMenus': <function GuiManager.updateContextMenus>, 'statusBarSetup': <function GuiManager.statusBarSetup>, 'fileWasRead': <function GuiManager.fileWasRead>, 'showHelp': <function GuiManager.showHelp>, 'workspace': <function GuiManager.workspace>, 'perspectiveChanged': <function GuiManager.perspectiveChanged>, 'updatePerspective': <function GuiManager.updatePerspective>, 'communicator': <function GuiManager.communicator>, 'perspective': <function GuiManager.perspective>, 'updateProgressBar': <function GuiManager.updateProgressBar>, 'updateStatusBar': <function GuiManager.updateStatusBar>, 'appendLog': <function GuiManager.appendLog>, 'createGuiData': <function GuiManager.createGuiData>, 'setData': <function GuiManager.setData>, 'findItemFromFilename': <function GuiManager.findItemFromFilename>, 'quitApplication': <function GuiManager.quitApplication>, 'checkUpdate': <function GuiManager.checkUpdate>, 'log_installed_packages': <function GuiManager.log_installed_packages>, 'log_imported_packages': <function GuiManager.log_imported_packages>, 'processVersion': <function GuiManager.processVersion>, 'actionWelcome': <function GuiManager.actionWelcome>, 'showWelcomeMessage': <function GuiManager.showWelcomeMessage>, 'addCallbacks': <function GuiManager.addCallbacks>, 'addTriggers': <function GuiManager.addTriggers>, 'actionLoadData': <function GuiManager.actionLoadData>, 'actionLoad_Data_Folder': <function GuiManager.actionLoad_Data_Folder>, 'actionOpen_Project': <function GuiManager.actionOpen_Project>, 'actionOpen_Analysis': <function GuiManager.actionOpen_Analysis>, 'actionSave_Project': <function GuiManager.actionSave_Project>, 'actionSave_Analysis': <function GuiManager.actionSave_Analysis>, 'actionQuit': <function GuiManager.actionQuit>, 'actionUndo': <function GuiManager.actionUndo>, 'actionRedo': <function GuiManager.actionRedo>, 'actionCopy': <function GuiManager.actionCopy>, 'actionPaste': <function GuiManager.actionPaste>, 'actionReport': <function GuiManager.actionReport>, 'actionReset': <function GuiManager.actionReset>, 'actionExcel': <function GuiManager.actionExcel>, 'actionLatex': <function GuiManager.actionLatex>, 'actionSaveParamsAs': <function GuiManager.actionSaveParamsAs>, 'actionShow_Grid_Window': <function GuiManager.actionShow_Grid_Window>, 'showBatchOutput': <function GuiManager.showBatchOutput>, 'actionHide_Toolbar': <function GuiManager.actionHide_Toolbar>, 'actionHide_DataExplorer': <function GuiManager.actionHide_DataExplorer>, 'actionHide_LogExplorer': <function GuiManager.actionHide_LogExplorer>, 'actionStartup_Settings': <function GuiManager.actionStartup_Settings>, 'actionCategory_Manager': <function GuiManager.actionCategory_Manager>, 'actionData_Operation': <function GuiManager.actionData_Operation>, 'actionSLD_Calculator': <function GuiManager.actionSLD_Calculator>, 'actionDensity_Volume_Calculator': <function GuiManager.actionDensity_Volume_Calculator>, 'actionKiessig_Calculator': <function GuiManager.actionKiessig_Calculator>, 'actionSlit_Size_Calculator': <function GuiManager.actionSlit_Size_Calculator>, 'actionSAS_Resolution_Estimator': <function GuiManager.actionSAS_Resolution_Estimator>, 'actionGeneric_Scattering_Calculator': <function GuiManager.actionGeneric_Scattering_Calculator>, 'actionPython_Shell_Editor': <function GuiManager.actionPython_Shell_Editor>, 'actionFreeze_Theory': <function GuiManager.actionFreeze_Theory>, 'actionOrientation_Viewer': <function GuiManager.actionOrientation_Viewer>, 'actionImage_Viewer': <function GuiManager.actionImage_Viewer>, 'actionFile_Converter': <function GuiManager.actionFile_Converter>, 'actionNew_Fit_Page': <function GuiManager.actionNew_Fit_Page>, 'actionConstrained_Fit': <function GuiManager.actionConstrained_Fit>, 'actionCombine_Batch_Fit': <function GuiManager.actionCombine_Batch_Fit>, 'actionFit_Options': <function GuiManager.actionFit_Options>, 'actionGPU_Options': <function GuiManager.actionGPU_Options>, 'actionFit_Results': <function GuiManager.actionFit_Results>, 'showFitResults': <function GuiManager.showFitResults>, 'actionAdd_Custom_Model': <function GuiManager.actionAdd_Custom_Model>, 'actionEdit_Custom_Model': <function GuiManager.actionEdit_Custom_Model>, 'actionManage_Custom_Models': <function GuiManager.actionManage_Custom_Models>, 'actionAddMult_Models': <function GuiManager.actionAddMult_Models>, 'actionEditMask': <function GuiManager.actionEditMask>, 'actionFitting': <function GuiManager.actionFitting>, 'actionInversion': <function GuiManager.actionInversion>, 'actionInvariant': <function GuiManager.actionInvariant>, 'actionCorfunc': <function GuiManager.actionCorfunc>, 'actionCascade': <function GuiManager.actionCascade>, 'actionTile': <function GuiManager.actionTile>, 'actionArrange_Icons': <function GuiManager.actionArrange_Icons>, 'actionNext': <function GuiManager.actionNext>, 'actionPrevious': <function GuiManager.actionPrevious>, 'actionClosePlots': <function GuiManager.actionClosePlots>, 'actionMinimizePlots': <function GuiManager.actionMinimizePlots>, 'actionDocumentation': <function GuiManager.actionDocumentation>, 'actionTutorial': <function GuiManager.actionTutorial>, 'actionAcknowledge': <function GuiManager.actionAcknowledge>, 'actionMarketplace': <function GuiManager.actionMarketplace>, 'actionAbout': <function GuiManager.actionAbout>, 'actionCheck_for_update': <function GuiManager.actionCheck_for_update>, 'updateTheoryFromPerspective': <function GuiManager.updateTheoryFromPerspective>, 'deleteIntermediateTheoryPlotsByModelID': <function GuiManager.deleteIntermediateTheoryPlotsByModelID>, 'updateModelFromDataOperationPanel': <function GuiManager.updateModelFromDataOperationPanel>, 'showPlotFromName': <function GuiManager.showPlotFromName>, 'showPlot': <function GuiManager.showPlot>, 'uncheckAllMenuItems': <function GuiManager.uncheckAllMenuItems>, 'checkAnalysisOption': <function GuiManager.checkAnalysisOption>, 'clearPerspectiveMenubarOptions': <function GuiManager.clearPerspectiveMenubarOptions>, 'setupPerspectiveMenubarOptions': <function GuiManager.setupPerspectiveMenubarOptions>, 'saveCustomConfig': <function GuiManager.saveCustomConfig>, 'customSavePaths': <function GuiManager.customSavePaths>, 'customSaveOpenCL': <function GuiManager.customSaveOpenCL>, 'writeCustomConfig': <function GuiManager.writeCustomConfig>, '__dict__': <attribute '__dict__' of 'GuiManager' objects>, '__weakref__': <attribute '__weakref__' of 'GuiManager' objects>, '__annotations__': {}})¶
- __doc__ = '\n Main SasView window functionality\n '¶
- __module__ = 'sas.qtgui.MainWindow.GuiManager'¶
- __weakref__¶
list of weak references to the object (if defined)
- actionConstrained_Fit()[source]¶
Add a new Constrained and Simult. Fit page in the fitting perspective.
- actionCopy()[source]¶
Send a signal to the fitting perspective so parameters can be saved to the clipboard
- actionDocumentation()[source]¶
Display the documentation
TODO: use QNetworkAccessManager to assure _helpLocation is valid
- actionExcel()[source]¶
Send a signal to the fitting perspective so parameters can be saved to the clipboard
- actionLatex()[source]¶
Send a signal to the fitting perspective so parameters can be saved to the clipboard
- actionPaste()[source]¶
Send a signal to the fitting perspective so parameters from the clipboard can be used to modify the fit state
- actionPrevious()[source]¶
Gives the input focus to the previous window in the list of child windows.
- addCategories()[source]¶
Make sure categories.json exists and if not compile it and install in ~/.sasview
- appendLog(msg)[source]¶
Appends a message to the list widget in the Log Explorer. Use this instead of listWidget.insertPlainText() to facilitate auto-scrolling
- checkAnalysisOption(analysisMenuOption)[source]¶
Unchecks all the items in the analysis menu and checks the item passed
- checkUpdate()[source]¶
Check with the deployment server whether a new version of the application is available. A thread is started for the connecting with the server. The thread calls a call-back method when the current version number has been obtained.
- clearPerspectiveMenubarOptions(perspective)[source]¶
When closing a perspective, clears the menu bar
- customSaveOpenCL(config_content)[source]¶
Update the config module with current session OpenCL choice Returns True if update was done, False, otherwise
- customSavePaths(config_content)[source]¶
Update the config module with current session paths Returns True if update was done, False, otherwise
- deleteIntermediateTheoryPlotsByModelID(model_id)[source]¶
Catch the signal to delete items in the Theory item model which correspond to a model ID. Send the request to the DataExplorer for updating the theory model.
- findItemFromFilename(filename)[source]¶
Queries the data explorer for the index corresponding to the filename within
- log_imported_packages()[source]¶
Log version number of python packages imported in this instance of SasView.
- processVersion(version_info)[source]¶
Call-back method for the process of checking for updates. This methods is called by a VersionThread object once the current version number has been obtained. If the check is being done in the background, the user will not be notified unless there’s an update.
- Parameters:
version – version string
- removePlotItemsInWindowsMenu(plot)[source]¶
Dynamically update the QMenu content and disconnect signals
- setupPerspectiveMenubarOptions(perspective)[source]¶
When setting a perspective, sets up the menu bar
- statusBarSetup()[source]¶
Define the status bar. | <message label> …. | Progress Bar |
Progress bar invisible until explicitly shown
- updateContextMenus(visible=False)[source]¶
Modify the View/Data Explorer menu item text on widget visibility
- updateLogContextMenus(visible=False)[source]¶
Modify the View/Data Explorer menu item text on widget visibility
- updateModelFromDataOperationPanel(new_item, new_datalist_item)[source]¶
- Parameters:
new_item – item to be added to list of loaded files
new_datalist_item –
sas.qtgui.MainWindow.MainWindow module¶
- class sas.qtgui.MainWindow.MainWindow.MainSasViewWindow(screen_resolution, parent=None)[source]¶
Bases:
QMainWindow
,Ui_SasView
- __doc__ = None¶
- __module__ = 'sas.qtgui.MainWindow.MainWindow'¶
sas.qtgui.MainWindow.NameChanger module¶
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