Creating DQS jobs

../../_images/jobcreator.png

To run the GUI import the package and use its run method or invoke the mainloop of the app itself:

import lfd
lfd.gui.jobcreator.run()

# or optionally if one wants to potentially change default parameters
import lfd.gui.imagechecker as imgchkr
app = JobCreator()
app.mainloop()

JobCreator is a GUI interface to createjobs module. It provides an easier to manage graphical interace to the functionality contained in the createjobs module and has additional practical features such as in-place template editing.

class lfd.gui.jobcreator.rightframe.RightFrame(parent)[source]

RightFrame of the jobcreator gui. Contains the template from which jobs will be created. The template is not editable unless its state is changed by the eddittemplate function found in the leftbotframe module.

class lfd.gui.jobcreator.leftframe.LeftFrame(parent)[source]

LeftFrame of the jobcreator gui. Contains 3 subframes: top, mid and bot. In order they control the folowing settings for job creation:

  • Top - global execution settings for the jobs (f.e. wallclock, cputime, ppn…)
  • Mid - invocation settings (f.e. from all runs, lists, results…)
  • Bot - global environment settings (f.e. template, save paths, copy paths…)

Has to inherit from the root frame because job access is required. Will spawn additional windows promting user for settings for any particularily complex configurations.

getConf()[source]

Reads the complete configuration selected by the user.

class lfd.gui.jobcreator.lefttopframe.TopFrame(parent, row=0, col=0)[source]

Part of the LeftFrame of the GUI. Contains fields to select the: - number of jobs - queue type - wallclock limits - CPU time limits - processors per node limit (ppn) - command editor

Requires a parent Frame that has access to Job object so that the settings can propagate to it.

getcommand()[source]

Reads the curent command TextBox and reduces it to a form compatible with the createjobs module. Separating lines in the TextBox by using <Return> key is allowed.

getn()[source]

Reads the current value from the Entry for number of jobs and performs basic sanity checks. Will raise an error if the value in the box is unreadable or if the number of jobs is zero. Technically all these boxes should have verifiers but I can’t really be bothered and this one is the one that will likely get changed the most.

class lfd.gui.jobcreator.leftmidframe.MidFrame(parent, row=1, col=0)[source]

Part of the LeftFrame of the GUI. Contains the drop-down menu that selects the runs that will be processed. Currently the option to select from results database are a bit wonky.

Requires a parent Frame that has access to Job object so that the settings can propagate to it.

getResultsDBPath(parent, update)[source]

Opens a file dialog window that enables user to navigate through the filesystem to select their desired database of results.

Expects to receive the parent window of the binding object and a StringVar that is used to represent this path. It will update its value which triggers its trace method, which updates the class attribute used to store the path to the database.

readRes(parent)[source]

Callback that connects to the database given by the URI and path provided by the user and selects all existing Frames in that database. Selected frames are propagated to the runs attribute of the job object inherited from root. Expects to receive the parent window containing the binding object. The parent window is destroyed once all results are read in.

runFromSingle(parent, runs)[source]

Callback function for the case when a ‘Single’ run source is chosen.

Parameters:
  • - the parent window that contains the widget that registers this (parent) – callback. This window will be destroyed at the end of this func.
  • - an Entry or a Text widget from which the value will be read out (runs) – as.
runsFromList(parent, runs)[source]

Callback function to convert a coma separated string of runs into a list of integers. Propagates the list to the job object inherited from root. Expects to receive the parent window containing the binding object. The parent window is destroyed once the conversion is complete.

selectRuns(selection)[source]

Callback that will execute everytime the drop-down menu selection changes. For each of the option in the menu here we define an action that will triger the appropriate additional menus required to configure the job.

  • All - the runs are allowed to be undefined, createjobs package will read the runlistAll file in $PHOTO_REDUX env var location for runs
  • Single - a pop-up with an entry field is displayed where only 1 run id is permitted
  • List - a pop-up with a textbox is displayed where a list of runs is given as a comma separated string
  • Results - a pop-up window that lets user select the DB from which jobs will be created.
setResPath(*tmp)[source]

Callback ‘observer’ function used to track when the contents of an Entry changes. Specifically, tracks when the text value of an Entry used to select path to results database has changed. Updates the stored path to the results.

Expects the arguments corresponding to the invocation of trace method of a StringVar.

setUriPath(*tmp)[source]

Callback ‘observer’ function used to track when the contents of an Entry changes. Specifically, tracks when the text value of an Entry used to select URI path to results database has changed. Updates the stored URI path to the results.

Expects the arguments corresponding to the invocation of trace method of a StringVar.

class lfd.gui.jobcreator.leftbotframe.BotFrame(parent, row=2, col=0)[source]

Bottom part of the LeftFrame of the GUI. Handles all of the paths involved in the creation of a Job and updates the template in RightFrame when the template path changes.

editTemplate()[source]

A callback of a Button action that will change the state of the RightFrame Text box and make it editable.

saveTemplate()[source]

A Button callback that will save the current template to a file. Spawns a file dialog to retrieve the save location. Changes the state of the RightFrame Text box back to un-editable.

setSavePathWithPrompt()[source]

Callback that will spawn a directory selector through which a new path, where the job DQS files will be saved, can be selected.

setTemplatePath(*args)[source]

Callback that will track the Entry box of the template path and upon modification will cause the RightFrame template display to reload the new template.

setTemplatePathWithPrompt()[source]

Callback that will spawn a file selector window through which a new template can be selected. See setTemplatePath. Will cause an update of the RightFrame to redisplay the newly selected template.

updateTemplatePath(path, showerr=False)[source]

Updates the RightFrame’s template display and replaces the current content with content read from a file at the provided path. If showerr is supplied an error will be raised if the given path does not exist. This is useful if the directory will be created after the path selection or if the update is called from a callback tied to a StringVar/Entry trace methods as a way to silence errors untill the full path has been manually inputed.

Parameters:
  • path (str) – path to the new template
  • showerr (bool) – if False no error will be raised even if path does not exist, usefull when error needs to be raised later, on a callback initiated by a button click