madgui.widget.params module

Parameter input dialog.

Classes

ParamInfo(name, value[, expr, inform, …])

Row info for the TableView [internal].

ParamTable(fetch[, store, units, model, …])

Input controls to show and edit key-value pairs.

CommandEdit(fetch[, store, units, model, …])

TableView based editor window for MAD-X commands.

GlobalsEdit(model, **kwargs)

MatrixTable(fetch, shape, get_name, **kwargs)

TabParamTables([tabs])

TabWidget that manages multiple ParamTables inside.

Functions

model_params_dialog(model[, parent, folder])

Create a dialog to edit parameters of a given Model.

class madgui.widget.params.CommandEdit(fetch, store=None, units=True, model=None, data_key=None, **kwargs)[source]

Bases: madgui.widget.params.ParamTable

TableView based editor window for MAD-X commands. Used for viewing/editing elements.

In addition to the ParamTables features, this class is capable of indicating which parameters were explicitly specified by the user and showing the expression!

Methods

get_comp_unit(par, i)

get_knob_row(i, p)

get_param_row(i, p)

get_vector_row(parent, i, p)

set_comp_value(par, i, _, value)

set_par_value(i, par, value)

vec_rows(par)

get_comp_unit(par, i)[source]
get_knob_row(i, p)[source]
get_param_row(i, p)[source]
get_vector_row(parent, i, p)[source]
set_comp_value(par, i, _, value)[source]
set_par_value(i, par, value)[source]
vec_rows(par)[source]
class madgui.widget.params.GlobalsEdit(model, **kwargs)[source]

Bases: madgui.widget.params.ParamTable

Attributes

exportFilters

list() -> new empty list

Methods

get_param_row(i, p)

exportFilters = [('Strength file', '*.str'), ('YAML file', '*.yml', '*.yaml')]
get_param_row(i, p)[source]
class madgui.widget.params.MatrixTable(fetch, shape, get_name, **kwargs)[source]

Bases: madgui.widget.params.ParamTable

Methods

fetch_params(**fetch_args)

get_param_row(i, row)

Attributes

sections

fetch_params(**fetch_args)[source]
get_param_row(i, row)[source]
property sections
class madgui.widget.params.ParamInfo(name, value, expr=None, inform=0, mutable=True, dtype=None, var_type=1)[source]

Bases: object

Row info for the TableView [internal].

class madgui.widget.params.ParamTable(fetch, store=None, units=True, model=None, data_key=None, **kwargs)[source]

Bases: madgui.widget.tableview.TreeView

Input controls to show and edit key-value pairs.

The parameters are displayed in 3 columns: name / value / unit.

Methods

curRow()

exportTo(filename)

Export parameters to YAML file.

fetch_params(**fetch_args)

get_param_row(i, p)

importFrom(filename)

Import data from JSON/YAML file.

keyPressEvent(event)

<Enter>: open editor; <Delete>/<Backspace>: remove value.

par_rows(par)

setRowValue(row, value)

Set the value of the parameter in the specified row.

set_value(i, par, value)

update(**kw)

Update dialog from the datastore.

Attributes

exportFilters

list() -> new empty list

exporter

importFilters

list() -> new empty list

sections

curRow()[source]
exportFilters = [('YAML file', '*.yml', '*.yaml')]
exportTo(filename)[source]

Export parameters to YAML file.

property exporter
fetch_params(**fetch_args)[source]
get_param_row(i, p)[source]
importFilters = [('YAML file', '*.yml', '*.yaml'), ('JSON file', '*.json')]
importFrom(filename)[source]

Import data from JSON/YAML file.

keyPressEvent(event)[source]

<Enter>: open editor; <Delete>/<Backspace>: remove value.

par_rows(par)[source]
property sections
setRowValue(row, value)[source]

Set the value of the parameter in the specified row.

set_value(i, par, value)[source]
update(**kw)[source]

Update dialog from the datastore.

class madgui.widget.params.TabParamTables(tabs=())[source]

Bases: PyQt5.QtWidgets.QTabWidget

TabWidget that manages multiple ParamTables inside.

Attributes

exporter

Methods

update(self)

update(self, QRect)

property exporter
update(self)[source]

update(self, QRect) update(self, QRegion) update(self, int, int, int, int)

madgui.widget.params.model_params_dialog(model, parent=None, folder='.')[source]

Create a dialog to edit parameters of a given Model.