Skip to content

Commit 0292bb9

Browse files
committed
add documentation for task generator
1 parent c2d1ca5 commit 0292bb9

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

docs/task_setup.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,59 @@ exp.push_conditions(conditions)
3636
exp.start()
3737
```
3838

39+
## Using of Task Templates in Ethopy
40+
41+
### Overview
42+
The `ethopy-create-task` command generates a Python template file for an Ethopy experiment. This template includes default parameters and placeholders that you need to customize for your specific experiment.
43+
44+
### Generating a Template
45+
To create a task template, run the following command in your terminal:
46+
47+
```bash
48+
ethopy-create-task
49+
```
50+
51+
You will be prompted to enter the module paths and class names for the experiment, behavior, and stimuli components. The generated file will include all required parameters with placeholders (`...`) that need to be filled.
52+
53+
#### Template Generation Process
54+
The script follows these steps:
55+
56+
1. **Prompt for Module Paths and Class Names**
57+
- Enter the paths relative to `ethopy` for:
58+
- Experiment module (e.g., `experiments.match_port`)
59+
- Behavior module (e.g., `behaviors.multi_port`)
60+
- Stimulus module (e.g., `stimuli.grating`)
61+
- Enter corresponding class names for each module.
62+
63+
2. **Validate Imports**
64+
- The script attempts to import the specified modules and classes.
65+
- If an import fails, an error message is displayed.
66+
67+
3. **Extract Default Parameters**
68+
- The script retrieves the parameters from the experiment, behavior, and stimulus classes.
69+
70+
4. **Generate a Template File**
71+
- A Python file is created with structured sections:
72+
- **Session Parameters**: General experiment settings
73+
- **Experiment Setup**: Instantiating the experiment
74+
- **Trial Conditions**: Configuration for experiments, behaviors, and stimuli
75+
- **Condition Merging**: Combining all conditions for trial generation
76+
- **Execution**: Running the experiment
77+
78+
5. **Save the File**
79+
- The template is saved with a default filename (`task_<stimulus>_<date>.py`) or a user-specified name.
80+
81+
## Next Steps
82+
After generating the template:
83+
84+
1. **Open the generated file** in a text editor.
85+
2. **Fill in missing parameters** where indicated by `...`
86+
3. **Customize trial conditions** to match your experiment's requirements.
87+
4. **Run the script** to execute the experiment.
88+
89+
By following these steps, you can quickly set up an Ethopy experiment with minimal manual configuration.
90+
91+
3992
## Creating Tasks
4093

4194
### 1. Session Parameters

0 commit comments

Comments
 (0)