Skip to content

Commit

Permalink
Added some purchase links and did some cleanup (#21)
Browse files Browse the repository at this point in the history
* Added links to purchase peripherals and fixed broken link to breakout_1_2 hardware definition

* fixed typos and formatting

* removed hardware variable header that snuck into last commit
  • Loading branch information
alustig3 committed Jun 19, 2023
1 parent 9e9d83e commit 5fe4f77
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 116 deletions.
4 changes: 2 additions & 2 deletions docs/index.md
Expand Up @@ -12,15 +12,15 @@ pyControl makes it easy to program complex behavioural tasks using a clean, intu

![Hardware overview](media/hardware/hardware-overview.png)

pyControl [hardware](user-guide/hardware.md) consists of a breakout board and a set of devices such as nose-pokes, audio boards, LED drivers, rotary encoders and stepper motor controllers that are connected to the breakout board to create behavioural setups. Assembled pyControl hardware is available from the [OpenEphys store](http://www.open-ephys.org/pycontrol) and [Labmaker](https://www.labmaker.org/collections/neuroscience/products/pycontrol-mouse-behaviour-box_set_no1).
pyControl [hardware](user-guide/hardware.md) consists of a breakout board and a set of devices such as nose-pokes, audio boards, LED drivers, rotary encoders and stepper motor controllers that are connected to the breakout board to create behavioural setups. Assembled pyControl hardware is available from the [Open Ephys store](http://www.open-ephys.org/pycontrol) and [LabMaker](https://www.labmaker.org/collections/neuroscience/products/pycontrol-mouse-behaviour-box_set_no1).

pyControl has a [Graphical User Interface](user-guide/graphical-user-interface.md) for controlling experiments and visualing behaviour.

Tools for importing pyControl data into Python for analysis are provided in the [data_import](user-guide/pycontrol-data.md) module.

pyControl hardware, software and documentation repositories are hosted on [GitHub](https://github.com/pyControl), with a [discussion board](https://github.com/orgs/pyControl/discussions) for user discussions and support.

The pyControl [manuscript](https://elifesciences.org/articles/67846) gives a high level overview of the system design and it's rationale and has validation experiments and example use cases. If you use pyControl in a publication, please cite it.
The pyControl [manuscript](https://elifesciences.org/articles/67846) gives a high level overview of the system design and its rationale and has validation experiments and example use cases. If you use pyControl in a publication, please cite it.

If you do fiber photometry experiments, you may be interested in pyControl's sister project [pyPhotometry](https://pyphotometry.readthedocs.io).

Expand Down
13 changes: 6 additions & 7 deletions docs/user-guide/graphical-user-interface.md
Expand Up @@ -14,11 +14,11 @@ The **Setup** control box is used to select a pyboard, connect and disconnect fr

The **Data file** control box is used to select the directory where data files will be stored and to specify the ID of the subject. The filename is given by the subject ID and session start date and time.

The **Task** control box is used to select and upload a task and configure task variables. The tasks available in the drop down menu are those in the folder *pyControl/tasks*. The tasks folder can be changed using the *Settings* menu. The *upload* button transfers the task file to the pyboard and sets up the task state machine. Once a task is uploaded the button changes to *reset*. Resetting the task returns it to its initial state as defined in the task definition file.
The **Task** control box is used to select and upload a task and configure task variables. The tasks available in the drop-down menu are those in the folder *pyControl/tasks*. The tasks folder can be changed using the *Settings* menu. The *upload* button transfers the task file to the pyboard and sets up the task state machine. Once a task is uploaded the button changes to *reset*. Resetting the task returns it to its initial state as defined in the task definition file.
!!! tip "Task subfolders"
Tasks can be organised into subfolders within the *tasks* folder, creating a nested list in the GUI drop down menu. This can be useful if you have a lot of tasks, e.g. to organise them by user.

The *Variables* button opens a dialog for setting or getting the value of task variables. It can be used either before a run starts or while a task is running. Variables must be defined in the task definition file using the `v.my_variable` syntax (see [programming tasks](programming-tasks.md#variables)). Variables can be set to numbers, or to Python objects including strings, lists and dictionaries. The constants `ms`, `second`, `minute` and `hour` can be used, e.g. a variable can be set to `30*minute`. You can make task variables invisible to the GUI by ending their name in three underscores (e.g. `v.my_private_variable___`). Such 'private' variables work as normal in the task file but do not show up in the GUI. This can be useful if you have a lot of task variables, making it hard to find the ones you need to change in the GUI.
The *Variables* button opens a dialog for setting or getting the value of task variables. It can be used either before a run starts or while a task is running. Variables must be defined in the task definition file using the `v.my_variable` syntax (see [programming tasks](programming-tasks.md#variables)). Variables can be set to numbers, or to Python objects including strings, lists and dictionaries. The constants `ms`, `second`, `minute` and `hour` can be used, e.g. a variable can be set to `30*minute`. You can make task variables invisible to the GUI by ending their name in three underscores (e.g. `v.my_private_variable___`). Such 'private' variables work as normal in the task file but do not show up in the GUI. This can be useful if you have a lot of task variables, making it hard to find the ones you need to change in the GUI.

!!! tip "Variables dialog customization"
The variables dialog can be customized by adding a `v.custom_variables_dialog` variable to your task file.
Expand All @@ -32,7 +32,6 @@ The *Variables* button opens a dialog for setting or getting the value of task v

![custom variable dialog](../media/GUI/custom_variable_dialog.png)


## Experiments tab

The experiments tab is used to configure, save, load and run experiments on one or more hardware setups at the same time. An experiment is a set of subjects, each with a corresponding hardware setup, run on the same task, with variables optionally set to non-default values for some or all subjects. When you run an experiment you can run all subjects, or select only a subset to run, and can start and stop different subjects at different times.
Expand All @@ -49,11 +48,11 @@ The *Subjects* table is used to specify which subjects will run in which hardwar

The *Variables* table is used to set the value of variables before the task starts. Variables can be set to the same value for all subjects or to different values for different subjects. Variables can be set to numbers, or Python objects including strings, lists and dictionaries. The constants `ms`, `second`, `minute` and `hour` can be used, e.g. a variable can be set to `5*second`.

A variable can be set as persistent by ticking the *persistent* check-box. If a variable is persistent it's value is saved at the end of the session. The next time the experiment is run, if the variable is still set as persistent, its value will be set to the previously stored value. Persistent variables are saved as a [JSON](https://www.json.org/) object in a file *persistent_variables.json* in the experiments data folder. JSON is a human-readable format so the stored values can be inspected and edited using a text editor.
A variable can be set as persistent by ticking the *persistent* checkbox. If a variable is persistent it's value is saved at the end of the session. The next time the experiment is run, if the variable is still set as persistent, its value will be set to the previously stored value. Persistent variables are saved as a [JSON](https://www.json.org/) object in a file *persistent_variables.json* in the experiments data folder. JSON is a human-readable format so the stored values can be inspected and edited using a text editor.

Summary variables can be specified by ticking the *summary* check-box. The values of summary variables are displayed for each subject at the end of the session and copied to the clipboard in a format that can be pasted directly into spreadsheets or text editors. The values of each subject's summary variables at the end of the session are also written to that subjects data file.

The *save* button saves the current experiment configuration. Saved experiments can be loaded by selecting them with the drop down menu. Saved experiments can be deleted with the delete button. Each experiment is saved as a separate file in the folder *pyControl/experiments*. Experiment configurations are saved as JSON objects in text files with a *.pcx* file extension.
The *save* button saves the current experiment configuration. Saved experiments can be loaded by selecting them with the drop-down menu. Saved experiments can be deleted with the delete button. Each experiment is saved as a separate file in the folder *pyControl/experiments*. Experiment configurations are saved as JSON objects in text files with a *.pcx* file extension.

### Running experiments

Expand Down Expand Up @@ -86,10 +85,10 @@ The configure button next to each setup bring up a menu of configuration options
The board configuration menu has the following options to configure pyboards.

- *Load framework:* Reload the pyControl framework onto the board. If you are using a hardware definition you will need to reload it after loading the framework.
- *Load hardware definition:* Load a [hardware definition](hardware.md#hardware-definition) file onto the pyboard. The selected file is renamed *hardware_definition.py* on the pyboard filesystem irrespective of it's name on the computer, so the hardware definition is always imported into the task file with:
- *Load hardware definition:* Load a [hardware definition](hardware.md#hardware-definition) file onto the pyboard. The selected file is renamed *hardware_definition.py* on the pyboard filesystem irrespective of its name on the computer, so the hardware definition is always imported into the task file with:

```python
import hardware_definition as hw
```
- *Device Firmware Update (DFU) mode:* Put the pyboard into DFU mode used for upgrading the version of MicroPython running on the board. For more information on upgrading MicroPython see [here](http://micropython.org/download).
- *Enable/disable USB flash drive:* Disabling the USB flash drive prevents the pyboard from showing up on the computer's filesystem as a USB storage device. This can be useful if you are connecting a large number of pyboards to a computer and run out of space on the USB bus. With the flashdrive enabled each pyboard shows up as two USB devices - a flash drive and a USB serial port.
- *Enable/disable USB flash drive:* Disabling the USB flash drive prevents the pyboard from showing up on the computer's filesystem as a USB storage device. This can be useful if you are connecting a large number of pyboards to a computer and run out of space on the USB bus. With the flashdrive enabled each pyboard shows up as two USB devices - a flash drive and a USB serial port.

0 comments on commit 5fe4f77

Please sign in to comment.