Skip to content

Commit 610ad62

Browse files
committed
update pages
1 parent 3de3ce8 commit 610ad62

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

docs/tutorials/task_settings.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@
22

33
## Overview
44

5-
The `TaskSettings` class provides a centralized way to manage experiment configuration, including paths, timing parameters, window settings, and more. It helps standardize experiment setup and ensures consistent configuration across different parts of your experiment.
5+
The `TaskSettings` class provides a centralized way to manage experiment configuration, including collected subject information, data paths, timing parameters, window settings, and more. It helps standardize experiment setup and ensures consistent configuration across different parts of the experiment.
6+
7+
Under the hood, `TaskSettings` is used throughout your code wherever you need to read or write experiment parameters. For example:
8+
- In `run_trial.py`, to retrieve the duration of a specific stimulus
9+
- During block creation in `main.py`, to determine the number of blocks and trials and to seed the randomization of conditions
610

7-
`TaskSettings` solves several common challenges in experiment configuration:
811

9-
- **Centralization**: Maintain all experiment parameters in one place
10-
- **Standardization**: Create consistent configuration across experiments
11-
- **Path management**: Automatically generate file paths based on subject information
12-
- **Seed control**: Manage random seeds for reproducible experiments
13-
- **Integration**: Connect with other psyflow components seamlessly
1412

1513
## Key Features
1614

17-
| Feature | Description |
18-
|---------|-------------|
19-
| Dictionary initialization | Create settings from Python dictionaries or YAML files |
20-
| Subject integration | Incorporate subject information for personalized paths |
21-
| Path generation | Automatically create data and resource paths |
22-
| Seed management | Control random seeds for reproducible experiments |
23-
| Attribute access | Access settings using dot notation for cleaner code |
24-
| Default values | Provide sensible defaults for common parameters |
15+
| Feature | Description |
16+
|------------------------|--------------------------------------------------------------------------------------|
17+
| Dictionary initialization | Create settings from Python dictionaries or YAML files |
18+
| Subject integration | Incorporate collected subject info for per-subject seeds, file names, and paths |
19+
| Path & directory generation | Automatically create output directories and construct timestamped log/CSV/JSON paths |
20+
| Seed management | Flexible seeding strategies (`same_across_sub` or `same_within_sub`) with auto-generated per-block seeds |
21+
| Dynamic extension | Load extra, unknown config keys via `from_dict()` |
22+
| JSON export | Save the full `TaskSettings` to JSON (`save_to_json()`) for archiving or analysis |
23+
| Human-readable repr | Clean `__repr__()` for easy inspection or logging of all current settings |
24+
| Default values | Sensible built-in defaults for window, timing, blocks/trials, keys, etc. |
25+
2526

2627
## Quick Reference
2728

@@ -37,7 +38,7 @@ The `TaskSettings` class provides a centralized way to manage experiment configu
3738
### 1. Creating TaskSettings
3839

3940
#### Option A: From a Dictionary
40-
41+
在实际使用时,我们使用load_config方法从配置文件中加载配置,从而获得相关的设置
4142
```python
4243
from psyflow import TaskSettings
4344

@@ -89,7 +90,7 @@ settings = TaskSettings.from_dict(config)
8990
```
9091

9192
### 2. Adding Subject Information
92-
93+
被试信息是必须的,这涉及被试specific的配置,比如被试ID,被试的性别,被试的出生年份等等。这将用于生成相关的存储文件的名称,包括json, log和csv文件的信息
9394
Integrating subject information allows `TaskSettings` to create subject-specific paths and seeds:
9495

9596
```python

0 commit comments

Comments
 (0)