autojob.coordinator.gui package¶
GUI elements for the Coordinator GUI.
The GUI can be launched either programmatically:
from autojob.coordinator.gui import gui
gui.run()
or from the command line:
autojob coordinator
Submodules¶
autojob.coordinator.gui.groups module¶
Group tasks by structure and calculation and submission parameters.
This module defines classes used to group tasks by structure, calculation parameters, and submission parameters.
StructureGroup s are lists of structure filenames.
CalculationParameterGroup s map job.CalculationParameter s
to values.
SubmissionParameterGroup s map structure filenames to dictionaries
which map job.CalculationParameter s to values which define
which calculations are to be included in the SubmissionParameterGroup.
- class autojob.coordinator.gui.groups.CalculationParameterGroup(calculation_parameters: list[CalculationParameter])[source]¶
Bases:
objectA collection of values of
job.CalculationParameters.A
CalculationParameterGroupmaps aCalcuationParameterto a list of values of thatCalculationParameter.Example
>>> import math >>> from autojob.coordinator.gui.groups import CalculationParameterGroup >>> from autojob.coordinator.job import CalculationParameter >>> parameter = CalculationParameter( ... name="parameter", ... explicit=False, ... allowed_types=[int], ... values=(-math.inf, math.inf, "()"), ... default=1, ... ) >>> group = CalculationParameterGroup([parameter])
Initialize a
CalculationParameterGroup.- Parameters:
calculation_parameters – A list of
job.CalculationParameters used to define theCalculationParameterGroup.
- add_values(calculation_parameter: CalculationParameter, vals: Iterable) None[source]¶
Add values of parameter.
- Parameters:
calculation_parameter – The calculation parameter to add.
vals – The values for the calculation parameter.
- property defined_calculation_parameters: list[CalculationParameter]¶
The
CalculationParameters for which values are defined.
- get_sets() list[dict[str, Any]][source]¶
Get all calculation parameter sets from a CalculationParameterGroup.
- Parameters:
group_name – _description_
- Returns:
A list of dictionaries mapping calculation parameter groups to values.
- static initialize_values(calculation_parameters: list[CalculationParameter]) dict[CalculationParameter, list[Any]][source]¶
Initialize the values of a
CalculationParameterGroup.- Parameters:
calculation_parameters – An iterable of
job.CalculationParameters for which from which to initialize theCalculationParameterGroup.- Returns:
A dictionary mapping
parameters.CalculatorParameters to a list of values defining the group.
- remove_values(calculation_parameter: CalculationParameter, indices_to_remove: Iterable[int]) None[source]¶
Remove values from a calculation parameter set.
- Parameters:
calculation_parameter – The calculation parameter from which a value will be removed.
indices_to_remove – The indices in the calculation parameter set to remove.
- property values: dict[CalculationParameter, list[Any]]¶
A mapping from
CalculationParameters to its values.
- class autojob.coordinator.gui.groups.StructureGroup[source]¶
Bases:
objectA collection of structure filenames.
StructureGroups indicate how to group calculations involving particular structures.Initialize a StructureGroup.
- add_structures(new_structures: Iterable[Path]) None[source]¶
Add and validate new structures to StructureGroup.
- Parameters:
new_structures – An iterable of paths to add to the
StructureGroup. Duplicates are removed.
- remove_structures(indices_to_remove: Iterable[int]) None[source]¶
Remove structures from the
StructureGroup.- Parameters:
indices_to_remove – The indices of structures to remove.
- static validate_structures(new_structures: Iterable[Path | str]) list[Path][source]¶
Check that each structure filename points to an existing file.
- Parameters:
new_structures – An iterable of paths or filenames representing new structures.
- Returns:
A list of paths corresponding to valid existing structure files.
- validated_structures(new_structures: Iterable[Path | str]) list[Path][source]¶
Check that each structure filename points to an existing file.
- Parameters:
new_structures – An iterable of paths or filenames representing new structures.
- Returns:
A list of paths corresponding to valid existing structure files.
- class autojob.coordinator.gui.groups.SubmissionParameterGroup[source]¶
Bases:
objectA collection of values of submission parameters.
A
SubmissionParameterGroupmaps structure filenames to a mapping relatingCalculationParameters to a list of values of thatCalculationParameter.Example
>>> from autojob.coordinator.gui.groups import SubmissionParameterGroup >>> group = SubmissionParameterGroup()
Initialize a SubmissionParameterGroup.
- update(specs_to_add: dict[Path, dict[CalculationParameter, list[Any]]])[source]¶
Update the values of
CalculationParameters in the group.- Parameters:
specs_to_add – A dictionary of the same form as
SubmissionParameterGroup.values()used to update the values in theSubmissionParameterGroup.
autojob.coordinator.gui.gui module¶
This module defines the logic for the main Coordinator GUI.
Importantly, this module defines the GUI class
and run() function used to execute the Coordinator GUI.
Example:
>>> from autojob.coordinator.gui import gui
>>> gui.run()
- class autojob.coordinator.gui.gui.CoordinatorTabs[source]¶
Bases:
TypedDictThe Coordinator GUI tabs.
- job_submission: JobSubmissionTab¶
- parameter_selection: ParameterSelectionTab¶
- structure_selection: StructureSelectionTab¶
- study_configuration: StudyConfigurationTab¶
- submission_configuration: SubmissionConfigurationTab¶
- summary: SummaryTab¶
- class autojob.coordinator.gui.gui.GUI(top_level: Tk, template: str | None, dest: Path | None = None)[source]¶
Bases:
objectThe main GUI for
autojob.coordinator.- Variables:
parent – The top level widget for the GUI application.
coordinator – The
Coordinatorresponsible for managing study group creation.template – A string representing the path to the template of a previously created coordinator study group. Defaults to None.
notebook – A
ttk.Notebookused to host the configuration tabs.tabs – The tabs of the notebook.
Initialize the coordinator GUI.
- Parameters:
top_level – The top-level
tkinter.Tkinstance.template – The filename of a template with which to pre-populate the GUI.
dest – The root directory for study group creation. Defaults to the current working directory.
- autojob.coordinator.gui.gui.configure_root(root: Tk) None[source]¶
Configure the root window.
- Parameters:
root – The top-level
tkinter.Tkinstance.
autojob.coordinator.gui.job_submission module¶
Configure scheduler parameters for SubmissionGroups.
- class autojob.coordinator.gui.job_submission.AutoRestartPanel(parent: JobSubmissionTab)[source]¶
Bases:
LabelframeSpecify auto-restart options.
- Variables:
parent – The
JobSubmissionTabin which theAutoRestartPanelresides.frame1 – The
tkinter.ttk.Framecontaining the unlimited auto-restart prompt.label1 – The
tkinter.ttk.Labelcontaining the prompt for unlimited auto-restart.rbs – A list of
Radiobuttons indicating the choice for unlimited auto-restart.rb_var – An
tkinter.IntVarindicating which selection the user has made. 0 if user has selected unlimited auto-restart, 1 otherwise.frame2 – The
tkinter.ttk.Framefor specifying the auto-restart limit.label2 – The
tkinter.ttk.Labelcontaining the prompt for setting the auto-restart limit.sb – A
tkinter.Spinboxfor specifying the auto-restart limit.sb_var – An
tkinter.IntVarstoring the value of the auto-restart limit.
Initialize an
AutoRestartPanel.- Parameters:
parent – The
JobSubmissionTabin which theAutoRestartPanelresides.
- create_unlimited_restart_prompt() tuple[Frame, Label, list[Radiobutton], IntVar][source]¶
Create the panel for selecting unlimited auto-restart.
- Returns:
A tuple (
frame,label,rbs,rb_var) whereframeis the Frame containing the radio buttons, label contains the auto-restart text prompt,rbsis a list ofRadiobuttons which set unlimited auto-restart, andrb_varis theIntVarindicating which radiobutton is selected.
- class autojob.coordinator.gui.job_submission.ExtrasPanel(parent: JobSubmissionTab)[source]¶
Bases:
LabelframeSpecify additonal SLURM options.
- Variables:
parent – The
JobSubmissionTabin which theExtrasPanelresides.account – The
tkinter.StringVarstoring the value of the--accountoption.mail_type – The
tkinter.StringVarstoring the value of the--mail-typeoption.mail_user – The
tkinter.StringVarstoring the value of the--mail-useroption.
Initialize a
ExtrasPanel.- Parameters:
parent – The
JobSubmissionTabin which theExtrasPanelresides.
- class autojob.coordinator.gui.job_submission.GroupSelectionCombobox(parent: JobSubmissionTab)[source]¶
Bases:
ComboboxSelect a SubmissionGroup.
- Variables:
parent – The
JobSubmissionTabin which theGroupSelectionComboboxis embedded.var – A
tkinter.StringVarstoring the name of the active SubmissionGroup.
Note
The
.load()function of the parent frame is called during the validation function for the combobox.Initialize a
GroupSelectionCombobox.- Parameters:
parent – The
JobSubmissionTabin which theGroupSelectionComboboxis embedded.
- class autojob.coordinator.gui.job_submission.JobSubmissionPanels[source]¶
Bases:
TypedDictThe JobSubmissionTab panels.
- ar_panel: AutoRestartPanel¶
- mail_panel: ExtrasPanel¶
- mem_panel: MemoryPanel¶
- para_panel: ParallelizationPanel¶
- part_panel: PartitionPanel¶
- rt_panel: RunTimePanel¶
- class autojob.coordinator.gui.job_submission.JobSubmissionParameters[source]¶
Bases:
TypedDictJob submission parameters.
- run_time: RunTimeDict¶
- class autojob.coordinator.gui.job_submission.JobSubmissionTab(main_app: Notebook)[source]¶
Bases:
FrameSpecify submission parameters for a SubmissionGroup.
- Variables:
parent – The
tkinter.ttkNotebookin which theJobSubmissionTabresides.app – The root
coordinator.gui.GUI.groub_cb – The
GroupSelectionComboboxfor selecting a group.panels – A dictionary mapping panel names to the various frames used to set submission parameters.
Initialize the job submission tab.
- Parameters:
main_app – The
tkinter.ttkNotebookin which theJobSubmissionTabresides.
- initialize_submission_parameters() dict[str, JobSubmissionParameters][source]¶
Create the submission group dictionary.
- Returns:
A dictionary mapping submission parameter group names to dictionaries of submission parameters.
- new_submission_parameters() JobSubmissionParameters[source]¶
Create a default set of submission parameters.
- property submission_parameters: dict[str, JobSubmissionParameters]¶
The submission parameters of each submission parameter group.
- class autojob.coordinator.gui.job_submission.MemoryPanel(parent)[source]¶
Bases:
LabelframeSpecify a memory limit for jobs of the SubmissionGroup.
- Variables:
parent – The
JobSubmissionTabin which theMemoryPanelis embedded.entry – The
tkinter.Entryfor specifying memory.entry_var – The
tkinter.StringVarstoring the value of the specified memory.units_rb_frame – The
tkinter.ttk.Framecontaining the units radiobuttons.rbs – A list of
tkinter.Radiobuttons, for selecting a memory units.rb_var – A
tkinter.IntVarstoring the value of the selected memory unit.shadow_var – A
tkinter.IntVarstoring the previous value of the selected memory unit.
Initialize a
GroupSelectionCombobox.- Parameters:
parent – The
JobSubmissionTabin which theGroupSelectionComboboxis embedded.
- create() tuple[Entry, StringVar][source]¶
Create a
EntryandStringVarfor the memory specifying entry.
- class autojob.coordinator.gui.job_submission.ParallelizationPanel(parent: JobSubmissionTab)[source]¶
Bases:
LabelframeSpecify parallelization parameters for jobs of the SubmissionGroup.
- Variables:
parent – The
JobSubmissionTabin which theParallelizationPanelis embedded.frames – A list of
tkinter.ttk.Frames, containing GUI elements for node and core specificiations.sbs – A list of
tkinter.Spinboxes, for specifying nodes and cores.vars – A list of
tkinter.IntVars, storing node and core specifications.
Initialize a
ParallelizatioPanel.- Parameters:
parent – The
JobSubmissionTabin which theParallelizationPanelis embedded.
- class autojob.coordinator.gui.job_submission.PartitionPanel(parent: JobSubmissionTab)[source]¶
Bases:
LabelframeSpecify partitions for jobs of the SubmissionGroup.
- Variables:
parent – The
JobSubmissionTabin which thePartitionPanelis embedded.partitions – The list of the selected partitions.
partition_cb – The
tkinter.Comboboxfor selecting partitions to add.button_frame – The
tkinter.ttk.Framecontaining buttons to add, clear and remove partitions.listbox – The
tkinter.Listboxfor displaying the selectedyscroll – The
tkinter.ttk.Scrollbarfor manipulating theListbox.list_var – The
tkinter.StringVarstoring the contents of theListbox.
Initialize a
PartitionPanel.- Parameters:
parent – The
JobSubmissionTabin which thePartitionPanelis embedded.
- add_partitions() None[source]¶
Validates parameter values and adds new values.
Duplicates are removed and the entries in the
Listboxare sorted.
- create_combobox() tuple[Combobox, StringVar][source]¶
Returns the selection
ComboboxandStringVaras a 2-tuple.
- enforce_partition_limits() None[source]¶
Update partitions available for selection.
This method populates the list of partitions available for selection using the values of the submission parameters and the properties of the available partitions.
- format_partitions(suitable_partitions: list[str]) None[source]¶
Format the selected partitions based on request suitability.
Suitable partitions are formatted in white text. Unsuitable partitions are formatted in red text.
- Parameters:
suitable_partitions – The list of partitions that are suitable given the present resource request.
- class autojob.coordinator.gui.job_submission.RunTimeDict[source]¶
Bases:
TypedDictDictionary representing a time.
- class autojob.coordinator.gui.job_submission.RunTimePanel(parent: JobSubmissionTab, time_limit: int = 10080)[source]¶
Bases:
LabelframeSpecify a time limit for jobs of the SubmissionGroup.
- Variables:
parent – The
JobSubmissionTabin which the RunTimePanel is embedded.max_time_limit – The maximum time that can be specified. This will be used as a limit for the combo box.
frames – A list of
tkinter.ttk.Frames, containing GUI elements for day, hour, and minute specifications.sbs – A list of
tkinter.Spinboxes, for specifying days, hours, and minutes.vars – A list of
tkinter.StringVars, storing day, hour, and minute specifications.
Initialize the
RunTimePanel.- Parameters:
parent – The
JobSubmissionTabin which theGroupSelectionComboboxis embedded.time_limit – The maximum time that can be specified. This will be used as a limit for the combo box.
autojob.coordinator.gui.parameter_selection module¶
Specify calculator parameters.
- class autojob.coordinator.gui.parameter_selection.GroupSelectionCombobox(parent: ParameterSelectionTab)[source]¶
Bases:
ComboboxSelect a CalculatorParameterGroup.
- Variables:
parent – The
ParameterSelectionTabin which theGroupSelectionComboboxis embedded.var – A
tkinter.StringVarstoring the name of the active CalculatorParameterGroup.
Note
- The
.load()function of the parent frame is called during the validation function for the combobox.
Initialize a
GroupSelectionCombobox.- Parameters:
parent – The parent
ParameterSelectionTabin which the combobox resides.
- class autojob.coordinator.gui.parameter_selection.ParameterInputFrame(parent: ParameterInputSection, text: str)[source]¶
Bases:
FrameA frame containing the input widget for parameter specification.
- Variables:
parent – The
ParameterInputSectionin which theParameterInputFrameis embedded.text – Descriptive text for the parameter.
finite_int_range – Whether the
ParameterInputFrameis used to specify the value restricted to a finite range of integers.label – The
tkinter.ttk.Labelfor theParameterInputFrame.widg – The Tkinter widget used to input the value of the paramter.
var – A
tkinter.StringVarstoring the value of the parameter.
Initialize a
ParameterInputFrame.- Parameters:
parent – The
ParameterInputSectionin which the``ParameterInputFrame`` is embedded.
text – Descriptive text for the parameter.
- create_combobox() tuple[Combobox, StringVar][source]¶
Create a
Comboboxto select parameter values.Returns a 2-tuple (
cb,var) wherecbis theComboboxandvaris the associatedStringVar.
- create_entry() tuple[Entry, StringVar][source]¶
Create an
Entryfor specifying parameter values.Returns a 2-tuple (
entry,var) whereentryis theEntryandvaris the associatedStringVar.
- class autojob.coordinator.gui.parameter_selection.ParameterInputSection(parent: ParameterPanel)[source]¶
Bases:
FrameA container frame for
ParameterInputFrames.- Variables:
parent – The
ParameterPanelin which theParameterInputSectionis embedded.input_frames – The
ParameterInputFrames for speciying parameter values.
Initialize a
ParameterInputSection.- Parameters:
parent – The
ParameterPanelin which the``ParameterInputSection`` is embedded.
- create_input_frames() list[ParameterInputFrame][source]¶
Create the input frames for specifying parameter values.
The input frames created depends on the type of parameter.
- frame_titles() list[str][source]¶
Determine the frame titles based on the parameter type.
- Returns:
A list of strings representing frame titles.
- ”select”: present unless the parameter has no special values and
the only title present if the parameter is set by explicit values.
Possibilities: “select” only, all but “select”, all
- class autojob.coordinator.gui.parameter_selection.ParameterPanel(parent: ParameterSelectionTab, param: CalculationParameter)[source]¶
Bases:
LabelframeA Frame containing GUI elements for defining parameter values.
- Variables:
parent – The
ParameterSelectionTabto which this panel belongs.param – The parameter whose parametrization is represented by the panel.
rbf – The
ParameterRadiobuttonFrameused select the input method.input_section – The
LabelFrameused to enable entering parametrization values.lbf – The
ListboxFrameused to display the parameter values.button_frame – The Frame in which the add/clear/delete buttons reside.
default_button – The Button used to reset the parameter value to its default value.
check_var – The variable storing the state of
default_button.
Initialize a ParameterPanel.
- Parameters:
parent – The
ParameterSelectionTabin which the``ParameterInputSection`` is embedded.
param – The calculation parameter corresponding to the
ParameterPanel.
- add_parameter_values() None[source]¶
Validates parameter values and adds new values.
Duplicates are removed and the entries in the
tkinter.Listboxare sorted.
- create_default_button() tuple[Checkbutton, IntVar][source]¶
Create the ‘Use default value’
CheckbuttonandIntVar.
- set_parameter_entry_method() None[source]¶
Determines the flags for each widget and calls
self.set_states.- Raises:
ValueError – If string corresponding to active
Radiobuttonisunexpected. –
- set_states(flags: list[int]) None[source]¶
Sets the states of the parameter entry widgets.
- Parameters:
flags – The indices correspond to the widgets as
follows – 0: Widget with label “select” 1: Widget with label “enter” 2: Widget with label “start” 3: Widget with label “stop” 4: Widget with label “steps”
- class autojob.coordinator.gui.parameter_selection.ParameterRadiobuttonFrame(parent: ParameterSelectionTab)[source]¶
Bases:
LabelframeSelect the parameter entry method.
- Variables:
parent – The
ParameterSelectionTabin which theParameterRadiobuttonFrameis embedded.rb_var
rbs
str_vars
Initialize a
ParameterRadiobuttonFrame.- Parameters:
parent – The
ParameterSelectionTabin which theParameterRadiobuttonFrameis embedded.
- create_radio_buttons() tuple[IntVar, list[Radiobutton], list[StringVar]][source]¶
Create the input method
Radiobuttons.- Returns:
A 3-tuple (
rb_var,rbs,str_vars) whererb_varis thetkinter.IntVarindicating which input methodRadiobuttonis selected,rbsis a list of the input methodRadiobuttons, andstr_varsis a list of thetkinter.StringVars associated with the labels of eachRadiobutton.
- class autojob.coordinator.gui.parameter_selection.ParameterSelectionCombobox(parent: ParameterSelectionTab)[source]¶
Bases:
ComboboxA
Comboboxto slect a parameter whose values to display.- Parameters:
parent – The
ParameterSelectionTabto which this Combobox belongs.var – A
tkinter.StringVarwhich stores the name of the parameter whose values are being displayed.
Initialize an
ParameterSelectionCombobox.- Parameters:
parent – The
ParameterSelectionTabto which thisComboboxbelongs.
- class autojob.coordinator.gui.parameter_selection.ParameterSelectionTab(main_app: gui.GUI)[source]¶
Bases:
FrameA GUI element for defining parameter values.
- Variables:
parent – The
tkinter.ttk.Notebookin which theParameterSelectionTabresides.app – The running
gui.GUIinstance.group_selection_cb – The
GroupSelectionComboboxfor selecting the active calculation parameter group.param_panels – The
ParameterPanels for each calculation parameter.panel_to_display – The
ParameterPanelto display.param_selection_cb – The
tkinter.Comboboxused to select the active parameter.
Initialize a
ParameterSelectionTab.- Parameters:
main_app – The running
gui.GUIinstance.
- property calc_params: dict[str, CalculationParameterGroup]¶
A map from parameter group names to the parameter group.
- create_param_panels() list[ParameterPanel][source]¶
The
ParameterPanels of theParameterSelectionTab.
- load_calc_params() dict[str, CalculationParameterGroup][source]¶
Updates or creates calculation parameters.
- Returns:
A dictionary mapping the names of
groups.CalculationParameterGroups to the groups themselves.
- load_parameter_list() list[CalculationParameter][source]¶
Return the parameter list based on the selected calculator.
- property params: list[CalculationParameter]¶
Return the calculation parameters.
autojob.coordinator.gui.structure_selection module¶
Select structures for structure groups.
- class autojob.coordinator.gui.structure_selection.GroupButtonFrame(parent: StructureSelectionPanel)[source]¶
Bases:
FrameDefine StructureGroups.
- Variables:
parent – The
StructureSelectionPanelin which the GroupButtonFrame resides.create_group_entry – The
tkinter.ttk.Entryfor entering structure group names.create_group_button – The
tkinter.ttk.Entryfor creating structure groups.entry_var – The
tkinter.StringVarstoring the name of the structure group to create.del_group_cb – The
tkinter.Comboboxfor selecting which structure group to delete.del_group_button – The
tkinter.ttk.Entryfor deleting structure groups.cb_var1 – The
tkinter.StringVarstoring the name of the structure group to delete.groups_cb – The
tkinter.Comboboxfor selecting which structure group structures are to be added to.add_to_group_button – The
tkinter.ttk.Buttonfor adding selected structures to structure groups.cb_var2 – The
tkinter.StringVarstoring the name of the structure group to which selected structures will be added.
Initialize a StructureSelectionFrame.
- Parameters:
parent – The
StructureSelectionPanelin which the`GroupButtonFrame` resides.
- create_add_to_group() tuple[Combobox, Button, StringVar][source]¶
Create the GUI elements for updating structure groups.
- create_create_group() tuple[Entry, Button, StringVar][source]¶
Create the GUI elements for creating structure groups.
- create_del_group() tuple[Combobox, Button, StringVar][source]¶
Create the GUI elements for deleting structure groups.
- property structure_groups: dict[str, StructureGroup]¶
A mapping from structure group names to structure filenames.
- class autojob.coordinator.gui.structure_selection.GroupViewFrame(parent)[source]¶
Bases:
FrameView the structures in each structure group.
- Variables:
parent – The
StructureSelectionPanelin which theGroupViewFrameresides.lbf – The
widgets.ListboxFramelisting structure filenames.button_frame – A
tkinter.ttk.Framecontaining “remove” and “clear” buttons.
Initialize a
GroupViewFrame.- Parameters:
parent – The
StructureSelectionPanelin which the``GroupViewFrame`` resides.
- class autojob.coordinator.gui.structure_selection.StructureSelectionFrame(parent: StructureSelectionPanel)[source]¶
Bases:
FrameSelect structures to use.
- Variables:
parent – The
StructureSelectionPanelin which the StructureSelectionFrame resides.lbf – The
widgets.ListboxFramelisting structure filenames.button_frame – A
tkinter.ttk.Framecontaining “add”, “remove”, and “clear” buttons.
Initialize a StructureSelectionFrame.
- Parameters:
parent – The
StructureSelectionPanelin which the`StructureSelectionFrame` resides.
- class autojob.coordinator.gui.structure_selection.StructureSelectionPanel(parent: StructureSelectionTab)[source]¶
Bases:
LabelframeA
LabelFramefor selecting structures and creating structure groups.- Variables:
parent – The
StructureSelectionTabin which theStructureSelectionPanelresides.structure_selection_frame – The frame for selecting structures.
group_button_frame – The frame for creating and deleting structure groups.
group_view_frame – The frame for displaying the structures of the selected group.
Initialize a
StructureSelectionPanel.- Parameters:
parent – The
StructureSelectionTabin which the``StructureSelectionPanel`` resides.
- class autojob.coordinator.gui.structure_selection.StructureSelectionTab(main_app: gui.GUI)[source]¶
Bases:
FrameA tab for selecting structures and creating structure groups.
- Variables:
parent – The
tkinter.ttk.Notebookin which theStructureSelectionTabresides.app – The running
gui.GUIinstance.panel – The contained
StructureSelectionPanel.
Initialize a
StructureSelectionTab.- Parameters:
main_app – The running
gui.GUIinstance.
autojob.coordinator.gui.study_configuration module¶
This module defines the GUI logic for study configuration.
Specifically, the module provides the StudyConfigurationTab which is
the parent Frame for study configuration and the
StudyPanel, CalculationPanel, and CalculatorPanel
classes which permit selection of study, calculation, and calculator types,
respectively.
- class autojob.coordinator.gui.study_configuration.CalculationPanel(parent: Frame, columns: int)[source]¶
Bases:
RadiobuttonPanelA
RadiobuttonPanelfor selecting calculation type.Initialize a CalculationPanel.
- Parameters:
parent – The
tkinter.ttk.Framein which the CalculationPanel will reside.columns – The number of columns to use to display study types.
- class autojob.coordinator.gui.study_configuration.CalculatorPanel(parent: Frame, columns: int)[source]¶
Bases:
RadiobuttonPanelA
RadiobuttonPanelfor selecting calculator type.Initialize a CalculatorPanel.
- Parameters:
parent – The
tkinter.ttk.Framein which the CalculatorPanel will reside.columns – The number of columns to use to display study types.
- class autojob.coordinator.gui.study_configuration.StudyConfigurationTab(main_app: gui.GUI)[source]¶
Bases:
FrameA
tkinter.ttk.Framefrom configuring studies.- Variables:
parent – A ttk.Notebook in which the StudyConfigurationTab will reside.
app – The
GUIinstance for the GUI application.study_panel – The
RadiobuttonPanelfor selecting the study type to use for the study group.calculation_panel – The
RadiobuttonPanelfor selecting the calculation type to use for the study group.calculator_panel – The
RadiobuttonPanelfor selecting the calculator to use for the study group.
Initialize a StudyConfigurationTab.
- Parameters:
main_app – The
GUIinstance for the GUI application.
- class autojob.coordinator.gui.study_configuration.StudyPanel(parent: Frame, columns: int)[source]¶
Bases:
RadiobuttonPanelA
RadiobuttonPanelfor selecting study type.Initialize a StudyPanel.
- Parameters:
parent – The
tkinter.ttk.Framein which the StudyPanel will reside.columns – The number of columns to use to display study types.
autojob.coordinator.gui.submission_configuration module¶
GUI elements for the submission configuration panel.
Descriptions of exported classes:
GroupButtonFrame: a
ttk.Framesubclass containing a button which handles the logic of creating submission parameter groups.GroupSummary:
tkinter.TopLevelsubclass used to display a summary for a submission parameter group.SelectionPanel:
ttk.LabelFramesubclass used as base class for submission configuration panels (i.e.,StructureSelectionPanel,ValueSelectionPanel).SelectionFrame:
ttk.Framesubclass used to display values to be selected.SpecButton:
ttk.Buttonsubclass that adds selected values fromSelectionFrametoViewFrame.ViewFrame:
ttk.Framesubclass used to display selected values.ButtonFrame:
ttk.Framesubclass for adding and removing values fromViewFrame.ParameterSelectionCombobox:
ttk.Comboboxsubclass for adding specifications to submission parameter groups.StructureSelectionPanel:
SelectionPanelsubclass for selecting structures for submission parameter group.ValueSelectionPanel:
SelectionPanelsubclass for selecting parameter values for submission parameter group.AddToGroupFrame:
ttk.Framesubclass for adding new specifications to submission parameter groups.SubmissionConfigurationTab:
ttk.Framesubclass for configuring submission parameters.
- class autojob.coordinator.gui.submission_configuration.AddToGroupFrame(parent: Any)[source]¶
Bases:
FrameA container
ttk.Framefor adding the current spec to a SubmissionGroup.- Variables:
parent – The
SubmissionConfigurationTab.combo_box – The
ttk.Comboboxfor selecting the SubmissionGroup.button – The
ttk.Buttonused to add the current spec to the group.var – A
tkinter.StringVarreferencing the SubmissionGroup to which the spec will be added.
Initialize an
AddToGroupFrame.- Parameters:
parent – The
SubmissionConfigurationTab.
- add_specs_to_group() None[source]¶
Add current spec to SubmissionGroup or update existing group.
This method uses the current spec to find all CalculatorParameterGroup instances that satisfy the spec (structure and values of calculator parameters) and add them to the SubmissionGroup.
- create_add_group() tuple[Combobox, Button, StringVar][source]¶
Create the widgets for adding the current spec to a SubmissionGroup.
- Returns:
A 3-tuple (
combo_box,button,var).combo_boxis attk.Comboboxused to select the SubmissionGroup to which the spec will be added.buttonis thettk.Buttonused to add the current spec to aSubmissionGroup.varis thetkinter.StringVarreferencing theSubmissionGroupto which the current spec will be added.
- class autojob.coordinator.gui.submission_configuration.ButtonFrame(parent: SelectionPanel)[source]¶
Bases:
FrameA
ttk.Framecontainingttk.Buttons for editing specs.- Parameters:
parent – The
SelectionPanelcontaining theButtonFrame.listbox – The :class:
tkinter.Listboxcontaining the values for the spec. This isNoneif the parentSelectionFramehas awidgets.TreeviewFrame.treeview – The
ttk.Treeviewcontaining the values for the spec. This is No`ne if the parentSelectionFramehas awidgets.ListboxFrame.buttons – A list of
ttk.Buttons. The first element is the “remove” button. The second element is the “clear” button.
Initialize a ButtonFrame.
- Parameters:
parent – The
SelectionPanelcontaining theButtonFrame.
- class autojob.coordinator.gui.submission_configuration.GroupButtonFrame(parent: SubmissionConfigurationTab)[source]¶
Bases:
FrameA container frame for ttk.GroupButton s.
- Variables:
parent – The
SubmissionConfigurationTabin which the GroupButtonFrame resides.create_group_entry – The
ttk.Entrywidget used to enter the group name.create_group_button – The
ttk.Buttonwidget used to enter the group name.entry_var – The
tkinter.StringVarstoring the group name.del_group_cb – The
ttk.Comboboxused to select a group to delete.del_group_button – The
ttk.Buttonused to delete a group.cb_var – The
tkinter.StringVarreferencing the group to delete.view_group_button – The
ttk.Buttonused to view all submission groups that have been created.group_summary – A
GroupSummaryobject used to view the groups that have been created.
Initialize a
GroupButtonFrame.- Parameters:
parent – The
SubmissionConfigurationTabin which the``GroupButtonFrame`` resides.
- create_create_group() tuple[Entry, Button, StringVar][source]¶
Create the widgets for creating submission parameter groups.
- Returns:
A 3-tuple (
entry,button,var).entryis thettk.Entrywidget in which one specifies the name of a new submission parameter group.buttonis attk.Buttonused to finalize submission parameter group creation.varis thetkinter.StringVarassociated withentry.
- create_del_group() tuple[Combobox, Button, StringVar][source]¶
Creates a group of widgets for deleting submission parameter groups.
- Returns:
A 3-tuple (
combo_box,button,var).combo_boxis attk.Comboboxused to select a submission parameter group to delete.buttonis attk.Buttonthat when pressed, deletes a group.varis atkinter.StringVarcontaining the name of the selected group.
- create_group() None[source]¶
Create a submission parameter group.
The text in
GroupButtonFrame.create_group_entry()is coloured red if a submission parameter group with the same name already exists.
- create_view_group() tuple[Frame, Button][source]¶
Create a group of widgets for viewing submission parameter groups.
- Returns:
A tuple (
placeholder,button).placeholderis an emptyttk.Frameused for alignment.buttonis attk.Buttonused to view existing submission parameter groups.
- property submission_parameter_groups: dict[str, SubmissionParameterGroup]¶
A map from group names to submission parameter groups.
- class autojob.coordinator.gui.submission_configuration.GroupSummary(controller: GroupButtonFrame)[source]¶
Bases:
ToplevelView a summary of all created submission parameter groups.
- Variables:
controller – The
GroupButtonFrameresponsible for launching theGroupSummary.tbf – The
widgets.TreeviewFramecontaining the summary of all submission parameter groups.
Initialize a
GroupSummary.- Parameters:
controller – The
GroupButtonFrameresponsible for launchingthe `GroupSumma`ry`.
- class autojob.coordinator.gui.submission_configuration.SelectionFrame(parent: StructureSelectionPanel, select_from: str)[source]¶
Bases:
FrameCreate task filters.
- Variables:
parent – The
StructureSelectionPanelin which structures in the filter are selected.select_from – A string indicating from where the values within the frame are to be populated. If
"values", then the values are obtained from calculation parameter groups. If"structure", then the values are obtained from the structures.tbf – A
TreeviewFramecontaining the values ifSelectionFrame.select_from = "values", elseNone.lbf – A
ListboxFramecontaining the values ifSelectionFrame.select_from = "structure", elseNone.
Initialize a
SelectionFrame.- Parameters:
parent – The
StructureSelectionPanelin which structures inthe filter are selected.
select_from – A string indicating from where the values within the frame are to be populated. If
"values", then the values are obtained from calculation parameter groups. If"structure", then the values are obtained from the structures.
- property items: list[str] | dict[str, list[str]]¶
Displayed items (
SelectionFrame.lbforSelectionFrame.lbf).- Raises:
AttributeError – Invalid value of
SelectionFrame.select_from.- Returns:
A list of strings representing structure paths (if
SelectionFrame.select_from == "structures") or a dictionary mapping parameter names to their values (ifSelectionFrame.select_from == "values")
- class autojob.coordinator.gui.submission_configuration.SelectionPanel(parent: Any, text: str)[source]¶
Bases:
LabelframeSelect and view items.
- Variables:
parent – The
SubmissionConfigurationTabto which theSelectionPanelbelongs.selection_frame – A
SelectionFramefrom which users select items.view_frame – A
ViewFramedisplaying selected items.button_frame – A
ttk.Framewithttk.Buttons for item removing and clearing.spec_button – A
ttk.Buttoncontrolling spec addition.
Initialize a
SelectionPanel.- Parameters:
parent – The
SubmissionConfigurationTabto which the:class:`SelectionPanel` belongs.
text – The text used to indicate what is being selected.
- class autojob.coordinator.gui.submission_configuration.SpecButton(parent: SelectionPanel)[source]¶
Bases:
Buttonttk.Button that adds a spec.
- Parameters:
parent – The parent
SelectionPanel.src – The widget containing the source frame. This is either a
widgets.TreeviewFrame(ifSpecButton.parentis aValueSelectionPanel) or awidgets.ListboxFrame(ifSpecButton.parentis aStructureSelectionPanel).dest – The widget containing the destination frame. This is either a
widgets.TreeviewFrame(ifSpecButton.parentis aValueSelectionPanel) or awidgets.ListboxFrame(ifSpecButton.parentis aStructureSelectionPanel).
Initialize
SpecButton.- Parameters:
parent – The parent
SelectionPanel.
- add_children(top_level_item: str, children: list[str]) None[source]¶
Adds the contents of children items to a
ttk.Treeviewitem.- Parameters:
top_level_item – The iid of the item under which the children will be added.
children – A list of iids corresponding to items whose values are to be added under
top_level_item.
- class autojob.coordinator.gui.submission_configuration.StructureSelectionPanel(parent: SubmissionConfigurationTab)[source]¶
Bases:
SelectionPanelA
SelectionPanelfor creating specs by selecting structures.Initialize a
StructureSelectionPanel.- Parameters:
parent – The
SubmissionConfigurationTabto which the:class:`StructureSelectionPanel` belongs.
- class autojob.coordinator.gui.submission_configuration.SubmissionConfigurationTab(main_app: gui.GUI)[source]¶
Bases:
FrameA
ttk.Framefor configuring SubmissionGroups.- Variables:
parent – The
ttk.Notebookto which theSubmissionConfigurationTabbelongs.app – The
gui.GUIcontrolling the GUI.button_frame – The
GroupButtonFrameused to create, delete, and view SubmissionGroups.panels – A list of
SelectionPanels used to createGroupFilters.add_to_group_frame – A
AddToGroupFrameused to add aGroupFilterto a SubmissionGroup.
Initialize a
SubmissionConfigurationTab.- Parameters:
main_app – The
gui.GUIcontrolling the GUI.
- create_panels() list[SelectionPanel][source]¶
Returns a list containing structure and value selection panels.
- class autojob.coordinator.gui.submission_configuration.ValueSelectionPanel(parent)[source]¶
Bases:
SelectionPanelA
SelectionPanelfor creating specs by selecting values.Initialize a
ValueSelectionPanel.- Parameters:
parent – The
SubmissionConfigurationTabto which the:class:`ValueSelectionPanel` belongs.
- class autojob.coordinator.gui.submission_configuration.ViewFrame(parent: Any)[source]¶
Bases:
FrameA container
ttk.Framefor viewing the values defining the spec.- Variables:
parent – The
SelectionPanelin which theViewFrameresides.tbf – The
widgets.TreeviewFramecontaining the values defining the spec. This isNoneif parent is aStructureSelectionPanel.lbf – The
widgets.ListboxFramecontaining the values defining the spec. This is None ifparentis aValueSelectionPanel.
Initialize a
ViewFrame.- Parameters:
parent – The
SelectionPanelin which theViewFrameresides.
autojob.coordinator.gui.summary module¶
GUI elements for displaying study group summaries.
- class autojob.coordinator.gui.summary.CalculationSummaryFrame(parent: Frame, app: GUI)[source]¶
Bases:
SummaryFrameSummarize the calculation type.
Initialize a
CalculationSummaryFrame.- Parameters:
parent – The
SummaryTabin which theCalculationSummaryFrameresides.app – The running
gui.GUI.
- class autojob.coordinator.gui.summary.CalculatorSummaryFrame(parent: Frame, app: GUI)[source]¶
Bases:
SummaryFrameSummarize the calculator type.
Initialize a
CalculatorSummaryFrame.- Parameters:
parent – The
SummaryTabin which theCalculatorSummaryFrameresides.app – The running
gui.GUI.
- class autojob.coordinator.gui.summary.CreateJobsFrame(parent: SummaryTab)[source]¶
Bases:
LabelframeFrame containing job creation button and compute canada format prompt.
- Variables:
parent – The
SummaryTabin which the frame resides.var – An
tkinter.IntVarindicating whether the user has opted for the jobs to be created in compute canada format.checkb – A
Checkbuttonto select the job format.button – A
Buttonto initiate job creation.
Initialize a
CreateJobsFrame.- Parameters:
parent – The
SummaryTabin which the frame resides.
- class autojob.coordinator.gui.summary.JobSummaryFrame(parent: SummaryTab)[source]¶
Bases:
LabelframeSummarize the jobs to be created.
- Variables:
parent – The
SummaryTabin which theJobSummaryFrameresides.tbf – A
widgets.TreeviewFramedescribing the to-be-created jobs.jobs – A dictionary mapping structures to calculation and submission parameter dictionaries. Each nested dictionary maps parameters to lists of values.
Initialize a
JobSummaryFrame.- Parameters:
parent – The
SummaryTabin which theJobSummaryFrameresides.
- add_calc_params(calc_params: dict[CalculationParameter, str], job_iid: str) None[source]¶
Add the calculation parameter values to the
Treeview.
- class autojob.coordinator.gui.summary.StudySummaryFrame(parent: Frame, app: GUI)[source]¶
Bases:
SummaryFrameSummarize the study type.
Initialize a
StudySummaryFrame.- Parameters:
parent – The
SummaryTabin which theStudySummaryFrameresides.app – The running
gui.GUI.
- class autojob.coordinator.gui.summary.SummaryFrame(parent: SummaryTab, app: GUI, title: str)[source]¶
Bases:
LabelframeA
Framesummarizing to-be-created jobs.- Variables:
parent – The
SummaryTabin which theSummaryFrameresides.study_configuration_tab – The
StudyConfigurationTab.label – The
tkinter.ttk.LabelforFrame.
Initialize a
SummaryFrame.- Parameters:
parent – The
SummaryTabin which theSummaryFrameresides.app – The running
gui.GUI.title – The title for the
SummaryFrame.
- class autojob.coordinator.gui.summary.SummaryFrames[source]¶
Bases:
TypedDictThe subframes of a
SummaryTab.- calculation_summary: CalculationSummaryFrame¶
- calculator_summary: CalculatorSummaryFrame¶
- completion: CreateJobsFrame¶
- job_summary: JobSummaryFrame¶
- study_summary: StudySummaryFrame¶
- warnings: WarningsFrame¶
- class autojob.coordinator.gui.summary.SummaryTab(main_app: GUI)[source]¶
Bases:
FrameA GUI element summarizing study group parameters.
- Variables:
parent – The
tkinter.ttk.Notebookin which theSummaryTabresides.app – The running
gui.GUIcontainer – The container frame for placing subframes.
summaries – A
SummaryFramestyped dictionary containing the subframes of theSummaryTab.
Initialize a
SummaryTab.- Parameters:
main_app – The running
gui.GUI.
- create() SummaryFrames[source]¶
Creates the subframes of the
SummaryTab.
- class autojob.coordinator.gui.summary.WarningsFrame(parent: SummaryTab)[source]¶
Bases:
LabelframeView automatically generated warnings.
- Variables:
warnings – A list of
tkinter.ttk.Labels containing warnings.
Initialize a
WarningsFrame.- Parameters:
parent – The
SummaryTabin which theJobSummaryFrameresides.
autojob.coordinator.gui.widgets module¶
This module defines various specialized ttk.Frame s for convenience.
The RadiobuttonPanel class defines a :class`.ttk.LabelFrame`
containing ttk.Radiobutton s.
The ListboxFrame class defines a ttk.Frame containing a
tkinter.Listbox.
The TreeviewFrame class defines a ttk.Frame containing a
ttk.Treeview.
- class autojob.coordinator.gui.widgets.ListboxFrame(parent: Frame, *, x_stretch: bool = False)[source]¶
Bases:
FrameA
ttk.Framepreconfigured with atkinter.Listbox.- Variables:
parent – The
ttk.Framein which theListboxFramewill reside.x_stretch – Whether or not the
ListboxFramewill expand horizontally to fill the frame.listbox – The
tkinter.Listboxwithin theListboxFrame.yscroll – The
tkinter.ttk.Scrollbarcontrolling y-scrolling.xscroll – The
tkinter.ttk.Scrollbarcontrolling x-scrolling.
Initialize a
ListboxFrame.- Parameters:
parent – The
ttk.Framein which theListboxFramewill reside.x_stretch – Whether or not the
ListboxFramewill expand horizontally to fill the frame.. Defaults to False.
- class autojob.coordinator.gui.widgets.RadiobuttonPanel(parent: Frame, title: str, implementable_enum: ImplementableEnum, columns: int)[source]¶
Bases:
LabelframeA
LabelFramecontainingRadiobuttons.This GUI element is designed to allow for the selection of a Radiobutton corresponding to an ImplementableEnum.
- Variables:
parent – The
Framein which theRadiobuttonPanelresides.frame – The
Framein which the ttk.Radiobutton s will reside.implementable_enum – An
ImplementableEnum.columns – The number of columns used to display to selection options.
rb_var – A
tkinter.IntVarrecording the selectedRadiobutton.rbs – A dictionary mappping
ImplementableEnums to their representativeRadiobuttons.
Initialize a
RadiobuttonPanel.- Parameters:
parent – The
Framein which theRadiobuttonPanelresides.title – The title for the
RadiobuttonPanel.implementable_enum – The
classification.ImplementableEnumthat will be enumerated by theRadiobuttons.columns – The number of columns to be used to display the
Radiobuttons.
- creation() dict[ImplementableEnum, Radiobutton][source]¶
Create
ttk.Radiobuttons for eachImplementableEnum.- Returns:
A dictionary mappping
ImplementableEnums to their representativeRadiobuttons.
- class autojob.coordinator.gui.widgets.TreeviewFrame(parent: Frame)[source]¶
Bases:
FrameA
ttk.Framepreconfigured with attk.Treeview.- Variables:
parent – The
ttk.Framein which theTreeviewFramewill reside.treeview – The
tkinter.ttk.Treeviewwithin theTreeviewFrame.yscroll – The
tkinter.ttk.Scrollbarcontrolling y-scrolling.xscroll – The
tkinter.ttk.Scrollbarcontrolling x-scrolling.
Initialize a
ListboxFrame.- Parameters:
parent – The
ttk.Framein which theListboxFramewill reside.