File size: 4,441 Bytes
e391a84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "bp-monitoring-pipeline"
version = "1.0.0"
description = "Blood Pressure Monitoring Pipeline β€” PPG signal ingestion, processing, and AI-based ABP prediction"
authors = [{ name = "Data Engineering Team" }]
requires-python = ">=3.11"
readme = "README.md"
license = { text = "MIT" }

dependencies = [
    # ── Web Framework ─────────────────────────────────────────────────────────
    "fastapi>=0.110.0",
    "uvicorn[standard]>=0.29.0",

    # ── Database β€” Supabase / PostgreSQL / SQLite ─────────────────────────────
    "sqlalchemy>=2.0.0",
    "asyncpg>=0.29.0",              # Async PostgreSQL driver (Supabase production)
    "alembic>=1.13.0",              # Schema migrations (production deploys)
    "aiosqlite>=0.20.0",            # SQLite async driver (local dev fallback)

    # ── Message Broker ────────────────────────────────────────────────────────
    "aio-pika>=9.4.0",              # Async RabbitMQ / CloudAMQP (AMQP + AMQPS)

    # ── Validation & Settings ─────────────────────────────────────────────────
    "pydantic>=2.0.0",
    "pydantic-settings>=2.0.0",
    "python-dotenv>=1.0.0",

    # ── Signal Processing ─────────────────────────────────────────────────────
    "scipy>=1.12.0",                # Butterworth filter, interpolation, segmentation
    "numpy>=1.26.0",                # Numerical arrays throughout the pipeline

    # ── Image Processing (VG adjacency matrix β†’ PIL β†’ torchvision tensor) ────
    "Pillow>=10.0.0",               # PIL.Image used in numba_vgtlnet_preprocessor.py

    # ── HTTP Client (scripts/mock_iot_sender.py) ──────────────────────────────
    "httpx>=0.27.0",
]

[project.optional-dependencies]

# ── GPU / AI Model dependencies ───────────────────────────────────────────────
# Install with:  pip install -e ".[gpu]"
# Required for GANVGTLNetService (production inference).
# NOT needed for the FastAPI / ETL #1 container β€” only the Colab consumer.
gpu = [
    "torch>=2.0.0",
    "torchvision>=0.15.0",          # torchvision.transforms used in vgtlnet preprocessor
    "timm>=0.9.0",                  # timm.create_model("convnextv2_tiny...") in vgtlnet.py
    "numba>=0.59.0",                # @njit JIT compiler for visibility graph (optional speedup)
]

# ── Development & Testing dependencies ───────────────────────────────────────
# Install with:  pip install -e ".[dev]"
dev = [
    "pytest>=8.0.0",
    "pytest-asyncio>=0.23.0",
    "pytest-cov>=5.0.0",
    "httpx>=0.27.0",                # Async HTTP client for API integration tests
    "anyio>=4.0.0",                 # Async test backend
    "ruff>=0.4.0",                  # Linter + formatter
    "mypy>=1.10.0",                 # Static type checker
]

# ── All extras combined (convenience) ────────────────────────────────────────
# Install with:  pip install -e ".[all]"
all = [
    "torch>=2.0.0",
    "torchvision>=0.15.0",
    "timm>=0.9.0",
    "numba>=0.59.0",
    "pytest>=8.0.0",
    "pytest-asyncio>=0.23.0",
    "pytest-cov>=5.0.0",
    "httpx>=0.27.0",
    "anyio>=4.0.0",
    "ruff>=0.4.0",
    "mypy>=1.10.0",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["src*", "scripts*"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]

[tool.ruff]
line-length = 100
target-version = "py311"
select = ["E", "F", "I", "UP", "B"]

[tool.mypy]
python_version = "3.11"
strict = true
ignore_missing_imports = true