Skip to content

Commit d27c870

Browse files
authored
Merge pull request #1504 from AllenNeuralDynamics/production_testing
[update main] 2025-04-15
2 parents 94823a7 + 9b9cab1 commit d27c870

28 files changed

+18050
-7653
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ notebooks
1919
.spyproject
2020
.venv/
2121
build/
22+
.vscode/

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ A [Bonsai](https://bonsai-rx.org/) workflow for lick-based foraging experiments,
5656
- [Harp Sound Card](https://github.com/harp-tech/device.soundcard)
5757
- [Harp Audio Amplifier](https://github.com/harp-tech/peripheral.audioamp)
5858
- [Harp Synchronizer](https://github.com/harp-tech/device.synchronizer)
59-
59+
6060
## Deployment
6161

6262
#### For initial installation:
63-
- Follow instructions [here](https://github.com/AllenNeuralDynamics/aind-behavior-blog/wiki/Computer-Configuration)
63+
- Follow instructions [here](https://github.com/AllenNeuralDynamics/aind-behavior-blog/wiki/Computer-Configuration)
6464

6565
#### To launch the software:
6666
- Run `foraging.bonsai` in `dynamic-foraging-task\src\workflows` to start Bonsai.
6767
- Activate the `conda` environment created above
6868
- Run `python dynamic-foraging-task\src\foraging_gui\Foraging.py` to start the GUI.
69-
- The GUI will leave a log file at `~\Documents\foraging_gui_logs\` named by the tower and date/time.
69+
- The GUI will leave a log file at `~\Documents\foraging_gui_logs\` named by the tower and date/time.
7070

7171
#### Automatic Updates
7272
To configure automatic updates consistent with the [update protocol](https://github.com/AllenNeuralDynamics/aind-behavior-blog/wiki/Software-Update-Procedures),please use TaskScheduler to automatically run three batch files at specified times of the week ([instructions](https://github.com/AllenNeuralDynamics/aind-behavior-blog/wiki/Configure-Automatic-Updates))
@@ -87,7 +87,7 @@ To configure automatic updates consistent with the [update protocol](https://git
8787
### Menu
8888

8989
#### File
90-
- **New**: Clear the training parameters
90+
- **New**: Clear the training parameters
9191
- **Open**: Open an existing session and visualization
9292
- **Save**: Save the current session as a JSON file (or optionally a .mat file)
9393
- **Exit**: Close the GUI
@@ -99,7 +99,7 @@ To configure automatic updates consistent with the [update protocol](https://git
9999
- **Snipping**: Open the snipping tools
100100
- **Simulation**: When one of the simulation methods is selected, it will run the simulation when the **Start** button is pressed.
101101
- **Win-stay lose-switch**: Foragers employ a win-stay-lose-switch strategy.
102-
- **Random**: Foragers randomly select a choice.
102+
- **Random**: Foragers randomly select a choice.
103103
#### Visualization
104104
- **Lick distribution**: Open the lick analysis dialogue to display lick-related statistics.
105105
- **Time distribution**: Display the simulated distribution of block length/ITI time/Delay time.
@@ -118,7 +118,7 @@ To configure automatic updates consistent with the [update protocol](https://git
118118
- **Open behavior folder**: Open the folder to save the current behavior JSON file
119119
#### Settings
120120
- **Open setting folder**: Open the default settings folder. It is in `Documents\ForagingSettings` by default. There are different JSON files to save different default parameters.
121-
- **ForagingSettings.json**: General settings.
121+
- **ForagingSettings.json**: General settings.
122122
- **default_saveFolder**: The default save location. The folder structure is `default_saveFolder\Rig\Animal\Animal_year-month-day_hour-minute-second\`. There are five additional folders: `EphysFolder`, `HarpFolder`, `PhotometryFolder`, `TrainingFolder`, and `VideoFolder` for saving different data sources. Default location: `Documents`
123123
- **current_box**: To define the rig name.
124124
- **show_log_info_in_console**: If exists and equals `True`, a copy of log info is sent to the console.
@@ -148,9 +148,9 @@ To configure automatic updates consistent with the [update protocol](https://git
148148
- **Task**: There are currently five tasks supported (**Coupled Baiting**;**Uncoupled Baiting**;**Coupled Without Baiting**;**Uncoupled Without Baiting**;**RewardN**).
149149
- **Tower**: The current tower (can be set by **current_box** in **ForagingSettings.json**).
150150
- **Auto Train**: Click the button to open the [Automatic Training](#automatic-training) dialog, see below
151-
151+
152152
#### Trial-related parameters
153-
- **training stage**: Select the training stage parameters. These parameters can be saved in **TrainingStagePar.json** through "**Save training**" button. They are task dependent.
153+
- **training stage**: Select the training stage parameters. These parameters can be saved in **TrainingStagePar.json** through "**Save training**" button. They are task dependent.
154154
- **randomness**: There are **exponential** and **even distribution** available. This random generator will be applied to generate **Block length**/**ITI**/**Delay period**.
155155
- **L(s)**: The left valve open time. The **L(s)** and **L(ul)** are dependent on each other, and the relationship is determined by the water calibration.
156156
- **L(ul)**: The estimated water volume given by the left valve under the **L(s)**.
@@ -185,9 +185,9 @@ To configure automatic updates consistent with the [update protocol](https://git
185185
- **stop ignores>**: The session will stop if the number of ignored trials surpasses the limit.
186186
- **max trial**: The session will stop if the number of trials surpasses the limit.
187187
- **max time (min)**: The session will stop if the running time of the session surpasses the limit.
188-
- **auto (Advanced block)**: The block change will also be dependent on the choice of the animal when it is turned on. It's allowed to go to the next block only when there are consecutive points (**points in a row**) that cross the threshold (**switch thr**).
189-
- **switch thr**: The block switch threshold (only active after the auto is turned on).
190-
- **points in a row**: Consecutive points that cross the threshold (only active after the auto is turned on).
188+
- **auto (Advanced block)**: The block change will also be dependent on the choice of the animal when it is turned on. It's allowed to go to the next block only when there are consecutive points (**points in a row**) that cross the threshold (**switch thr**).
189+
- **switch thr**: The block switch threshold (only active after the auto is turned on).
190+
- **points in a row**: Consecutive points that cross the threshold (only active after the auto is turned on).
191191
- **Next block**: It will jump to the next block when it is clicked.
192192
#### Weight and water
193193
- **Weight before (g)**: Enter the mouse weight before starting training.
@@ -200,7 +200,7 @@ To configure automatic updates consistent with the [update protocol](https://git
200200
- **Current right block**: current trial number of the current right block/length of current right block.
201201
- **Responded trial**: number of responded trial/number of total trial. A trial is regarded as a responded trial if the animal licks one of the lick sprouts within the response time (**RT**).
202202
- **Reward trial**: number of reward trials/number of total trial.
203-
- **Total Reward**: Estimated total reward (excluding the manually given reward).
203+
- **Total Reward**: Estimated total reward (excluding the manually given reward).
204204
- **Left choice rewarded**:
205205
- **Right choice rewarded**:
206206
- **Early licking**: Statistics of early licking rate in different behavior epochs.
@@ -212,7 +212,7 @@ To configure automatic updates consistent with the [update protocol](https://git
212212
> If the dialog fails to open, check AWS credentials at `~/.aws/credentials`. See [instructions](#for-initial-installation)
213213
214214
2. For the first session of a new mouse:
215-
1. ~~So far, the automatic training system cannot handle our previous Stage 1.1 --> Stage 1.2.<br>~~
215+
1. ~~So far, the automatic training system cannot handle our previous Stage 1.1 --> Stage 1.2.<br>~~
216216
2. Confirm that this is a new mouse in the automatic training system<br>
217217
<img src="https://github.com/AllenNeuralDynamics/dynamic-foraging-task/assets/24734299/684d4aac-f9a9-4ce7-9536-61aace828c76" width="400"><br>
218218
3. In "Curriculum Manager", select a desired curriculum for the new mouse. Double-check `curriculum_name`, `curriculum_version`, and `curriculum_schema_version`.<br>
@@ -239,7 +239,7 @@ To configure automatic updates consistent with the [update protocol](https://git
239239
6. ~~Note that you can still modify some items in `Training parameters`, such as `Valve open time`, `Give left/right`, and `Next block`.~~
240240
7. You could now close the Auto Training dialog.
241241
8. Start the training as usual.
242-
242+
243243
5. Override parameters (not recommended)
244244
1. Once `Apply and lock` is pressed, you can press it again to unlock the parameters and override any of them. But in this case, the automatic training mode is disengaged, and this session is considered "off-curriculum". <br>
245245
![image](https://github.com/AllenNeuralDynamics/dynamic-foraging-task/assets/24734299/08b7997c-bdce-421b-8c90-3a7e4dfc5ba7)
@@ -286,7 +286,7 @@ Data for each session is saved as a JSON file with the following files:
286286
- **goCue_start_time**: 'The go cue start time'
287287
- **reward_outcome_time**: 'The reward outcome time (reward/no reward/no response)'
288288

289-
### Training paramters
289+
### Training paramters
290290
Here is an overview of the trial structure using a rewarded trial, an unrewarded trial, and an ignored trial as examples.
291291
![image](https://github.com/AllenNeuralDynamics/dynamic-foraging-task/assets/24734299/2530ff82-8b78-4feb-af03-410dcdcbfcc6)
292292

@@ -340,7 +340,7 @@ Here is an overview of the trial structure using a rewarded trial, an unrewarded
340340
- **B_RightRewardDeliveryTime**:'The reward delivery time of the right lick spout'
341341
- **B_LeftLickTime**:'The time of left licks'
342342
- **B_RightLickTime**:'The time of left licks'
343-
343+
344344
## Developer Instructions
345345
The user interface of the GUI was designed based on Qt-designer (introduction available [here](https://realpython.com/qt-designer-python/)).
346346

0 commit comments

Comments
 (0)