77ethers commited on
Commit
164be01
·
verified ·
1 Parent(s): fcb451b

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -4
  2. gridops/server/static/index.html +18 -0
Dockerfile CHANGED
@@ -2,12 +2,15 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- COPY pyproject.toml README.md openenv.yaml ./
 
 
 
 
6
  COPY gridops/ gridops/
7
  COPY server/ server/
8
- COPY inference.py scripts/ ./
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">&#128336; 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">&#127968; Homes Will Need</span><span id="demandInfo">—</span></div>
513
  <div class="info-row"><span class="label">&#9728;&#65039; Solar Expected</span><span id="solarInfo">—</span></div>
 
514
  <div class="info-row"><span class="label">&#128176; Grid Price</span><span id="priceInfo" style="font-weight:700">—</span></div>
515
  <div class="info-row"><span class="label">&#128267; Battery Charge</span><span id="socInfo">—</span></div>
516
  <div class="info-row"><span class="label">&#9981; 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">&#128336; 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">&#127968; Homes Will Need</span><span id="demandInfo">—</span></div>
513
  <div class="info-row"><span class="label">&#9728;&#65039; Solar Expected</span><span id="solarInfo">—</span></div>
514
+ <div class="info-row"><span class="label">&#9889; Grid Will Cover</span><span id="gridNeedInfo">—</span></div>
515
  <div class="info-row"><span class="label">&#128176; Grid Price</span><span id="priceInfo" style="font-weight:700">—</span></div>
516
  <div class="info-row"><span class="label">&#128267; Battery Charge</span><span id="socInfo">—</span></div>
517
  <div class="info-row"><span class="label">&#9981; 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)';