Inspecting Tables and Peak maps

emzed.gui.inspectPeakMap(*a, **kw)[source]

DEPRECATED! PLEASE USE inspect INSTEAD!

emzed.gui.inspect(obj, *a, **kw)[source]

For more information about using these Explorers see Exploring Peak Maps and Tables.

Simple Dialogs

emzed.gui.askForDirectory(startAt=None, caption='Choose Folder')[source]

asks for a single directory.

you can provide a startup directory with parameter startAt.

returns the path to the selected directory as a string, or None if the user aborts the dialog.

emzed.gui.askForSave(startAt=None, extensions=None, caption='Save As')[source]

asks for a single file, which needs not to exist.

you can provide a startup directory with parameter startAt. you can restrict the files by providing a list of extensions. eg:

askForSave(extensions=["csv"])

or:

askForSave(extensions=["mzXML", "mxData"])

returns the path of the selected file as a string, or None if the user aborts the dialog.

emzed.gui.askForSingleFile(startAt=None, extensions=None, caption='Open File')[source]

asks for a single file.

you can provide a startup directory with parameter startAt. you can restrict the files to select by providing a list of extensions. eg:

askForSingleFile(extensions=["csv"])

or:

askForSingleFile(extensions=["mzXML", "mxData"])

returns the path of the selected file as a string, or None if the user aborts the dialog.

emzed.gui.askForMultipleFiles(startAt=None, extensions=None, caption='Open Files')[source]

asks for a single or multiple files.

you can provide a startup directory with parameter startAt. you can restrict the files to select by providing a list of extensions. eg:

askForSingleFile(extensions=["csv"])

or:

askForSingleFile(extensions=["mzXML", "mxData"])

returns the paths of the selected files as a list of strings, or None if the user aborts the dialog.

emzed.gui.showWarning(message, title='Warning')[source]

shows a warning dialog with given message

emzed.gui.showInformation(message, title='Information')[source]

shows a information dialog with given message

DialogBuilder

For an example see Quering METLIN web service

class emzed.gui.DialogBuilder(title='Dialog')[source]

addInt(...):

Construct an integer data item
  • label [string]: name
  • default [int]: default value (optional)
  • min [int]: minimum value (optional)
  • max [int]: maximum value (optional)
  • nonzero [bool]: if True, zero is not a valid value (optional)
  • unit [string]: physical unit (optional)
  • even [bool]: if True, even values are valid, if False, odd values are valid if None (default), ignored (optional)
  • slider [bool]: if True, shows a slider widget right after the line edit widget (default is False)
  • help [string]: text shown in tooltip (optional)

addText(...):

Construct a text data item (multiline string)
  • label [string]: name
  • default [string]: default value (optional)
  • help [string]: text shown in tooltip (optional)
  • notempty [bool]: if True, empty string is not a valid value (opt.)
  • wordwrap [bool]: toggle word wrapping (optional)

addNumericType(...):

Numeric data item

addChoice(...):
Construct a data item for a list of choices.
  • label [string]: name
  • choices [list, tuple or function]: string list or (key, label) list function of two arguments (item, value) returning a list of tuples (key, label, image) where image is an icon path, a QIcon instance or a function of one argument (key) returning a QIcon instance
  • default [-]: default label or default key (optional)
  • help [string]: text shown in tooltip (optional)

addColor(...):

Construct a color data item
  • label [string]: name
  • default [string]: default value (optional)
  • help [string]: text shown in tooltip (optional)

Color values are encoded as hexadecimal strings or Qt color names

addFloatArray(...):
Construct a float array data item
  • label [string]: name
  • default [numpy.ndarray]: default value (optional)
  • help [string]: text shown in tooltip (optional)
  • format [string]: formatting string (example: ‘%.3f’) (optional)
  • transpose [bool]: transpose matrix (display only)
  • large [bool]: view all float of the array
  • minmax [string]: “all” (default), “columns”, “rows”

addFileOpen(...):

Construct a path data item for a file to be opened
  • label [string]: name
  • formats [string (or string list)]: wildcard filter
  • default [string]: default value (optional)
  • basedir [string]: default base directory (optional)
  • help [string]: text shown in tooltip (optional)

addDate(...):

Construct a date data item.
  • text [string]: form’s field name (optional)
  • label [string]: name
  • default [datetime.date]: default value (optional)
  • help [string]: text shown in tooltip (optional)

addFontFamily(...):

Construct a font family name item
  • label [string]: name
  • default [string]: default value (optional)
  • help [string]: text shown in tooltip (optional)

addDateTime(...):

addData(...):

DataSet data item

label : string default : any type, optional help : string Text displayed on data item’s tooltip

addDirectory(...):
Construct a path data item for a directory.
  • label [string]: name
  • default [string]: default value (optional)
  • help [string]: text shown in tooltip (optional)

addBool(...):

Construct a boolean data item
  • text [string]: form’s field name (optional)
  • label [string]: name
  • default [string]: default value (optional)
  • help [string]: text shown in tooltip (optional)

addDict(...):

Construct a dictionary data item
  • label [string]: name
  • default [dict]: default value (optional)
  • help [string]: text shown in tooltip (optional)

addFloat(...):

Construct a float data item
  • label [string]: name
  • default [float]: default value (optional)
  • min [float]: minimum value (optional)
  • max [float]: maximum value (optional)
  • slider [bool]: if True, shows a slider widget right after the line edit widget (default is False)
  • step [float]: step between tick values with a slider widget (optional)
  • nonzero [bool]: if True, zero is not a valid value (optional)
  • unit [string]: physical unit (optional)
  • help [string]: text shown in tooltip (optional)

addButton(...):

Construct a simple button that calls a method when hit
  • label [string]: text shown on the button

  • callback [function]: function with four parameters (dataset, item, value, parent)
    • dataset [DataSet]: instance of the parent dataset
    • item [DataItem]: instance of ButtonItem (i.e. self)
    • value [unspecified]: value of ButtonItem (default ButtonItem value or last value returned by the callback)
    • parent [QObject]: button’s parent widget
  • icon [QIcon or string]: icon show on the button (optional) (string: icon filename as in guidata/guiqwt image search paths)

  • default [unspecified]: default value passed to the callback (optional)

  • help [string]: text shown in button’s tooltip (optional)

The value of this item is unspecified but is passed to the callback along with the whole dataset. The value is assigned the callback`s return value.

addMultipleChoice(...):
Construct a data item for a list of choices – multiple choices can be selected
  • label [string]: name
  • choices [list or tuple]: string list or (key, label) list
  • default [-]: default label or default key (optional)
  • help [string]: text shown in tooltip (optional)

addFileSave(...):

Construct a path data item for a file to be saved
  • label [string]: name
  • formats [string (or string list)]: wildcard filter
  • default [string]: default value (optional)
  • basedir [string]: default base directory (optional)
  • help [string]: text shown in tooltip (optional)

addFilesOpen(...):

Construct a path data item for multiple files to be opened.
  • label [string]: name
  • formats [string (or string list)]: wildcard filter
  • default [string]: default value (optional)
  • basedir [string]: default base directory (optional)
  • help [string]: text shown in tooltip (optional)

addString(...):

Construct a string data item
  • label [string]: name
  • default [string]: default value (optional)
  • help [string]: text shown in tooltip (optional)
  • notempty [bool]: if True, empty string is not a valid value (opt.)
  • wordwrap [bool]: toggle word wrapping (optional)

addImageChoice(...):

Construct a data item for a list of choices with images
  • label [string]: name
  • choices [list, tuple or function]: (label, image) list or (key, label, image) list function of two arguments (item, value) returning a list of tuples (key, label, image) where image is an icon path, a QIcon instance or a function of one argument (key) returning a QIcon instance
  • default [-]: default label or default key (optional)
  • help [string]: text shown in tooltip (optional)