Skip to content

Commit dfc6a17

Browse files
jeremymanningclaude
andcommitted
Add Whisper to requirements, update setup.py to read from requirements.txt
- Add openai-whisper to requirements.txt for speech decoding - Refactor setup.py to read install_requires from requirements.txt - Update clustering.py to return NaN (not 0.5) when insufficient data - Remove debug print statements from clustering.py - Remove benchmark_cluster.py (temporary file) - Add CLAUDE.md to .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ca4bbe3 commit dfc6a17

5 files changed

Lines changed: 12 additions & 53 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ dist/*
1212
venv/
1313
docs/_build
1414
docs/sg_execution_times.rst
15+
CLAUDE.md

benchmark_cluster.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

quail/analysis/clustering.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ def _get_weight_exact(egg, feature, distdict, permute, n_perms):
9696
rec = list(egg.get_rec_items().values[0])
9797

9898
if len(rec) <= 2:
99-
warnings.warn('Not enough recalls to compute fingerprint, returning default'
100-
'fingerprint.. (everything is .5)')
101-
return 0.5
99+
warnings.warn('Not enough recalls to compute fingerprint, returning NaN')
100+
return np.nan
102101

103102
distmat = get_distmat(egg, feature, distdict)
104103

@@ -174,14 +173,11 @@ def _get_weight_best(egg, feature, distdict, permute, n_perms, distance):
174173

175174
rec = list(egg.get_rec_items().values[0])
176175
if len(rec) <= 2:
177-
warnings.warn('Not enough recalls to compute fingerprint, returning default'
178-
'fingerprint.. (everything is .5)')
176+
warnings.warn('Not enough recalls to compute fingerprint, returning NaN')
179177
return np.nan
180178

181179
distmat = get_distmat(egg, feature, distdict)
182180
matchmat = get_match(egg, feature, distdict)
183-
print(f"DEBUG: matchmat.shape={matchmat.shape}, len(rec)={len(rec)}")
184-
print(f"DEBUG: distmat.shape={distmat.shape}")
185181

186182
ranks = []
187183
for i in range(len(rec)-1):

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ matplotlib>=3.5.0
44
seaborn>=0.12.0
55
pandas>=2.0.0
66
joblib>=1.3.0
7+
openai-whisper

setup.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3+
import os
34
from setuptools import setup, find_packages
45

56
DESCRIPTION = 'A python toolbox for analyzing and plotting free recall data'
@@ -12,11 +13,15 @@
1213
- Clustering metrics (e.g. single-number summaries of how often participants transition from recalling a word to another related word, where "related" can be user-defined.)
1314
- Many nice plotting functions
1415
- Convenience functions for loading in data
15-
- Automatically parse speech data (audio files) using wrappers for the Google Cloud Speech to Text API
16+
- Automatically parse speech data (audio files) using OpenAI Whisper
1617
1718
The intended user of this toolbox is a memory researcher who seeks an easy way to analyze and visualize data from free recall psychology experiments.
1819
"""
1920

21+
# Read requirements from requirements.txt
22+
here = os.path.abspath(os.path.dirname(__file__))
23+
with open(os.path.join(here, 'requirements.txt')) as f:
24+
requirements = [line.strip() for line in f if line.strip() and not line.startswith('#')]
2025

2126
EXTRAS_REQUIRE={
2227
'speech-decoding': ["pydub", "openai-whisper"],
@@ -35,13 +40,6 @@
3540
license='MIT',
3641
packages=find_packages(exclude=('tests', 'docs', 'paper')),
3742
include_package_data=True,
38-
install_requires=[
39-
'numpy>=2.0.0',
40-
'scipy>=1.10.0',
41-
'matplotlib>=3.5.0',
42-
'seaborn>=0.12.0',
43-
'pandas>=2.0.0',
44-
'joblib>=1.3.0',
45-
],
43+
install_requires=requirements,
4644
extras_require=EXTRAS_REQUIRE,
4745
)

0 commit comments

Comments
 (0)