gui#

perceptivo.types.gui.GUI_PARAM_KEY#

Possible keys for GUI parameters.

  • frequencies - a tuple of frequencies to test

  • amplitudes - a tuple of amplitudes to test

  • log_x - boolean indicating whether an x-axis should be log scaled (True) or linearly scaled

  • log_y - boolean indicating whether a y-axis should be log scaled (True) or linearly scaled

  • extra_amplitude - boolean indicating whether an additional, suprathreshold amplitude should be tested as a confirmation

  • amplitude_step - Step size of amplitudes to test in dB

alias of Literal[‘frequencies’, ‘amplitudes’, ‘log_x’, ‘log_y’, ‘extra_amplitude’, ‘amplitude_step’, ‘amplitude_range’, ‘max_amplitude’, ‘frequency_step’, ‘frequency_range’, ‘iti’, ‘iti_jitter’]

perceptivo.types.gui.GUI_WIDGET_TYPE#

Widget types that correspond to particular Qt Widgets

  • int, float - PySide.QtWidgets.QSpinBox and PySide.QtWidgets.QDoubleSpinBox

  • range - widgets.components.Range_Setter

  • tuple - PySide.QtWidgets.QLineEdit evaluated by ast.literal_eval

  • bool - PySide.QtWidgets.QCheckBox

alias of Literal[‘int’, ‘float’, ‘range’, ‘tuple’, ‘bool’]

pydantic model perceptivo.types.gui.GUI_Control#

Bases: perceptivo.types.root.PerceptivoType

Container for GUI_Params in transit

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Show JSON schema
{
   "title": "GUI_Control",
   "description": "Container for GUI_Params in transit",
   "type": "object",
   "properties": {
      "key": {
         "title": "Key",
         "enum": [
            "frequencies",
            "amplitudes",
            "log_x",
            "log_y",
            "extra_amplitude",
            "amplitude_step",
            "amplitude_range",
            "max_amplitude",
            "frequency_step",
            "frequency_range",
            "iti",
            "iti_jitter"
         ],
         "type": "string"
      },
      "value": {
         "title": "Value",
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "number"
            },
            {
               "type": "array",
               "items": {}
            }
         ]
      }
   },
   "required": [
      "key",
      "value"
   ]
}

Config
  • json_encoders: dict = {<class ‘numpy.ndarray’>: <function pack_array at 0x7f07dd6cfdc0>, <class ‘datetime.datetime’>: <function PerceptivoType.Config.<lambda> at 0x7f07dd6c91f0>}

  • underscore_attrs_are_private: bool = True

Fields
field key: Literal['frequencies', 'amplitudes', 'log_x', 'log_y', 'extra_amplitude', 'amplitude_step', 'amplitude_range', 'max_amplitude', 'frequency_step', 'frequency_range', 'iti', 'iti_jitter'] [Required]#
field value: Union[str, float, tuple] [Required]#
pydantic model perceptivo.types.gui.GUI_Range#

Bases: perceptivo.types.root.PerceptivoType

Range for widgets.components.Range_Setter

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Show JSON schema
{
   "title": "GUI_Range",
   "description": "Range for :class:`.widgets.components.Range_Setter`",
   "type": "object",
   "properties": {
      "min": {
         "title": "Min",
         "type": "number"
      },
      "max": {
         "title": "Max",
         "type": "number"
      },
      "n": {
         "title": "N",
         "type": "integer"
      }
   },
   "required": [
      "min",
      "max",
      "n"
   ]
}

Config
  • json_encoders: dict = {<class ‘numpy.ndarray’>: <function pack_array at 0x7f07dd6cfdc0>, <class ‘datetime.datetime’>: <function PerceptivoType.Config.<lambda> at 0x7f07dd6c91f0>}

  • underscore_attrs_are_private: bool = True

Fields
field min: float [Required]#
field max: float [Required]#
field n: int [Required]#
pydantic model perceptivo.types.gui.GUI_Param#

Bases: perceptivo.types.root.PerceptivoType

Parameterization for a GUI Parameter itself. ie. How a particular parameter should be represented.

Params:

key (GUI_PARAMS): the key used for the parameter name (str): A human readable name for the parameter widget_type (GUI_WIDGETS): A string that indicates the type of widget that should be used.

Different widget_type s may use different widgets, combinations of widgets, and validators, and are thus not strictly isomorphic to a single widget type.

default (any): the default value to be set, must correspond to widget type args (list): args to pass to the widget kwargs (dict): kwargs to pass to the widget

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Show JSON schema
{
   "title": "GUI_Param",
   "description": "Parameterization for a GUI Parameter itself. ie. How a particular parameter should be represented.\n\nParams:\n    key (GUI_PARAMS): the key used for the parameter\n    name (str): A human readable name for the parameter\n    widget_type (GUI_WIDGETS): A string that indicates the type of widget that should be used.\n        Different ``widget_type`` s may use different widgets, combinations of widgets, and\n        validators, and are thus not strictly isomorphic to a single widget type.\n    default (any): the default value to be set, must correspond to widget type\n    args (list): args to pass to the widget\n    kwargs (dict): kwargs to pass to the widget",
   "type": "object",
   "properties": {
      "key": {
         "title": "Key",
         "enum": [
            "frequencies",
            "amplitudes",
            "log_x",
            "log_y",
            "extra_amplitude",
            "amplitude_step",
            "amplitude_range",
            "max_amplitude",
            "frequency_step",
            "frequency_range",
            "iti",
            "iti_jitter"
         ],
         "type": "string"
      },
      "name": {
         "title": "Name",
         "type": "string"
      },
      "widget_type": {
         "title": "Widget Type",
         "enum": [
            "int",
            "float",
            "range",
            "tuple",
            "bool"
         ],
         "type": "string"
      },
      "default": {
         "title": "Default",
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "integer"
            },
            {
               "$ref": "#/definitions/GUI_Range"
            },
            {
               "type": "array",
               "items": {}
            }
         ]
      },
      "args": {
         "title": "Args",
         "type": "array",
         "items": {}
      },
      "kwargs": {
         "title": "Kwargs",
         "type": "object"
      }
   },
   "required": [
      "key",
      "name",
      "widget_type"
   ],
   "definitions": {
      "GUI_Range": {
         "title": "GUI_Range",
         "description": "Range for :class:`.widgets.components.Range_Setter`",
         "type": "object",
         "properties": {
            "min": {
               "title": "Min",
               "type": "number"
            },
            "max": {
               "title": "Max",
               "type": "number"
            },
            "n": {
               "title": "N",
               "type": "integer"
            }
         },
         "required": [
            "min",
            "max",
            "n"
         ]
      }
   }
}

Config
  • json_encoders: dict = {<class ‘numpy.ndarray’>: <function pack_array at 0x7f07dd6cfdc0>, <class ‘datetime.datetime’>: <function PerceptivoType.Config.<lambda> at 0x7f07dd6c91f0>}

  • underscore_attrs_are_private: bool = True

Fields
field key: Literal['frequencies', 'amplitudes', 'log_x', 'log_y', 'extra_amplitude', 'amplitude_step', 'amplitude_range', 'max_amplitude', 'frequency_step', 'frequency_range', 'iti', 'iti_jitter'] [Required]#
field name: str [Required]#
field widget_type: Literal['int', 'float', 'range', 'tuple', 'bool'] [Required]#
field default: Optional[Union[float, int, perceptivo.types.gui.GUI_Range, tuple]] = None#
field args: list [Optional]#
field kwargs: dict [Optional]#
pydantic model perceptivo.types.gui.Control_Panel_Params#

Bases: perceptivo.types.root.PerceptivoType

Defaults and parameters for perceptivo.gui.widgets.Control_Panel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Show JSON schema
{
   "title": "Control_Panel_Params",
   "description": "Defaults and parameters for :class:`perceptivo.gui.widgets.Control_Panel`",
   "type": "object",
   "properties": {
      "amplitude_range": {
         "title": "Amplitude Range",
         "default": {
            "key": "amplitude_range",
            "name": "Amplitude Range (dBSPL)",
            "widget_type": "range",
            "default": {
               "min": 0.0,
               "max": 80.0,
               "n": 8
            },
            "args": [],
            "kwargs": {
               "limits": [
                  0,
                  100
               ]
            }
         },
         "allOf": [
            {
               "$ref": "#/definitions/GUI_Param"
            }
         ]
      },
      "frequency_range": {
         "title": "Frequency Range",
         "default": {
            "key": "frequency_range",
            "name": "Frequency Range (Hz)",
            "widget_type": "range",
            "default": {
               "min": 0.0,
               "max": 8000.0,
               "n": 17
            },
            "args": [],
            "kwargs": {
               "limits": [
                  0,
                  20000
               ]
            }
         },
         "allOf": [
            {
               "$ref": "#/definitions/GUI_Param"
            }
         ]
      },
      "iti": {
         "title": "Iti",
         "default": {
            "key": "iti",
            "name": "Inter-Trial Interval (s)",
            "widget_type": "float",
            "default": 5.0,
            "args": [],
            "kwargs": {}
         },
         "allOf": [
            {
               "$ref": "#/definitions/GUI_Param"
            }
         ]
      },
      "iti_jitter": {
         "title": "Iti Jitter",
         "default": {
            "key": "iti_jitter",
            "name": "Inter-Trial Jitter (proportion of ITI)",
            "widget_type": "float",
            "default": 0.1,
            "args": [],
            "kwargs": {}
         },
         "allOf": [
            {
               "$ref": "#/definitions/GUI_Param"
            }
         ]
      }
   },
   "definitions": {
      "GUI_Range": {
         "title": "GUI_Range",
         "description": "Range for :class:`.widgets.components.Range_Setter`",
         "type": "object",
         "properties": {
            "min": {
               "title": "Min",
               "type": "number"
            },
            "max": {
               "title": "Max",
               "type": "number"
            },
            "n": {
               "title": "N",
               "type": "integer"
            }
         },
         "required": [
            "min",
            "max",
            "n"
         ]
      },
      "GUI_Param": {
         "title": "GUI_Param",
         "description": "Parameterization for a GUI Parameter itself. ie. How a particular parameter should be represented.\n\nParams:\n    key (GUI_PARAMS): the key used for the parameter\n    name (str): A human readable name for the parameter\n    widget_type (GUI_WIDGETS): A string that indicates the type of widget that should be used.\n        Different ``widget_type`` s may use different widgets, combinations of widgets, and\n        validators, and are thus not strictly isomorphic to a single widget type.\n    default (any): the default value to be set, must correspond to widget type\n    args (list): args to pass to the widget\n    kwargs (dict): kwargs to pass to the widget",
         "type": "object",
         "properties": {
            "key": {
               "title": "Key",
               "enum": [
                  "frequencies",
                  "amplitudes",
                  "log_x",
                  "log_y",
                  "extra_amplitude",
                  "amplitude_step",
                  "amplitude_range",
                  "max_amplitude",
                  "frequency_step",
                  "frequency_range",
                  "iti",
                  "iti_jitter"
               ],
               "type": "string"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "widget_type": {
               "title": "Widget Type",
               "enum": [
                  "int",
                  "float",
                  "range",
                  "tuple",
                  "bool"
               ],
               "type": "string"
            },
            "default": {
               "title": "Default",
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "$ref": "#/definitions/GUI_Range"
                  },
                  {
                     "type": "array",
                     "items": {}
                  }
               ]
            },
            "args": {
               "title": "Args",
               "type": "array",
               "items": {}
            },
            "kwargs": {
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "key",
            "name",
            "widget_type"
         ]
      }
   }
}

Config
  • json_encoders: dict = {<class ‘numpy.ndarray’>: <function pack_array at 0x7f07dd6cfdc0>, <class ‘datetime.datetime’>: <function PerceptivoType.Config.<lambda> at 0x7f07dd6c91f0>}

  • underscore_attrs_are_private: bool = True

Fields

pydantic model perceptivo.types.gui.GUI_Params#

Bases: perceptivo.types.root.PerceptivoType

Container for all parameters to be given to the GUI on init

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Show JSON schema
{
   "title": "GUI_Params",
   "description": "Container for all parameters to be given to the GUI on init",
   "type": "object",
   "properties": {
      "control_panel": {
         "title": "Control Panel",
         "default": {
            "amplitude_range": {
               "key": "amplitude_range",
               "name": "Amplitude Range (dBSPL)",
               "widget_type": "range",
               "default": {
                  "min": 0.0,
                  "max": 80.0,
                  "n": 8
               },
               "args": [],
               "kwargs": {
                  "limits": [
                     0,
                     100
                  ]
               }
            },
            "frequency_range": {
               "key": "frequency_range",
               "name": "Frequency Range (Hz)",
               "widget_type": "range",
               "default": {
                  "min": 0.0,
                  "max": 8000.0,
                  "n": 17
               },
               "args": [],
               "kwargs": {
                  "limits": [
                     0,
                     20000
                  ]
               }
            },
            "iti": {
               "key": "iti",
               "name": "Inter-Trial Interval (s)",
               "widget_type": "float",
               "default": 5.0,
               "args": [],
               "kwargs": {}
            },
            "iti_jitter": {
               "key": "iti_jitter",
               "name": "Inter-Trial Jitter (proportion of ITI)",
               "widget_type": "float",
               "default": 0.1,
               "args": [],
               "kwargs": {}
            }
         },
         "allOf": [
            {
               "$ref": "#/definitions/Control_Panel_Params"
            }
         ]
      }
   },
   "definitions": {
      "GUI_Range": {
         "title": "GUI_Range",
         "description": "Range for :class:`.widgets.components.Range_Setter`",
         "type": "object",
         "properties": {
            "min": {
               "title": "Min",
               "type": "number"
            },
            "max": {
               "title": "Max",
               "type": "number"
            },
            "n": {
               "title": "N",
               "type": "integer"
            }
         },
         "required": [
            "min",
            "max",
            "n"
         ]
      },
      "GUI_Param": {
         "title": "GUI_Param",
         "description": "Parameterization for a GUI Parameter itself. ie. How a particular parameter should be represented.\n\nParams:\n    key (GUI_PARAMS): the key used for the parameter\n    name (str): A human readable name for the parameter\n    widget_type (GUI_WIDGETS): A string that indicates the type of widget that should be used.\n        Different ``widget_type`` s may use different widgets, combinations of widgets, and\n        validators, and are thus not strictly isomorphic to a single widget type.\n    default (any): the default value to be set, must correspond to widget type\n    args (list): args to pass to the widget\n    kwargs (dict): kwargs to pass to the widget",
         "type": "object",
         "properties": {
            "key": {
               "title": "Key",
               "enum": [
                  "frequencies",
                  "amplitudes",
                  "log_x",
                  "log_y",
                  "extra_amplitude",
                  "amplitude_step",
                  "amplitude_range",
                  "max_amplitude",
                  "frequency_step",
                  "frequency_range",
                  "iti",
                  "iti_jitter"
               ],
               "type": "string"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "widget_type": {
               "title": "Widget Type",
               "enum": [
                  "int",
                  "float",
                  "range",
                  "tuple",
                  "bool"
               ],
               "type": "string"
            },
            "default": {
               "title": "Default",
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "integer"
                  },
                  {
                     "$ref": "#/definitions/GUI_Range"
                  },
                  {
                     "type": "array",
                     "items": {}
                  }
               ]
            },
            "args": {
               "title": "Args",
               "type": "array",
               "items": {}
            },
            "kwargs": {
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "key",
            "name",
            "widget_type"
         ]
      },
      "Control_Panel_Params": {
         "title": "Control_Panel_Params",
         "description": "Defaults and parameters for :class:`perceptivo.gui.widgets.Control_Panel`",
         "type": "object",
         "properties": {
            "amplitude_range": {
               "title": "Amplitude Range",
               "default": {
                  "key": "amplitude_range",
                  "name": "Amplitude Range (dBSPL)",
                  "widget_type": "range",
                  "default": {
                     "min": 0.0,
                     "max": 80.0,
                     "n": 8
                  },
                  "args": [],
                  "kwargs": {
                     "limits": [
                        0,
                        100
                     ]
                  }
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/GUI_Param"
                  }
               ]
            },
            "frequency_range": {
               "title": "Frequency Range",
               "default": {
                  "key": "frequency_range",
                  "name": "Frequency Range (Hz)",
                  "widget_type": "range",
                  "default": {
                     "min": 0.0,
                     "max": 8000.0,
                     "n": 17
                  },
                  "args": [],
                  "kwargs": {
                     "limits": [
                        0,
                        20000
                     ]
                  }
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/GUI_Param"
                  }
               ]
            },
            "iti": {
               "title": "Iti",
               "default": {
                  "key": "iti",
                  "name": "Inter-Trial Interval (s)",
                  "widget_type": "float",
                  "default": 5.0,
                  "args": [],
                  "kwargs": {}
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/GUI_Param"
                  }
               ]
            },
            "iti_jitter": {
               "title": "Iti Jitter",
               "default": {
                  "key": "iti_jitter",
                  "name": "Inter-Trial Jitter (proportion of ITI)",
                  "widget_type": "float",
                  "default": 0.1,
                  "args": [],
                  "kwargs": {}
               },
               "allOf": [
                  {
                     "$ref": "#/definitions/GUI_Param"
                  }
               ]
            }
         }
      }
   }
}

Config
  • json_encoders: dict = {<class ‘numpy.ndarray’>: <function pack_array at 0x7f07dd6cfdc0>, <class ‘datetime.datetime’>: <function PerceptivoType.Config.<lambda> at 0x7f07dd6c91f0>}

  • underscore_attrs_are_private: bool = True

Fields
field control_panel: perceptivo.types.gui.Control_Panel_Params = Control_Panel_Params(amplitude_range=GUI_Param(key='amplitude_range', name='Amplitude Range (dBSPL)', widget_type='range', default=GUI_Range(min=0.0, max=80.0, n=8), args=[], kwargs={'limits': (0, 100)}), frequency_range=GUI_Param(key='frequency_range', name='Frequency Range (Hz)', widget_type='range', default=GUI_Range(min=0.0, max=8000.0, n=17), args=[], kwargs={'limits': (0, 20000)}), iti=GUI_Param(key='iti', name='Inter-Trial Interval (s)', widget_type='float', default=5.0, args=[], kwargs={}), iti_jitter=GUI_Param(key='iti_jitter', name='Inter-Trial Jitter (proportion of ITI)', widget_type='float', default=0.1, args=[], kwargs={}))#