Skip to content

Commit 24a6ff7

Browse files
authored
Merge pull request #17 from TaskBeacon/codex/update-tutorial-with-add_condition-usage
Fix BlockUnit docs examples
2 parents 574c6d5 + 64a3993 commit 24a6ff7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/tutorials/build_blocks.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ The `BlockUnit` class is a powerful tool for organizing trials in psychological
2929
|---------|--------|--------|
3030
| Initialize block | `BlockUnit(block_id, block_idx, ...)` | `block = BlockUnit("block1", 0, settings)` |
3131
| Generate conditions | `.generate_conditions(func, labels)` | `block.generate_conditions(generate_func, ["A", "B"])` |
32-
| Add trials manually | `.add_trials(trial_list)` | `block.add_trials(["A", "B", "A"])` |
32+
| Add conditions manually | `.add_condition(condition_list)` | `block.add_condition(["A", "B", "A"])` |
3333
| Register start hook | `.on_start(func)` | `@block.on_start()` or `block.on_start(func)` |
3434
| Register end hook | `.on_end(func)` | `@block.on_end()` or `block.on_end(func)` |
3535
| Run all trials | `.run_trial(trial_func, **kwargs)` | `block.run_trial(run_trial_function)` |
3636
| Get results | `.to_dict()` | `results = block.to_dict()` |
3737
| Append results | `.to_dict(target_list)` | `block.to_dict(all_results)` |
3838
| Summarize results | `.summarize()` | `summary = block.summarize()` |
3939
| Custom summary | `.summarize(func)` | `summary = block.summarize(custom_func)` |
40-
| Get trial count | `len(block)` | `num_trials = len(block)` |
4140
| Log block info | `.logging_block_info()` | `block.logging_block_info()` |
4241

4342
## Detailed Usage Guide
@@ -97,7 +96,7 @@ This populates `block.trials` with a balanced, randomized sequence of conditions
9796
For full control, you can manually specify the trial sequence:
9897

9998
```python
100-
block.add_trials(["congruent", "incongruent", "neutral", "congruent", "incongruent"])
99+
block.add_condition(["congruent", "incongruent", "neutral", "congruent", "incongruent"])
101100
```
102101

103102
### 3. Registering Block Lifecycle Hooks

0 commit comments

Comments
 (0)