JetBrains-Research / JetBrains-Research/Python-Solution-Preference

[005] Energy Auditing Field App (MVP)

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Overview

Application for energy auditors to conduct field inspections and verify New York 2020 ECCCNYS compliance through blower door and duct leakage testing.

Build this as a Python backend service with no UI; expose the functionality below through an HTTP API.

- Single inspector role (no admin/team features)
- Reference data from `assets/mvp-seed-data.json`
- Timezone: UTC (use UTC for everything, notwithstanding NY)

---

## User Account

Standard registration (name, email, password) and login. Successful registration auto-logs in the user. User can log out to end session.

---

## Job Management

**Create Job** — Required fields:
- Address (street, city, state, ZIP)
- Builder name
- Scheduled date
- House volume (cubic feet)
- Conditioned floor area (square feet)

Optional: Number of stories, Surface area.

New jobs start with status "Pending."

**Job List** — Returns all jobs for the logged-in user in reverse chronological order (most recent first). Each entry shows address, builder, scheduled date, and status.

**Job States**:
- **Pending**: No inspection data saved
- **In Progress**: Some inspection data saved (checklist or test)
- **Completed**: All three required sections complete (checklist + blower door + duct leakage)

---

## Inspection Workflow

**Job Details** returns job info and four sections: Checklist, Blower Door Test, Duct Leakage Test, and Photos.

### Checklist

10 items loaded from seed data. Each item has status: Not Started (default) / Passed / Failed / N/A.

**Summary**: "X/Y Passed (Z%)" where Y = applicable items (not N/A).
- Pass rate = (Passed / Applicable) × 100, rounded to nearest whole number (0.5 rounds up)
- If all items are N/A, pass rate = 0%

**Complete when**: All 10 items have status other than "Not Started."

### Blower Door Test

Calculates ACH50 (air changes per hour at 50 Pa) for compliance verification.

**Data Entry**:
- Ring configuration (Open, Ring A–D) for all points
- Multi-point pressure data (5–7 points): house pressures 50, 45, 40, 35, 30, 25, 20 Pa with corresponding fan pressures

**Calculations** (on calculate):
- CFM = C × (fanPressure)^n — using `blowerDoorCalibration` constants from seed data
- Log-log regression on (house pressure, CFM) yields: CFM50, n-factor, R²
- ACH50 = (CFM50 × 60) / house_volume

**Results**: CFM50, ACH50, n-factor, R², and compliance result.

**Compliance**: Pass if ACH50 ≤ 3.0

**R² Warning**: If R² < 0.98, return a warning that correlation is low. Warning does NOT block completion.

**Complete when**: ≥5 valid points entered and calculation performed.

### Duct Leakage Test

User selects: TDL only, DLO only, or Both.

**TDL (Total Duct Leakage)**:
- Enter: ring configuration, fan pressure
- CFM25 = C × (fanPressure)^0.5 — using `ductBlasterCalibration` from seed data
- CFM25/100 sq ft = (CFM25 × 100) / conditioned_area
- Compliance: Pass if ≤ 4.0 CFM25/100 sq ft

**DLO (Duct Leakage to Outside)**:
- Enter: house pressure, ring configuration, fan pressure
- Same CFM25 calculation
- Compliance: Pass if ≤ 3.0 CFM25/100 sq ft
- **House pressure warning**: If outside -23 to -27 Pa range, return a warning. Warning does NOT block completion.

**Overall compliance**: Pass only if all selected tests pass.

**Complete when**: At least one test (TDL or DLO) calculated.

### Photos

- Upload images (JPEG, PNG, WebP only)
- Maximum 10 photos per job
- Photos can be retrieved and deleted
- **Photos are optional** — not required for job completion

---

## Job Completion

Job automatically transitions to "Completed" when:
1. Checklist: all 10 items have status ≠ "Not Started"
2. Blower Door: ≥5 points entered and calculated
3. Duct Leakage: at least one test (TDL or DLO) calculated

Warnings (low R², house pressure outside range) and failing compliance results do NOT prevent completion.

---
**Provided starting files:** see [`005-energy-audit/assets/`](https://github.com/JetBrains-Research/Python-Solution-Preference/tree/main/005-energy-audit/assets) — these were in the agent's working directory when it solved the task.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the provided files in 005-energy-audit/assets/, especially assets/mvp-seed-data.json, then map the required HTTP API resources and workflow states from the issue. Done means the backend supports authentication, job and inspection workflows, calculations, photo handling, and automatic completion according to all listed validation and compliance rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.