-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (96 loc) · 3.05 KB
/
Makefile
File metadata and controls
113 lines (96 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# DedAI-Neurodynamics Makefile
# Common development commands
.PHONY: help install dev test lint train demo clean docs
# Default target
help:
@echo "DedAI-Neurodynamics Development Commands"
@echo "========================================="
@echo ""
@echo "Setup:"
@echo " make install Install package in editable mode"
@echo " make dev Install with development dependencies"
@echo ""
@echo "Testing:"
@echo " make test Run all unit tests"
@echo " make test-cov Run tests with coverage report"
@echo " make lint Check code style (ruff)"
@echo ""
@echo "Running:"
@echo " make demo Run inference on sample audio"
@echo " make train Retrain TCN model (requires GPU)"
@echo " make jupyter Start Jupyter notebook server"
@echo ""
@echo "Maintenance:"
@echo " make clean Remove generated files"
@echo " make clean-all Remove all generated files and caches"
@echo ""
# Installation
install:
pip install -e .
dev:
pip install -e ".[dev]"
all:
pip install -e ".[all]"
# Testing
test:
pytest tests/ -v
test-cov:
pytest tests/ -v --cov=src/pynrt --cov-report=html
@echo "Coverage report: htmlcov/index.html"
# Linting
lint:
ruff check src/ ml_utils/ tests/
ruff format --check src/ ml_utils/ tests/
format:
ruff format src/ ml_utils/ tests/
# Type checking
typecheck:
mypy src/pynrt --ignore-missing-imports
# Running
demo:
@echo "Running groove extraction demo..."
@if [ -f "outputs/sessions/20251230_212609/audio/neural_duet.wav" ]; then \
python ml_utils/run_inference_complete.py \
outputs/sessions/20251230_212609/audio/neural_duet.wav \
-m models/ml_v3_20260102_162052_best_model.pt \
-o outputs/demo/; \
else \
echo "Sample audio not found. Please provide an audio file:"; \
echo " python ml_utils/run_inference_complete.py your_audio.wav -m models/ml_v3_*_best_model.pt -o outputs/"; \
fi
train:
@echo "Training TCN surrogate model..."
@echo "This requires GPU and takes ~45 minutes."
@echo "Run the dedAI_ML_Component.ipynb notebook for interactive training."
jupyter nbconvert --to notebook --execute dedAI_ML_Component.ipynb --output dedAI_ML_Component_executed.ipynb
jupyter:
jupyter notebook
# Cleaning
clean:
rm -rf outputs/demo/
rm -rf __pycache__/
rm -rf src/__pycache__/
rm -rf src/pynrt/__pycache__/
rm -rf .pytest_cache/
rm -rf *.egg-info/
find . -name "*.pyc" -delete
find . -name ".DS_Store" -delete
clean-all: clean
rm -rf .venv/
rm -rf htmlcov/
rm -rf .coverage
rm -rf .mypy_cache/
rm -rf .ruff_cache/
# Documentation
docs:
@echo "Documentation is in docs/ folder"
@echo " - README.md: Main documentation"
@echo " - docs/ARCHITECTURE.md: System design"
@echo " - docs/QUICKSTART.md: Getting started guide"
# Verification
verify:
@echo "Verifying installation..."
python -c "from pynrt import ASHLE, GrFNN, HopfOscillator; print('Core modules: OK')"
python -c "from pynrt.audio.synthesis import NeuralSynthesizer; print('Audio synthesis: OK')"
python -c "import torch; print(f'PyTorch: OK (CUDA: {torch.cuda.is_available()})')"
@echo "All checks passed!"