pypeit.setup_gui.view module
- class pypeit.setup_gui.view.ConfigValuesPanel(spec_name, config, lines_to_display, parent=None)[source]
Bases:
QGroupBox
Scrollable panel to display configuration values for one or more frames.
- Parameters:
- class pypeit.setup_gui.view.ObsLogView(model, controller, parent=None)[source]
Bases:
TabManagerBaseTab
Widget for displaying the observation log for raw data files for the same spectrograph but potentially different observing configurations.
- Parameters:
model (
pypeit.setup_gui.model.PypeItObsLogModel
) – Model object for a PypeIt Setup GUI.controller (
pypeit.setup_gui.controller.PypeItObsLogController
) – Controller object for the PypeIt Setup GUI.parent (QWidget) – The parent widget of the tab.
- selectedRows()[source]
Return the selected rows in the metadata table.
- Returns:
List of row indexes of the selected rows in the metadata table.
- setModel(model)[source]
Set a new model for file metadata.
- Parameters:
model (
pypeit.setup_gui.model.PypeItSetupModel
) – The new metadata model
- class pypeit.setup_gui.view.PathEditor(browse_caption, parent=None)[source]
Bases:
QWidget
A custon widget that allows for entering a path. It has an editable combo box for entering file locations, a browse button to use and a file dialog to enter the file location. The history of past locations is kept in the combo box list and file dialog history.
- Parameters:
parent (QWidget) – The parent of this widget.
browse_caption (str) – The caption text to use when searching for locations, also used as place holder text when no location has been set.
- _add_path(new_path)[source]
Set the path, adding it to history and signaling listeners.
- Parameters:
new_path (str) – The new path to add.
- _new_path(new_index)[source]
Signal handler for when the combo box selects a new path.
- Parameters:
new_index – The index within the combo box that was selected.
- browse()[source]
Opens up a
FileDialog
requesting the user select a location.- Returns:
The new location, or None if Cancel was pressed.
- Return type:
- pathEntered
Signal sent when a path has been added.
- class pypeit.setup_gui.view.PypeItCustomEditorDelegate(parent)[source]
Bases:
QStyledItemDelegate
Custom item delegate for rows in a PypeItMetadataView.
- createEditor(self, parent: QWidget | None, option: QStyleOptionViewItem, index: QModelIndex) QWidget | None [source]
- editorClosed(editor, accepted)[source]
Signal handler that is notified when the PypeItEnumListEditor is closed.
- Parameters:
editor (PypeItEnumListEditor) – The editor that was closed.
accepted (bool) – True if the value was accepted, false if it was canceled.
- paint(painter, option, index)[source]
Overridden version of paint for painting items in the PypeItMetadataView.
- class pypeit.setup_gui.view.PypeItEnumListEditor(parent, allowed_values, index, num_lines)[source]
Bases:
QWidget
Widget for editing a enumerated list of values by checking the values on or off with a checkbox.
- Parameters:
- _choiceChecked(widget, checked)[source]
Signal handler for when one of the enumerated values is checked on or off. :param widget: The widget that checked or unchecked. :type widget: QCheckBox :param checked: True if the widget is checked, false if it is not. :type checked: bool
- closed
Signal sent when the user closes the editor with the OK or CANCEL button. :param editor: The editor that was closed. :type editor: QWidget :param accepted: True if a change was accepted, False if it was canceled. :type accepted: bool
- class pypeit.setup_gui.view.PypeItFileView(model, controller)[source]
Bases:
TabManagerBaseTab
Widget for displaying the information needed for one pypeit file. This includes the spectrograph, the configuration keys and values, the files that share that configuration, and the PypeIt parameters.
- Parameters:
(pypeit.setup_gui.model.PypeItFileModel) – The model representing all the information needed for a .pypeit file.
(pypeit.setup_gui.model.PypeItFileController) – The controller for managing the user’s interaction with a PypeIt file)
- selectedRows()[source]
Return the selected rows in the metadata table.
- Returns:
List of row indexes of the selected rows in the metadata table.
- property state
The state of this configuration’s model. NEW, CHANGED, or UNCHANGED.
- class pypeit.setup_gui.view.PypeItMetadataView(parent, model, controller)[source]
Bases:
QTableView
- selectedRows()[source]
Return which rows in the PypeItMetadataPorxy model are selected.
- Returns:
list of rows indexes that are selected.
- Return type:
- selectionChanged(selected, deselected)[source]
Event handler called by Qt when a selection change. Overriden from QTableView.
- Parameters:
selected (QItemSelection) – The items that are currently selected
deselected (QItemSelection) – The items that were deselected by the change.
- selectionUpdated
Signal sent when items in the table are selected or deselected.
- class pypeit.setup_gui.view.SetupGUIMainWindow(model, controller)[source]
Bases:
QWidget
Main window widget for the PypeIt Setup GUI
- Parameters:
model (
pypeit.setup_gui.model.SetupGUIStateModel
) – The model for the PypeitSetupGUI.controller (
pypeit.setup_gui.controller.SetupGUIController
) – The controller for the PypeitSetupGUI.
- _create_button_box()[source]
Create the box with action buttons.
- Returns:
The widget with the action buttons for the GUI.
- Return type:
QWidget
- create_file_tabs(pypeit_file_models)[source]
Create new tabs for new unique configurations found either by openeing a pypeit file or by reading raw data directories.
- Parameters:
pypeit_file_models (list of
pypeit.setup_gui.model.PypeItFileModel
) – Models for the tabs to add.
- create_progress_dialog(op_caption, max_progress_value, cancel_func)[source]
Start displaying progress information for an operation. This uses the QProgressDialog, which will not display itself until a minimum amount of time has passed (currently 1s)
- Parameters:
op_caption (str) – The name of the operation.
max_progress_value (int) – The maximum progress value (i.e. the value when done).
cancel_func (
collections.abc.Callable
) – A callable to deal with cancel being pressed in the progress dialog.
- show_operation_progress(increase, message=None)[source]
Increase the amount of progress being displayed in a progress dialog.
- update_buttons_from_model_state()[source]
Update the enabled/disabled state of buttons based on the model state.
- update_new_file_allowed()[source]
Signal handler to enable/disable adding a new file based on whether the spectrograph has been set.
- class pypeit.setup_gui.view.SpectrographValidator[source]
Bases:
QValidator
Validator to check whether a spectrograph name is valid, or potentially valid. This is used by the spectrograph combo box to allow tab completion without allowing invalid names to be entered.
- validate(str_input, int_input)[source]
Validates whether a string is a valid spectrograph name, a prefix of a valid spectrograph name, or invalid. The comparison is case insensitive because the combo box QCompleter object will convert it to the appropriate case. Overriden method from QValidator.
- Parameters:
str_input – A string input to validate.
int_input – An integer input to validate (not used).
- Returns:
Acceptable, Intermediate, or Invalid based on the input.
- Return type:
QValidator.State
- class pypeit.setup_gui.view.TabManagerBaseTab(parent=None, name='', closeable=False, state=ModelState.UNCHANGED)[source]
Bases:
QWidget
Widget that acts as a tab for
TabManagerWidget
. This defines the interface needed by TabManagerWidget and provides a default implementation of it.- Parameters:
state (
pypeit.setup_gui.model.ModelState
) – The state of the tab as displayed in the TabBar.
- property closeable
- property name
- property state
- class pypeit.setup_gui.view.TabManagerWidget(parent, tab_position=TabPosition.South)[source]
Bases:
QTabWidget
Widget which manages tabs for the obslog and pypeit files. It extends the QTabWidget functionality by allowing tabs by adding widgets to add and remove tabs as well as specifying the modification state with a “*” when a tab hasn’t been saved.
- Parameters:
model (
pypeit.setup_gui.model.SetupGUIStateModel
) – Model object for a PypeIt Setup GUI.controller (
pypeit.setup_gui.model.SetupGUIControllerl
) – Controller object for the PypeIt Setup GUI.
- _hideTabCloseButton(tab_pos, always=False)[source]
Hides the tab close button on a tab. Used for the ObsLog tab.
- setNewTabsEnabled(enabled)[source]
Sets whether or not new tabs can be added to the tab widget. This will enable/disable the “+” tab. :param enabled: True if new tabs can be added, Fale otherwise. :type enabled: bool
- tabCreateRequest
Signal sent when the wants to add a new tab.