Skip to content

Commit 89179c9

Browse files
HAM41claude
andcommitted
Initial commit: GLM project for linking click data to decision variables
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
0 parents  commit 89179c9

14 files changed

Lines changed: 6490 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, '3.10']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
with:
27+
version: "latest"
28+
29+
- name: Install dependencies
30+
run: uv sync
31+
32+
- name: Run tests
33+
run: uv run pytest tests/ --cov=src --cov-report=xml
34+
35+
- name: Upload coverage to Codecov
36+
uses: codecov/codecov-action@v3
37+
with:
38+
file: ./coverage.xml
39+
flags: unittests

.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook checkpoints only (not the notebooks themselves)
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
# Data files
132+
data/raw/
133+
*.mat
134+
*.h5
135+
*.hdf5
136+
*.pkl
137+
*.pickle
138+
139+
# Results and outputs
140+
results/figures/*.png
141+
results/figures/*.jpg
142+
results/figures/*.pdf
143+
results/models/*.pkl
144+
results/models/*.joblib
145+
results/reports/*.html
146+
147+
# IDE files
148+
.vscode/
149+
.idea/
150+
*.swp
151+
*.swo
152+
*~
153+
154+
# macOS
155+
.DS_Store
156+
157+
# Temporary files
158+
*.tmp
159+
*.temp
160+
161+
# Large model files
162+
*.model
163+
*.weights

CLAUDE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ClickDV Project Context
2+
3+
## Project Overview
4+
GLM project linking Poisson click input data from rats to decision variable outputs. This is a computational neuroscience project for the Brody-Daw lab rotation.
5+
6+
## Research Goals
7+
- Extract decision variables from spike data (starting with session A324)
8+
- Access and analyze click times from behavioral data
9+
- Develop GLM to link click inputs to decision variables DV(t)
10+
- Investigate how GLM weights differ between sessions
11+
- Explore direct link between click inputs and decision making
12+
13+
## Global Claude Preferences
14+
15+
### Communication Style
16+
- Keep responses concise and technical
17+
- No unnecessary praise - I want thought from a good assistant, not a sycophant
18+
- Give explanations of technical concepts
19+
- Use bullet points for complex information
20+
- Avoid unnecessary preamble or postamble
21+
22+
### Default Behaviors
23+
- Always use TodoWrite for multi-step tasks
24+
- For anything beyond a very simple task, always make a plan before coding
25+
- Proactively search and understand codebases before making changes
26+
- Follow existing code conventions and patterns
27+
- Run lint/typecheck commands after code changes
28+
- Always commit changes after major modifications with clear, descriptive commit messages
29+
30+
### Technical Preferences
31+
- Prefer performance-optimized implementations
32+
- Use type hints in Python code
33+
- Include proper error handling
34+
- Follow academic/research coding standards
35+
36+
### Project Context
37+
- Focus on computational neuroscience and GLM modeling
38+
- Prioritize accuracy and reproducibility
39+
- Use proper statistical analysis methods
40+
- Generate publication-quality outputs
41+
42+
### Programming Education Goals
43+
- Introduce advanced statistical modeling concepts
44+
- Emphasize clean, scalable, and extensible code architecture
45+
- Explain GLM theory and implementation
46+
- Connect theory to real-world neuroscience applications
47+
- Build on existing computational background
48+
- Focus on scientific computing best practices
49+
50+
### Tool Usage
51+
- Use parallel tool calls for efficiency
52+
- Prefer existing file editing over creating new files
53+
- Use comprehensive search before implementation
54+
- Maintain organized project structure
55+
56+
## Important Instructions
57+
- Do what has been asked; nothing more, nothing less
58+
- NEVER create files unless absolutely necessary for achieving the goal
59+
- ALWAYS prefer editing an existing file to creating a new one
60+
- NEVER proactively create documentation files unless explicitly requested

README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# ClickDV
2+
3+
GLM project linking Poisson click input data from rats to decision variable outputs.
4+
5+
## Project Overview
6+
7+
This project develops a Generalized Linear Model (GLM) to link click input data to decision variables in rat behavioral experiments. The goal is to understand how sensory inputs (clicks) relate to decision-making processes through neural activity patterns.
8+
9+
## Getting Started
10+
11+
### Installation
12+
13+
This project uses [uv](https://docs.astral.sh/uv/) for fast, modern Python package management.
14+
15+
```bash
16+
# Install uv (if not already installed)
17+
curl -LsSf https://astral.sh/uv/install.sh | sh
18+
19+
# Clone the repository
20+
git clone <repository-url>
21+
cd ClickDV
22+
23+
# Install dependencies and create virtual environment
24+
uv sync
25+
26+
# Activate the environment (optional - uv run handles this automatically)
27+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
28+
```
29+
30+
**Why uv?**
31+
- 10-100x faster than pip
32+
- Built-in virtual environment management
33+
- Reproducible builds with `uv.lock`
34+
- Modern Python packaging standards
35+
36+
### Project Structure
37+
38+
```
39+
ClickDV/
40+
├── data/ # Data storage
41+
│ ├── raw/ # Original data files
42+
│ └── processed/ # Processed data
43+
├── src/ # Source code
44+
│ ├── preprocessing/ # Data extraction and alignment
45+
│ ├── models/ # GLM implementations
46+
│ ├── analysis/ # Analysis and comparison tools
47+
│ └── utils/ # Utility functions
48+
├── notebooks/ # Jupyter notebooks for exploration
49+
├── tests/ # Test suite
50+
└── results/ # Output figures and reports
51+
```
52+
53+
## Research Goals
54+
55+
1. Extract decision variables from spike data (starting with session A324)
56+
2. Access and analyze click times from behavioral data
57+
3. Develop GLM to link click inputs DV(t)
58+
4. Investigate how GLM weights differ between sessions
59+
5. Explore direct link between click inputs and decision making
60+
61+
## Usage
62+
63+
Start with the notebooks in the `notebooks/` directory for data exploration and model development.
64+
65+
## Development
66+
67+
The package uses modern Python packaging with `pyproject.toml` and uv for dependency management. Development dependencies are installed automatically.
68+
69+
Run commands in the virtual environment:
70+
```bash
71+
# Run tests
72+
uv run pytest tests/
73+
74+
# Run tests with coverage
75+
uv run pytest tests/ --cov=src --cov-report=html
76+
77+
# Run Python scripts
78+
uv run python src/main.py
79+
80+
# Start Jupyter notebook
81+
uv run jupyter notebook
82+
```
83+
84+
Update dependencies:
85+
```bash
86+
# Add new dependency
87+
uv add numpy
88+
89+
# Add development dependency
90+
uv add --dev pytest
91+
92+
# Update all dependencies
93+
uv sync
94+
```

0 commit comments

Comments
 (0)