Upload folder using huggingface_hub
Browse files- Dockerfile +7 -4
- gridops/server/static/index.html +18 -0
Dockerfile
CHANGED
|
@@ -2,12 +2,15 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
COPY gridops/ gridops/
|
| 7 |
COPY server/ server/
|
| 8 |
-
COPY inference.py
|
| 9 |
-
|
| 10 |
-
RUN pip install --no-cache-dir .
|
| 11 |
|
| 12 |
EXPOSE 8000
|
| 13 |
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install deps first (cached layer)
|
| 6 |
+
COPY pyproject.toml ./
|
| 7 |
+
RUN pip install --no-cache-dir numpy pydantic fastapi "uvicorn[standard]" websockets openai requests openenv-core
|
| 8 |
+
|
| 9 |
+
# Copy app code
|
| 10 |
COPY gridops/ gridops/
|
| 11 |
COPY server/ server/
|
| 12 |
+
COPY inference.py openenv.yaml README.md ./
|
| 13 |
+
COPY scripts/ scripts/
|
|
|
|
| 14 |
|
| 15 |
EXPOSE 8000
|
| 16 |
|
gridops/server/static/index.html
CHANGED
|
@@ -511,6 +511,7 @@
|
|
| 511 |
<div class="info-row"><span class="label">🕐 Time</span><span id="timeInfo" style="font-weight:700;color:var(--cyan)">06:00 · Day 1</span></div>
|
| 512 |
<div class="info-row"><span class="label">🏠 Homes Will Need</span><span id="demandInfo">—</span></div>
|
| 513 |
<div class="info-row"><span class="label">☀️ Solar Expected</span><span id="solarInfo">—</span></div>
|
|
|
|
| 514 |
<div class="info-row"><span class="label">💰 Grid Price</span><span id="priceInfo" style="font-weight:700">—</span></div>
|
| 515 |
<div class="info-row"><span class="label">🔋 Battery Charge</span><span id="socInfo">—</span></div>
|
| 516 |
<div class="info-row"><span class="label">⛽ Diesel Fuel Left</span><span id="fuelInfo">—</span></div>
|
|
@@ -862,6 +863,23 @@ function updateUI() {
|
|
| 862 |
solEl.textContent = solKw.toFixed(0) + ' kW';
|
| 863 |
solEl.style.color = solKw > 100 ? 'var(--yellow)' : 'var(--text-dim)';
|
| 864 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 865 |
const socPctRaw = ((obs.battery_soc || 0) * 100);
|
| 866 |
const socInfoEl = document.getElementById('socInfo');
|
| 867 |
socInfoEl.textContent = socPctRaw.toFixed(0) + '% (' + (socPctRaw * 5).toFixed(0) + ' kWh)';
|
|
|
|
| 511 |
<div class="info-row"><span class="label">🕐 Time</span><span id="timeInfo" style="font-weight:700;color:var(--cyan)">06:00 · Day 1</span></div>
|
| 512 |
<div class="info-row"><span class="label">🏠 Homes Will Need</span><span id="demandInfo">—</span></div>
|
| 513 |
<div class="info-row"><span class="label">☀️ Solar Expected</span><span id="solarInfo">—</span></div>
|
| 514 |
+
<div class="info-row"><span class="label">⚡ Grid Will Cover</span><span id="gridNeedInfo">—</span></div>
|
| 515 |
<div class="info-row"><span class="label">💰 Grid Price</span><span id="priceInfo" style="font-weight:700">—</span></div>
|
| 516 |
<div class="info-row"><span class="label">🔋 Battery Charge</span><span id="socInfo">—</span></div>
|
| 517 |
<div class="info-row"><span class="label">⛽ Diesel Fuel Left</span><span id="fuelInfo">—</span></div>
|
|
|
|
| 863 |
solEl.textContent = solKw.toFixed(0) + ' kW';
|
| 864 |
solEl.style.color = solKw > 100 ? 'var(--yellow)' : 'var(--text-dim)';
|
| 865 |
|
| 866 |
+
// Grid: demand - solar = what grid needs to cover (before your battery/diesel decisions)
|
| 867 |
+
const gridGap = demKw - solKw; // positive = importing, negative = exporting
|
| 868 |
+
const gridNeedEl = document.getElementById('gridNeedInfo');
|
| 869 |
+
if (gridGap > 200) {
|
| 870 |
+
gridNeedEl.textContent = gridGap.toFixed(0) + ' kW — OVER 200 kW LIMIT! Use battery/diesel.';
|
| 871 |
+
gridNeedEl.style.color = 'var(--red)';
|
| 872 |
+
} else if (gridGap > 150) {
|
| 873 |
+
gridNeedEl.textContent = gridGap.toFixed(0) + ' kW — near limit, consider battery';
|
| 874 |
+
gridNeedEl.style.color = 'var(--yellow)';
|
| 875 |
+
} else if (gridGap < 0) {
|
| 876 |
+
gridNeedEl.textContent = gridGap.toFixed(0) + ' kW (exporting surplus)';
|
| 877 |
+
gridNeedEl.style.color = 'var(--green)';
|
| 878 |
+
} else {
|
| 879 |
+
gridNeedEl.textContent = gridGap.toFixed(0) + ' kW';
|
| 880 |
+
gridNeedEl.style.color = 'var(--text)';
|
| 881 |
+
}
|
| 882 |
+
|
| 883 |
const socPctRaw = ((obs.battery_soc || 0) * 100);
|
| 884 |
const socInfoEl = document.getElementById('socInfo');
|
| 885 |
socInfoEl.textContent = socPctRaw.toFixed(0) + '% (' + (socPctRaw * 5).toFixed(0) + ' kWh)';
|