-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
195 lines (159 loc) · 5.24 KB
/
Makefile
File metadata and controls
195 lines (159 loc) · 5.24 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Makefile for Bee Migration Analysis Project
.PHONY: help install install-dev test lint format clean run-analysis generate-charts setup-env docs
# Default target
help:
@echo "Available commands:"
@echo " install - Install production dependencies"
@echo " install-dev - Install development dependencies"
@echo " setup-env - Setup development environment"
@echo " test - Run tests"
@echo " test-cov - Run tests with coverage"
@echo " lint - Run linting checks"
@echo " format - Format code with black and isort"
@echo " clean - Clean temporary files"
@echo " run-analysis - Run complete bee migration analysis"
@echo " generate-charts - Generate all scientific charts"
@echo " docs - Generate documentation"
@echo " security - Run security checks"
@echo " all - Run format, lint, test, and analysis"
# Installation
install:
@echo "Installing production dependencies..."
pip install -r requirements.txt
install-dev: install
@echo "Installing development dependencies..."
pip install -r requirements-dev.txt
# Environment setup
setup-env:
@echo "Setting up development environment..."
python -m venv .venv
@echo "Virtual environment created. Activate with:"
@echo " source .venv/bin/activate # On Linux/Mac"
@echo " .venv\\Scripts\\activate # On Windows"
setup-conda:
@echo "Setting up conda environment..."
conda env create -f environment.yml
@echo "Conda environment created. Activate with:"
@echo " conda activate bee-migration-analysis"
# Testing
test:
@echo "Running tests..."
pytest tests/ -v
test-cov:
@echo "Running tests with coverage..."
pytest tests/ -v --cov=src --cov-report=html --cov-report=term
test-fast:
@echo "Running fast tests..."
pytest tests/ -v -x --ff
# Code quality
lint:
@echo "Running linting checks..."
flake8 src/ tests/
mypy src/
format:
@echo "Formatting code..."
black src/ tests/
isort src/ tests/
format-check:
@echo "Checking code format..."
black --check src/ tests/
isort --check-only src/ tests/
# Security
security:
@echo "Running security checks..."
bandit -r src/
safety check
# Analysis and charts
run-analysis:
@echo "Running complete bee migration analysis..."
cd src && python bee_analysis.py
cd src && python bee_migration_analysis.py
cd src && python comparative_analysis.py
generate-charts:
@echo "Generating all scientific charts..."
cd src && python generate_charts_english.py
generate-charts-pt:
@echo "Generating charts in Portuguese..."
cd src && python generate_charts.py
run-predictor:
@echo "Running migration predictor..."
cd src && python bee_migration_predictor.py
# Data processing
process-data:
@echo "Processing raw data..."
@echo "Note: Implement data processing scripts as needed"
download-data:
@echo "Downloading external data..."
@echo "Note: Implement data download scripts as needed"
# Documentation
docs:
@echo "Generating documentation..."
@echo "Note: Add sphinx documentation generation here"
docs-serve:
@echo "Serving documentation locally..."
@echo "Note: Add local documentation server here"
# Cleanup
clean:
@echo "Cleaning temporary files..."
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name ".pytest_cache" -delete
find . -type f -name ".coverage" -delete
find . -type d -name "htmlcov" -delete
find . -type d -name ".mypy_cache" -delete
find . -type f -name "*.log" -delete
clean-data:
@echo "Cleaning processed data files..."
rm -rf data/processed/*
rm -rf results/*.csv
rm -rf results/*.pkl
clean-images:
@echo "Cleaning generated images..."
rm -rf images/*.png
rm -rf images/*.jpg
rm -rf images/*.svg
# Development workflow
dev-setup: setup-env install-dev
@echo "Development environment ready!"
dev-check: format lint test
@echo "Development checks completed!"
# CI/CD simulation
ci: format-check lint test security
@echo "CI checks completed!"
# Complete workflow
all: format lint test run-analysis generate-charts
@echo "Complete workflow finished!"
# Git helpers
git-setup:
@echo "Setting up git hooks..."
pre-commit install
commit-check: format lint test
@echo "Ready for commit!"
# Project information
info:
@echo "Bee Migration Analysis Project"
@echo "=============================="
@echo "Python version: $(shell python --version)"
@echo "Project structure:"
@tree -L 2 -I '__pycache__|.git|.venv|*.pyc'
status:
@echo "Project status:"
@echo "- Source files: $(shell find src -name '*.py' | wc -l)"
@echo "- Test files: $(shell find tests -name '*.py' 2>/dev/null | wc -l || echo 0)"
@echo "- Data files: $(shell find data -name '*.csv' 2>/dev/null | wc -l || echo 0)"
@echo "- Generated images: $(shell find images -name '*.png' 2>/dev/null | wc -l || echo 0)"
@echo "- Model files: $(shell find results/models -name '*.pkl' 2>/dev/null | wc -l || echo 0)"
# Docker support (future)
docker-build:
@echo "Building Docker image..."
@echo "Note: Add Dockerfile and build command"
docker-run:
@echo "Running Docker container..."
@echo "Note: Add Docker run command"
# Jupyter notebook support
jupyter:
@echo "Starting Jupyter Lab..."
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser
notebook-clean:
@echo "Cleaning notebook outputs..."
jupyter nbconvert --clear-output --inplace notebooks/*.ipynb