From 0762c16e2234dcbdd705917cc0de7da04c7da537 Mon Sep 17 00:00:00 2001 From: "Richard J. Reyes" Date: Thu, 9 Jul 2026 19:13:36 -0700 Subject: [PATCH 1/4] Add photodiode analysis dependency manifest --- requirements.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1e833d3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +numpy>=1.24,<3 +pandas>=2.0,<3 +scipy>=1.10,<2 +matplotlib>=3.7,<4 +python-dotenv>=1.0,<2 +pytest>=7,<9 From ad5f60c00bb97e4e94ce20ff32b996812bb71e79 Mon Sep 17 00:00:00 2001 From: "Richard J. Reyes" Date: Thu, 9 Jul 2026 19:13:42 -0700 Subject: [PATCH 2/4] Add analysis-only photodiode container --- Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccb5db9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.12-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + MPLBACKEND=Agg \ + PIP_NO_CACHE_DIR=1 + +WORKDIR /app + +COPY requirements.txt ./ +RUN python -m pip install --upgrade pip \ + && python -m pip install --requirement requirements.txt + +COPY . /app + +RUN mkdir -p /work/outputs_npy_logcos +WORKDIR /work + +VOLUME ["/work/outputs_npy_logcos"] + +CMD ["python", "/app/scan_npy_logcos.py", "--input", "/app/captures/20260309_010802/waveform_raw.npy", "--sample-rate", "20000", "--fmin", "20", "--fmax", "1000", "--nperm", "100", "--cpu"] From c989d34dab81d858896000469c74f40911f384c0 Mon Sep 17 00:00:00 2001 From: "Richard J. Reyes" Date: Thu, 9 Jul 2026 19:13:58 -0700 Subject: [PATCH 3/4] Add photodiode Docker build exclusions --- .dockerignore | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2f5fdaa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +.git +.github +__pycache__/ +*.py[cod] +.pytest_cache/ +.venv/ +venv/ +.env +outputs_npy_logcos/ +proof_runs/ +proof/ +csv/ +control/ +pic/ From 81cd534cfa26292eb01bec110500b45b7e25ba6b Mon Sep 17 00:00:00 2001 From: "Richard J. Reyes" Date: Thu, 9 Jul 2026 19:14:10 -0700 Subject: [PATCH 4/4] Add photodiode analysis and container CI --- .github/workflows/container-ci.yml | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/container-ci.yml diff --git a/.github/workflows/container-ci.yml b/.github/workflows/container-ci.yml new file mode 100644 index 0000000..ced9100 --- /dev/null +++ b/.github/workflows/container-ci.yml @@ -0,0 +1,73 @@ +name: Analysis and container CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: container-ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + analysis-smoke: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + - name: Install analysis dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --requirement requirements.txt + - name: Compile Python sources + run: python -m compileall -q . + - name: Reproduce a fast CPU analysis in an isolated directory + run: | + mkdir -p /tmp/photodiode-ci + cd /tmp/photodiode-ci + python "$GITHUB_WORKSPACE/scan_npy_logcos.py" \ + --input "$GITHUB_WORKSPACE/captures/20260309_010802/waveform_raw.npy" \ + --sample-rate 20000 \ + --fmin 20 \ + --fmax 1000 \ + --nk 200 \ + --no-null \ + --cpu + - name: Validate generated summary + run: | + python - <<'PY' + import json + from pathlib import Path + + path = Path('/tmp/photodiode-ci/outputs_npy_logcos/summary.json') + data = json.loads(path.read_text(encoding='utf-8')) + assert data['samples'] == 10000 + assert data['sample_rate_Hz'] == 20000.0 + assert data['best_logcos']['k'] > 0 + PY + + container: + runs-on: ubuntu-24.04 + needs: analysis-smoke + steps: + - uses: actions/checkout@v4 + - name: Build analysis image + run: docker build --tag photodiode-ci . + - name: Run fast container analysis + run: | + docker run --rm photodiode-ci \ + python /app/scan_npy_logcos.py \ + --input /app/captures/20260309_010802/waveform_raw.npy \ + --sample-rate 20000 \ + --fmin 20 \ + --fmax 1000 \ + --nk 200 \ + --no-null \ + --cpu