Skip to content

Commit 1a8cf0c

Browse files
jeremymanningclaude
andcommitted
Fix simulate_list bug: use correct group range 1-16
The wordpool groups are numbered 1-16, not 0-15. Using range(16) would select group 0 which doesn't exist, causing sample() to fail. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9dfc8f6 commit 1a8cf0c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

quail/simulate.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ def simulate_list(nwords=16, nrec=10, ncats=4):
1010
path = os.path.join(os.path.dirname(__file__), 'data/cut_wordpool.csv')
1111
wp = pd.read_csv(path)
1212

13-
# get one list
14-
# logic seems to pick a group random
15-
wp = wp[wp['GROUP']==np.random.choice(list(range(16)), 1)[0]].sample(16)
13+
# get one list - pick a random group (groups are 1-16)
14+
wp = wp[wp['GROUP']==np.random.choice(list(range(1, 17)), 1)[0]].sample(16)
1615

1716
wp['COLOR'] = [[int(np.random.rand() * 255) for i in range(3)] for i in range(16)]
1817

0 commit comments

Comments
 (0)