sas.qtgui.Utilities.ModelEditors.ReparamEditor package¶
Subpackages¶
Submodules¶
sas.qtgui.Utilities.ModelEditors.ReparamEditor.ReparameterizationEditor module¶
- class sas.qtgui.Utilities.ModelEditors.ReparamEditor.ReparameterizationEditor.ReparameterizationEditor(parent=None)¶
Bases:
QDialog,Ui_ReparameterizationEditor- __doc__ = None¶
- __init__(self, /, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags), *, sizeGripEnabled: bool | None = None, modal: bool | None = None) None¶
Initialize self. See help(type(self)) for accurate signature.
- __module__ = 'sas.qtgui.Utilities.ModelEditors.ReparamEditor.ReparameterizationEditor'¶
- _can_be_saved_or_give_error()¶
Check to see if a model name exists and everything can be written
- addSignals()¶
- addSubItems(param: Parameter, top_item: QTreeWidgetItem)¶
Add sub-items to the given top-level item for the given parameter :param param: the Sasmodels Parameter class that contains properties to add :param top_item: the top-level item to add the properties to (QTreeWidgetItem)
- addTooltips()¶
Add the default tooltips to the text field
- badPropsCheck(param_item: QTreeWidgetItem)¶
Check a parameter for bad properties. :param param_item: the parameter to check (QTreeWidgetItem)
- checkDuplicates(tree: QTreeWidget)¶
Check for parameters with the same name and display caution icons if found. NOTE: This method MUST come after badPropsCheck, as badPropsCheck overrides existing tooltip text, while this method will add to it if needed. :param tree: the QTreeWidget to check for duplicates.
- checkModel(full_path: str | Path) int¶
Run ast and model checks and attempt to return the line number of the error if any :param full_path: full path to the model file
- closeEvent(self, arg__1: PySide6.QtGui.QCloseEvent, /) None¶
- editSelected()¶
Edit the selected parameter in a new parameter editor dialog
- editorModelModified()¶
User modified the model in the Model Editor. Disable the plugin editor and show that the model is changed.
- generateModelText() str¶
Generate the output model text
- getParamProperties(param: QTreeWidgetItem) dict¶
Return a dictionary of property name: value pairs for the given parameter :param param: the parameter to get properties for (QTreeWidgetItem)
- classmethod getParameterSelection(selected_item: QTreeWidgetItem) QTreeWidgetItem¶
Return the QTreeWidgetItem of the parameter even if selected_item is a ‘property’ (sub) item :param selected_item: QTreeWidgetItem that represents either a parameter or a property
- loadParams(params: [<class 'sasmodels.modelinfo.Parameter'>], tree: ~PySide6.QtWidgets.QTreeWidget, model_name: str | None = None)¶
Load parameters from the selected model into a tree widget :param params: sasmodels.modelinfo.Parameter class :param tree: the tree widget to load the parameters into :param model_name: the name of the model that the parameters are from
- onAddParam()¶
Add parameter to “New parameters box” by invoking parameter editor dialog
- onApply()¶
Generate output reparameterized model and write to file
- onDeleteParam()¶
Delete the selected parameter from the newParamTree
- onHelp()¶
Show the “Reparameterization” section of help
- onLoad()¶
- onModelHelp()¶
Show the help page of the loaded model in the OldParamTree
- onSelectModel()¶
Launch model selection dialog
- parameterWarning(table_item: QTreeWidgetItem, tool_tip_text: str)¶
Display a warning icon on a parameter and set tooltip. :param table_item: The QTreeWidgetItem to add the icon to :param tool_tip_text: The tooltip text to display when the user hovers over the warning
- classmethod removeParameterWarning(table_item: QTreeWidgetItem)¶
Remove the warning icon from a parameter :param table_item: The QTreeWidgetItem to remove the icon from
- setWindowEdited(is_edited: bool)¶
Change the widget name to indicate modified state Modified - add “*” to filename display saved - remove “*” from filename display
- staticMetaObject = PySide6.QtCore.QMetaObject("ReparameterizationEditor" inherits "QDialog": )¶
- updateParam(updated_param: [<class 'sasmodels.modelinfo.Parameter'>], qtree_item: ~PySide6.QtWidgets.QTreeWidgetItem)¶
Update given parameter in the newParamTree with the updated properties :param updated_param: Sasview Parameter class with updated properties :param qtree_item: the qtree_item to update
- static writeModel(output_file_path: str | Path, model_text: str)¶
Write the new model to the given file :param output_file_path: pathlib.Path object pointing to output file location :param model_text: str of the model text to write