pyworkflow.protocol.params module
- class pyworkflow.protocol.params.BooleanParam(display=1, **args)[source]
Bases:
Param
Param to store boolean values. By default it will be displayed as 2 radio buttons with Yes/no labels. Alternatively, if you pass checkbox it will be displayed as a checkbox.
- Parameters
display – (Optional) default DISPLAY_YES_NO. (Yes /no) Alternatively use BooleanParam.DISPLAY_CHECKBOX to use checkboxes
- DISPLAY_CHECKBOX = 2
- DISPLAY_YES_NO = 1
- class pyworkflow.protocol.params.Conditional(error, allowsNull=False)[source]
Bases:
Validator
Simple validation based on a condition. If the value doesn’t meet the condition, the error will be returned.
- class pyworkflow.protocol.params.DeprecatedParam(newParamName, prot)[source]
Bases:
object
Deprecated param. To be used when you want to rename an existing param and still be able to recover old param value. It acts like a redirector, passing the value received when its value is set to the new renamed parameter
usage: In defineParams method, before the renamed param definition line add the following:
self.oldName = DeprecatedParam(“newName”, self) form.addParam(‘newName’, …)
- Parameters
newParamName – Name of the renamed param
prot – Protocol hosting this and the renamed param
- class pyworkflow.protocol.params.DigFreqParam(**args)[source]
Bases:
FloatParam
Digital frequency param.
- class pyworkflow.protocol.params.ElementGroup(form=None, **args)[source]
Bases:
FormElement
Class to group some params in the form. Such as: Labeled group or params in the same line.
- class pyworkflow.protocol.params.EnumParam(**args)[source]
Bases:
IntParam
Select from a list of values, separated by comma
- DISPLAY_COMBO = 1
- DISPLAY_HLIST = 2
- DISPLAY_LIST = 0
- class pyworkflow.protocol.params.Form(protocol)[source]
Bases:
object
Store all sections and parameters
Build a Form from a given protocol.
- addParallelSection(threads=1, mpi=8, condition='', hours=72, jobsize=0)[source]
- Adds the parallelization section to the form
pass threads=0 to disable threads parameter and mpi=0 to disable mpi params
- Parameters
threads – default value for of threads, defaults to 1
mpi – default value for mpi, defaults to 8
- class pyworkflow.protocol.params.FormElement(**args)[source]
Bases:
Object
Base for any element on the form
- ATTRIBUTES = ['label', 'expertLevel', 'condition', 'important', 'help', 'default', 'paramClass']
- class pyworkflow.protocol.params.Format(valueType, error='Value have not a correct format', allowsNull=False)[source]
Bases:
Conditional
Check if the format is right.
- class pyworkflow.protocol.params.GE(thresold, error='Value should be greater or equal than the threshold')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.GT(threshold, error='Value should be greater than the threshold')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.Group(form=None, **args)[source]
Bases:
ElementGroup
Group some parameters with a labeled frame.
- class pyworkflow.protocol.params.HiddenBooleanParam(**args)[source]
Bases:
BooleanParam
- class pyworkflow.protocol.params.LE(threshold, error='Value should be less or equal than the threshold')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.LT(threshold, error='Value should be less than the threshold')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.LabelParam(**args)[source]
Bases:
StringParam
Just the same as StringParam, but to be rendered as a label and can not be directly edited by the user in the Protocol Form.
- class pyworkflow.protocol.params.Line(form=None, **args)[source]
Bases:
ElementGroup
Group to put some parameters in the same line.
- class pyworkflow.protocol.params.MultiPointerParam(**args)[source]
Bases:
PointerParam
This type of Param will serve to select objects with DIFFERENT types from the database to be input for some protocol.
- class pyworkflow.protocol.params.NonEmptyBoolCondition(error='Boolean param needs to be set.')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.NonEmptyCondition(error='Value cannot be empty')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.NumericListParam(**args)[source]
Bases:
StringParam
This class will serve to have list representations as strings. Possible notation are: 1000 10 1 1 -> to define a list with 4 values [1000, 10, 1, 1], or 10x2 5x3 -> to define a list with 5 values [10, 10, 5, 5, 5] If you ask for more elements than in the list, the last one is repeated
- class pyworkflow.protocol.params.NumericListValidator(error='Incorrect format for numeric list param')[source]
Bases:
Conditional
Validator for ListParam. See ListParam.
- class pyworkflow.protocol.params.NumericRangeParam(**args)[source]
Bases:
StringParam
This class will serve to specify range of numbers with a string representation. Possible notation are:
"1,5-8,10" -> [1,5,6,7,8,10] "2,6,9-11" -> [2,6,9,10,11] "2 5, 6-8" -> [2,5,6,7,8]
- class pyworkflow.protocol.params.NumericRangeValidator(error='Incorrect format for numeric range param')[source]
Bases:
Conditional
Validator for RangeParam. See RangeParam.
- class pyworkflow.protocol.params.Param(**args)[source]
Bases:
FormElement
Definition of a protocol parameter
- class pyworkflow.protocol.params.PathParam(**args)[source]
Bases:
StringParam
Param for path strings
- class pyworkflow.protocol.params.PointerParam(paramClass=<class 'pyworkflow.object.Pointer'>, **args)[source]
Bases:
Param
This type of Param will serve to select existing objects in the database that will be input for some protocol.
- class pyworkflow.protocol.params.ProtocolClassParam(**args)[source]
Bases:
StringParam
- class pyworkflow.protocol.params.Range(minValue, maxValue, error='Value is outside range')[source]
Bases:
Conditional
- class pyworkflow.protocol.params.RegexParam(**args)[source]
Bases:
StringParam
Regex based string param
- class pyworkflow.protocol.params.RelationParam(**args)[source]
Bases:
Param
This type of Param is very similar to PointerParam, since it will hold a pointer to another object. But, in the PointerParam, we search for objects of some Class (maybe with some conditions). Here, we search for objects related to a given attribute of a protocol by a given relation.
- class pyworkflow.protocol.params.Section(form, **args)[source]
Bases:
ElementGroup
Definition of a section to hold other params
- class pyworkflow.protocol.params.StringParam(**args)[source]
Bases:
Param
Param with underlying String value
- class pyworkflow.protocol.params.TextParam(**args)[source]
Bases:
StringParam
Long string params