In this section
- GlobalGrid2050 Repair V6 Restore V5 Panels render · globalgrid2050 / scripts/repair_v6_restore_v5_panels.py lines 1–268
- GlobalGrid2050 Test Add V8 Battery Energy Storage System (BESS) Geospatial Layout Drawing test · globalgrid2050 / scripts/test_add_v8_bess_geospatial_layout_drawing.py lines 1–52
- GlobalGrid2050 Test Build V8 Battery Energy Storage System (BESS) GIS Single-Line Diagram (SLD) Financial… test · globalgrid2050 / scripts/test_build_v8_bess_gis_sld_financial_sandbox.py lines 1–73
- GlobalGrid2050 Test Create V8 Battery Energy Storage System (BESS) Electrical Topology Review test · globalgrid2050 / scripts/test_create_v8_bess_electrical_topology_review.py lines 1–50
- GlobalGrid2050 Test Create V8 Battery Energy Storage System (BESS) Pcs Standalone test · globalgrid2050 / scripts/test_create_v8_bess_pcs_standalone.py lines 1–45
- GlobalGrid2050 Test Patch V8 Battery Energy Storage System (BESS) Tabs Small Step test · globalgrid2050 / scripts/test_patch_v8_bess_tabs_small_step.py lines 1–58
- GlobalGrid2050 Test Rebuild V8 Battery Energy Storage System (BESS) from V7 GIS Frame test · globalgrid2050 / scripts/test_rebuild_v8_bess_from_v7_gis_frame.py lines 1–74
- GlobalGrid2050 Test Restore V8 Battery Energy Storage System (BESS) MapLibre Standalone test · globalgrid2050 / scripts/test_restore_v8_bess_maplibre_standalone.py lines 1–70
GlobalGrid2050 Repair V6 Restore V5 Panels
A Python module in the scripts folder that draws live grid energy, live grid price, live oil prices and electricity price history daily decade.
renderglobalgrid2050 / scripts/repair_v6_restore_v5_panels.py · lines 1–268 of 268 · Entry point
- What it does
- It draws live grid energy, live grid price, live oil prices and electricity price history daily decade. Uses libraries pathlib. Side effects: changes the web page (DOM); reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'panels'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
- Inputs & outputs
- In: JSON file live_grid_energy.json; JSON file live_grid_price.json; JSON file live_oil_prices.json; JSON file electricity_price_history.json; JSON file electricity_price_history_daily_decade.json; GeoJSON file oil_price_history.geojson; JSON file live_uk_fuel_prices.json; JSON file ev_charging_prices.json. Out: canvas drawing.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 Repair V6 Restore V5 Panels Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Repair V6 Restore V5 Panels Workflow.
- Application
- globalgrid2050 · scripts · Python module
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Repair V6 Restore V5 Panels Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/repair_v6_restore_v5_panels.py:1-268 · blob a30eb22652aa74ba6a856d2f20e6cd2ee36675b6 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
V6 = ROOT / "uk_energy_tracking_v6"
READ_FIRST = [
"AI_START_HERE.md",
"uk_energy_tracking_v6/V6_ARCHITECTURAL_INTEGRITY_PROTOCOL.md",
"uk_energy_tracking_v6/V5_V6_COMPARISON_REPORT.md",
"uk_energy_tracking_v6/operating_manual.md",
"uk_energy_tracking_v5/index.md",
"uk_energy_tracking_v5/live-config.js",
"uk_energy_tracking_v5/live-app.js",
"uk_energy_tracking_v5/live-transport.js",
"uk_energy_tracking_v5/live-oil-chart.js",
"uk_energy_tracking_v5/frequency-history-ui.js",
]
for rel in READ_FIRST:
path = ROOT / rel
if not path.exists():
raise FileNotFoundError(f"Required file missing: {rel}")
path.read_text(encoding="utf-8")
protocol = (V6 / "V6_ARCHITECTURAL_INTEGRITY_PROTOCOL.md").read_text(encoding="utf-8")
comparison = (V6 / "V5_V6_COMPARISON_REPORT.md").read_text(encoding="utf-8")
if "All V6 changes" not in protocol or "workflow" not in protocol:
raise RuntimeError("V6 protocol not recognised")
if "V5 ids missing from V6" not in comparison:
raise RuntimeError("V5 V6 comparison report not recognised")
for token in ["oil-trend-canvas", "oil-range", "petrol-price", "diesel-price", "ev-rapid-price", "ev-ultra-price", "fuel-breakdown"]:
if token not in comparison:
raise RuntimeError(f"Expected missing V5 token absent from comparison report: {token}")
index_path = V6 / "index.md"
css_path = V6 / "styles/app.css"
config_path = V6 / "live_data_pipeline/live-config.js"
commodities_path = V6 / "commodity_price_signals/render_commodities/render_commodities.js"
start_path = V6 / "app_bootstrap/start_v6_app/start_v6_app.js"
frequency_path = V6 / "frequency_history/frequency-history-ui.js"
report_path = V6 / "V6_REPAIR_RESTORE_V5_PANELS_REPORT.md"
index = index_path.read_text(encoding="utf-8")
css = css_path.read_text(encoding="utf-8")
config = config_path.read_text(encoding="utf-8")
commodities = commodities_path.read_text(encoding="utf-8")
start_app = start_path.read_text(encoding="utf-8")
for token in ["oil-trend-canvas", "petrol-price", "ev-rapid-price", "frequency-history-ui.js"]:
if token in index:
raise RuntimeError(f"Refusing duplicate V6 panel restore. Already found: {token}")
insert_marker = " <section class=\"scada-credit\">"
if insert_marker not in index:
raise RuntimeError("Cannot find V6 attribution section marker")
panel_html = """ <section id=\"oil-price-trend-panel\">
<h2 class=\"section-title\">Oil Price Trend</h2>
<div class=\"trend-panel\">
<div class=\"trend-controls\">
<strong style=\"color:#00ffff;letter-spacing:.12em;text-transform:uppercase;\">Oil Price Trend</strong>
<select id=\"oil-range\">
<option value=\"7d\">1 week</option>
<option value=\"1m\">1 month</option>
<option value=\"3m\">3 months</option>
<option value=\"6m\">6 months</option>
<option value=\"9m\">9 months</option>
<option value=\"1y\">1 year</option>
<option value=\"5y\">5 years</option>
<option value=\"10y\">10 years</option>
<option value=\"25y\" selected>25 years</option>
</select>
</div>
<div class=\"unit-panel\"><strong>Unit:</strong> USD per barrel. Touch or move across the graph to inspect date, Brent and WTI values.</div>
<div class=\"oil-chart-wrap\"><canvas id=\"oil-trend-canvas\" width=\"900\" height=\"300\"></canvas><div id=\"oil-tooltip\" class=\"oil-tooltip\"></div></div>
<div id=\"oil-stats\" class=\"oil-stats-grid\"></div>
</div>
</section>
<section id=\"road-fuel-ev-panel\">
<h2 class=\"section-title\" style=\"font-size:18px;color:#a6adbb;\">Road Fuel & EV Charging</h2>
<div class=\"pump-grid\">
<div class=\"pump-card\"><div class=\"pump-label\">Petrol</div><div class=\"pump-value\" id=\"petrol-price\">—</div><div class=\"commodity-unit\">DESNZ weekly average, pence per litre</div></div>
<div class=\"pump-card\"><div class=\"pump-label\">Diesel</div><div class=\"pump-value\" id=\"diesel-price\">—</div><div class=\"commodity-unit\">DESNZ weekly average, pence per litre</div></div>
</div>
<div class=\"fuel-logic-panel\">
<strong>Road fuel price logic:</strong> Brent crude is quoted in US dollars per barrel. A rough product cost proxy converts USD per barrel into GBP per litre by applying an FX assumption and dividing by about 159 litres per barrel. UK pump prices then add refining spread, wholesale margin, logistics, retail margin, fuel duty and VAT.
<div id=\"fuel-breakdown\" style=\"margin-top:10px;\">Awaiting DESNZ fuel price feed.</div>
<div class=\"fuel-source-links\">
<a href=\"https://www.gov.uk/government/statistics/weekly-road-fuel-prices\" target=\"_blank\" rel=\"noopener noreferrer\">DESNZ weekly road fuel prices</a>
<a href=\"https://www.gov.uk/tax-on-shopping/fuel-duty\" target=\"_blank\" rel=\"noopener noreferrer\">GOV.UK fuel duty</a>
<a href=\"https://www.gov.uk/vat-rates\" target=\"_blank\" rel=\"noopener noreferrer\">GOV.UK VAT rates</a>
</div>
</div>
<div class=\"ev-panel\">
<strong>EV charging comparison placeholder:</strong> Public EV tariffs are compared with petrol, diesel, wholesale electricity and operator tariff data when the V6 EV feed is present.
<div class=\"ev-card-grid\">
<div class=\"ev-card\"><div class=\"ev-label\">Rapid charging average</div><div class=\"ev-value\" id=\"ev-rapid-price\">—</div><div class=\"commodity-unit\">pence per kilowatt hour</div></div>
<div class=\"ev-card\"><div class=\"ev-label\">Ultra rapid average</div><div class=\"ev-value\" id=\"ev-ultra-price\">—</div><div class=\"commodity-unit\">pence per kilowatt hour</div></div>
</div>
</div>
</section>
"""
index = index.replace(insert_marker, panel_html + insert_marker, 1)
start_script = '<script src="/uk_energy_tracking_v6/app_bootstrap/start_v6_app/start_v6_app.js?v=20260530o"></script>'
if start_script not in index:
raise RuntimeError("Cannot find V6 start app script marker")
frequency_script = '<script src="/uk_energy_tracking_v6/frequency_history/frequency-history-ui.js?v=20260531a"></script>'
index = index.replace(start_script, start_script + "\n" + frequency_script, 1)
css_add = """
/* V6 repair: restore V5 oil, road fuel, EV and frequency panel styling. */
.trend-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:10px;}
.trend-controls select{background:#050505;color:var(--gg-cyan);border:1px solid var(--gg-line);padding:8px;font-family:\"Courier New\",monospace;border-radius:4px;}
#oil-trend-canvas{width:100%;height:300px;display:block;border:1px solid rgba(255,255,255,.05);background:#070a10;touch-action:auto;}
.oil-chart-wrap{position:relative;}
.oil-tooltip{position:absolute;display:none;pointer-events:none;background:rgba(5,5,5,.94);border:1px solid var(--gg-cyan);color:var(--gg-text);padding:8px 10px;border-radius:4px;font-size:12px;line-height:1.45;box-shadow:0 0 18px rgba(0,255,255,.12);z-index:5;}
.oil-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:10px;}
.oil-stat{border:1px solid var(--gg-line);background:rgba(255,255,255,.03);border-radius:4px;padding:9px;}
.oil-stat-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.12em;font-size:10px;}
.oil-stat-value{color:var(--gg-cyan);font-size:16px;font-weight:800;margin-top:4px;}
.pump-grid{grid-template-columns:repeat(2,minmax(0,1fr));opacity:.86;}
.pump-card{background:rgba(255,255,255,.03);border:1px solid var(--gg-line);border-radius:6px;padding:12px;}
.pump-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.14em;font-size:11px;}
.pump-value{color:var(--gg-yellow);font-size:24px;font-weight:800;margin-top:6px;}
.fuel-logic-panel,.ev-panel{border:1px solid var(--gg-line);background:rgba(255,255,255,.03);border-radius:6px;padding:14px;margin-top:14px;color:var(--gg-muted);font-size:13px;line-height:1.55;}
.fuel-logic-panel strong,.ev-panel strong{color:var(--gg-text);}
.fuel-source-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px;}
.fuel-source-links a{border:1px solid var(--gg-line);border-radius:4px;padding:7px 9px;color:#7fdfff;}
.ev-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px;}
.ev-card{border:1px solid var(--gg-line);background:var(--gg-panel);border-radius:6px;padding:12px;}
.ev-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.14em;font-size:11px;}
.ev-value{color:var(--gg-green);font-size:22px;font-weight:800;margin-top:6px;}
@media(max-width:850px){.pump-grid,.ev-card-grid,.oil-stats-grid{grid-template-columns:1fr;}#oil-trend-canvas{height:320px;}}
"""
if "V6 repair: restore V5 oil" not in css:
css = css.rstrip() + css_add
expected_config = """window.V6LiveConfig={
energy:'/uk_energy_tracking_v6/live_grid_energy.json',
price:'/uk_energy_tracking_v6/live_grid_price.json',
commodities:'/uk_energy_tracking_v6/live_oil_prices.json',
priceHistory:'/uk_energy_tracking_v6/electricity_price_history.json',
dailyPriceHistory:'/uk_energy_tracking_v6/electricity_price_history_daily_decade.json',
annualBase:'/data/electricity/elexon_system_prices_'
};
"""
if config != expected_config:
raise RuntimeError("V6 live config has changed. Regenerate this repair script against current file.")
config = """window.V6LiveConfig={
energy:'/uk_energy_tracking_v6/live_grid_energy.json',
price:'/uk_energy_tracking_v6/live_grid_price.json',
commodities:'/uk_energy_tracking_v6/live_oil_prices.json',
oilHistory:'/uk_energy_tracking_v6/oil_price_history.geojson',
fuel:'/uk_energy_tracking_v6/live_uk_fuel_prices.json',
evPrices:'/uk_energy_tracking_v6/ev_charging_prices.json',
frequencyCsv:'/uk_energy_tracking_v6/grid_frequency_history.csv',
frequencyLive:'/uk_energy_tracking_v6/live_grid_frequency.json',
frequencyWeekly:'/uk_energy_tracking_v6/live_grid_frequency_weekly_health.json',
priceHistory:'/uk_energy_tracking_v6/electricity_price_history.json',
dailyPriceHistory:'/uk_energy_tracking_v6/electricity_price_history_daily_decade.json',
annualBase:'/data/electricity/elexon_system_prices_'
};
"""
commodities = r'''window.V6RenderCommodities=(function(){
var oilChartState={rows:[],pad:54,dpr:1};
function h(){return window.V6DomText}
function fmt(v,d){return h().fmt(v,d)}
function set(id,v){h().setText(id,v)}
function sym(c){return c==='GBP'?'£':c==='EUR'?'€':'$'}
function fmtMoney(v,c){return v==null||isNaN(Number(v))?'—':sym(c)+Number(v).toLocaleString('en-GB',{maximumFractionDigits:0})}
function renderMetalCard(id,metal,data){var el=document.getElementById(id);if(!el)return;var usd=data[metal+'USDperTonne'],eur=data[metal+'EURperTonne'],gbp=data[metal+'GBPperTonne'];if(usd==null&&eur==null&&gbp==null){el.textContent='—';return}el.innerHTML='<span style="display:block">'+fmtMoney(usd,'USD')+' <span style="font-size:12px;color:#9aa3b6">USD/t</span></span>'+'<span style="display:b … [line shortened here: 699 characters; full line on GitHub]
function renderFuelBreakdown(oil,latest){var el=document.getElementById('fuel-breakdown');if(!el)return;var brent=oil&&oil.brentUSDperBarrel,petrol=latest&&latest.petrolPencePerLitre;var stamp=oil&&oil.updatedDisplayUTC?' Commodity sync: '+oil.updatedDisplayUTC+'.':'';if(brent==null||petrol==null){el.textContent='Awaiting Brent crude and DESNZ fuel price feed.'+stamp;return}var gbpUsd=(oil.fx&&o … [line shortened here: 973 characters; full line on GitHub]
function renderEvPrices(ev){var ops=(ev&&ev.operators)||[],rapid=[],ultra=[];ops.forEach(function(o){if(o.rapidPencePerKWh!=null)rapid.push(Number(o.rapidPencePerKWh));if(o.ultraRapidPencePerKWh!=null)ultra.push(Number(o.ultraRapidPencePerKWh))});set('ev-rapid-price',rapid.length?fmt(rapid.reduce(function(a,b){return a+b},0)/rapid.length,1)+'p':'—');set('ev-ultra-price',ultra.length?fmt(ultra.re … [line shortened here: 459 characters; full line on GitHub]
function rangeCutoff(range){var d=new Date();if(range==='7d')d.setDate(d.getDate()-7);else if(range==='1m')d.setMonth(d.getMonth()-1);else if(range==='3m')d.setMonth(d.getMonth()-3);else if(range==='6m')d.setMonth(d.getMonth()-6);else if(range==='9m')d.setMonth(d.getMonth()-9);else if(range==='1y')d.setFullYear(d.getFullYear()-1);else if(range==='5y')d.setFullYear(d.getFullYear()-5);else if(rang … [line shortened here: 526 characters; full line on GitHub]
function oilStats(rows){var vals=[];rows.forEach(function(p){if(p.brentUSDperBarrel)vals.push(p.brentUSDperBarrel);if(p.wtiUSDperBarrel)vals.push(p.wtiUSDperBarrel)});var el=document.getElementById('oil-stats');if(!el)return;if(!vals.length){el.innerHTML='';return}var high=Math.max.apply(null,vals),low=Math.min.apply(null,vals),avg=vals.reduce(function(a,b){return a+b},0)/vals.length;var vol=avg … [line shortened here: 760 characters; full line on GitHub]
function drawOilTrend(geo){var canvas=document.getElementById('oil-trend-canvas');if(!canvas||!geo||!Array.isArray(geo.features))return;var ctx=canvas.getContext('2d'),range=document.getElementById('oil-range').value;var rows=geo.features.map(function(f){return f.properties||{}}).filter(function(p){return p.date&&(p.brentUSDperBarrel||p.wtiUSDperBarrel)});var cutoff=rangeCutoff(range);if(cutoff) … [line shortened here: 2,270 characters; full line on GitHub]
function bindOilTooltip(){var canvas=document.getElementById('oil-trend-canvas'),tip=document.getElementById('oil-tooltip');if(!canvas||!tip||canvas.dataset.tipBound)return;canvas.dataset.tipBound='1';function show(e){var rect=canvas.getBoundingClientRect(),clientX=(e.touches&&e.touches[0]?e.touches[0].clientX:e.clientX),rows=oilChartState.rows||[];if(!rows.length)return;var pad=(oilChartState.p … [line shortened here: 1,104 characters; full line on GitHub]
function render(data,fuel,ev,oilHistory){data=data||{};fuel=fuel||{};set('brent-price',data.brentUSDperBarrel==null?'—':'USD '+fmt(data.brentUSDperBarrel,2));set('wti-price',data.wtiUSDperBarrel==null?'—':'USD '+fmt(data.wtiUSDperBarrel,2));renderMetalCard('copper-price','copper',data);renderMetalCard('aluminium-price','aluminium',data);var latest=fuel.latest||{};set('petrol-price',latest.petrol … [line shortened here: 927 characters; full line on GitHub]
return{render:render,drawOilTrend:drawOilTrend};
})();
'''
expected_start = """window.V6StartApp=(function(){
function refreshLive(){var cfg=window.V6LiveConfig,load=window.V6LoadJson.loadJson;Promise.all([load(cfg.energy),load(cfg.price),load(cfg.commodities)]).then(function(r){var energy=r[0]||{},price=r[1]||{},commodities=r[2]||{};window.V6RenderLiveSnapshot.render(energy,price);window.V6RenderGenerationMix.render(energy);window.V6RenderCommodities.render(commodities)})}
function start(){refreshLive();setInterval(refreshLive,5*60*1000);if(window.V6ControlPriceHistory)window.V6ControlPriceHistory.start()}
document.addEventListener('DOMContentLoaded',start);
return{start:start,refreshLive:refreshLive};
})();
"""
if start_app != expected_start:
raise RuntimeError("V6 start app has changed. Regenerate this repair script against current file.")
start_app = """window.V6StartApp=(function(){
function refreshLive(){
var cfg=window.V6LiveConfig,load=window.V6LoadJson.loadJson;
Promise.all([load(cfg.energy),load(cfg.price),load(cfg.commodities),load(cfg.fuel),load(cfg.evPrices),load(cfg.oilHistory)]).then(function(r){
var energy=r[0]||{},price=r[1]||{},commodities=r[2]||{},fuel=r[3]||{},ev=r[4]||{},oilHistory=r[5]||null;
window.V6RenderLiveSnapshot.render(energy,price);
window.V6RenderGenerationMix.render(energy);
window.V6RenderCommodities.render(commodities,fuel,ev,oilHistory);
})
}
function start(){refreshLive();setInterval(refreshLive,5*60*1000);if(window.V6ControlPriceHistory)window.V6ControlPriceHistory.start()}
document.addEventListener('DOMContentLoaded',start);
return{start:start,refreshLive:refreshLive};
})();
"""
frequency_path.parent.mkdir(parents=True, exist_ok=True)
frequency = (ROOT / "uk_energy_tracking_v5/frequency-history-ui.js").read_text(encoding="utf-8")
frequency = frequency.replace("GlobalGrid2050 V5 frequency chart", "GlobalGrid2050 V6 frequency chart")
frequency = frequency.replace("/uk_energy_tracking_v5/", "/uk_energy_tracking_v6/")
index_path.write_text(index, encoding="utf-8")
css_path.write_text(css, encoding="utf-8")
config_path.write_text(config, encoding="utf-8")
commodities_path.write_text(commodities, encoding="utf-8")
start_path.write_text(start_app, encoding="utf-8")
frequency_path.write_text(frequency, encoding="utf-8")
for path, tokens in {
index_path: ["oil-trend-canvas", "petrol-price", "ev-rapid-price", "frequency-history-ui.js"],
config_path: ["oilHistory", "fuel", "evPrices", "frequencyCsv"],
commodities_path: ["renderFuelBreakdown", "renderEvPrices", "drawOilTrend"],
start_path: ["cfg.fuel", "cfg.evPrices", "cfg.oilHistory"],
frequency_path: ["grid-frequency-panel", "/uk_energy_tracking_v6/grid_frequency_history.csv"],
}.items():
text = path.read_text(encoding="utf-8")
for token in tokens:
if token not in text:
raise RuntimeError(f"Post repair assertion failed: {path} lacks {token}")
report_path.write_text("""# V6 Repair Report: Restore V5 Panels
Status: prepared by deterministic repair script.
## Scope
This repair restores the V5 oil trend, road fuel, EV placeholder and grid frequency panel wiring into the modular V6 page.
## Files changed by workflow execution
1. `uk_energy_tracking_v6/index.md`
2. `uk_energy_tracking_v6/styles/app.css`
3. `uk_energy_tracking_v6/live_data_pipeline/live-config.js`
4. `uk_energy_tracking_v6/commodity_price_signals/render_commodities/render_commodities.js`
5. `uk_energy_tracking_v6/app_bootstrap/start_v6_app/start_v6_app.js`
6. `uk_energy_tracking_v6/frequency_history/frequency-history-ui.js`
7. `uk_energy_tracking_v6/V6_REPAIR_RESTORE_V5_PANELS_REPORT.md`
## Explicit non scope
No fullscreen swipe was added.
No forecast logic was changed.
No V5 file was modified.
## Required maintainer test
Open `/uk_energy_tracking_v6/` and verify price chart, fullscreen, period arrows, generation mix, commodity cards, oil trend, road fuel, EV placeholders and frequency panel.
""", encoding="utf-8")
print("V6 restore V5 panels repair completed locally by script.")GlobalGrid2050 Test Add V8 Battery Energy Storage System (BESS) Geospatial Layout Drawing
A test in the scripts folder covering battery storage (BESS) and cables.
testglobalgrid2050 / scripts/test_add_v8_bess_geospatial_layout_drawing.py · lines 1–52 of 52 · Entry point
- What it does
- It tests battery storage (BESS) and cables. Uses libraries pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS), cables.
- Downstream impact
- Used directly by 2 files: GlobalGrid2050 Add V8 Battery Energy Storage System (BESS) Geospatial Layout Drawing Workflow (globalgrid2050); GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Add V8 Battery Energy Storage System (BESS) Geospatial Layout Drawing Workflow and GlobalGrid2050 Project Signals Acid Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Add V8 Battery Energy Storage System (BESS) Geospatial Layout Drawing Workflow (workflow run), run by GlobalGrid2050 Project Signals Acid Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_add_v8_bess_geospatial_layout_drawing.py:1-52 · blob 76ee71c0e1c18e863c94eaf630946b004fe044bc · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-gis-sld-financial-sandbox"
index = (APP / "index.html").read_text(encoding="utf-8")
css = (APP / "bess-gis-sld-financial-sandbox.css").read_text(encoding="utf-8")
js = (APP / "bess-gis-sld-financial-sandbox.js").read_text(encoding="utf-8")
report = (ROOT / "gridbot_reports" / "add_v8_bess_geospatial_layout_drawing.md").read_text(encoding="utf-8")
for token in [
"btn_draw_at_center",
"btn_reset_geo",
"btn_export_geojson",
"geo_rotation_deg",
"Draw BESS at map centre",
"Export GeoJSON",
]:
assert token in index, token
for token in [
"map-inline-input",
"map-inline-label",
]:
assert token in css, token
for token in [
"function metresToLngLat",
"function rotatePoint",
"function rectFeature",
"function buildBessGeoJsonAt",
"function ensureBessGeoLayers",
"function drawBessGeoLayoutAtMapCenter",
"function resetBessGeoLayout",
"function exportBessGeoJson",
"compound_boundary",
"bess_container",
"pcs_block",
"integrated_pcs_transformer",
"external_transformer",
"access_road",
"grid_export_point",
"dc_collection_path",
"not cable sizing",
]:
assert token in js, token
assert "No V7 files are modified" in report
assert "No cable sizing" in report
print("V8 BESS geospatial layout drawing checks passed.")GlobalGrid2050 Test Build V8 Battery Energy Storage System (BESS) GIS Single-Line Diagram (SLD) Financial…
A test in the scripts folder covering battery storage (BESS), solar and cables.
testglobalgrid2050 / scripts/test_build_v8_bess_gis_sld_financial_sandbox.py · lines 1–73 of 73 · Entry point
- What it does
- It tests battery storage (BESS), solar and cables. Uses libraries pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'sandbox'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: battery storage (BESS), solar, cables.
- Downstream impact
- Used directly by 2 files: GlobalGrid2050 Build V8 Battery Energy Storage System (BESS) GIS Single-Line Diagram (SLD) Financial… (globalgrid2050); GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Build V8 Battery Energy Storage System (BESS) GIS Single-Line Diagram (SLD) Financial… and GlobalGrid2050 Project Signals Acid Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Build V8 Battery Energy Storage System (BESS) GIS Single-Line Diagram (SLD) Financial… (workflow run), run by GlobalGrid2050 Project Signals Acid Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_build_v8_bess_gis_sld_financial_sandbox.py:1-73 · blob 9094c76be5d32662bc426e1624c51322b33a2853 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: experimental · users: none · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-gis-sld-financial-sandbox"
required = [
"index.html",
"bess-gis-sld-financial-sandbox.css",
"bess-gis-sld-financial-sandbox.js",
"README.md",
]
for name in required:
assert (APP / name).exists(), f"Missing {name}"
index = (APP / "index.html").read_text(encoding="utf-8")
css = (APP / "bess-gis-sld-financial-sandbox.css").read_text(encoding="utf-8")
js = (APP / "bess-gis-sld-financial-sandbox.js").read_text(encoding="utf-8")
readme = (APP / "README.md").read_text(encoding="utf-8")
launcher = (ROOT / "solar-bess-topology-v8" / "index.html").read_text(encoding="utf-8")
legacy = (ROOT / "solar-bess-topology-v8" / "bess-pcs-standalone" / "index.html").read_text(encoding="utf-8")
report = (ROOT / "gridbot_reports" / "build_v8_bess_gis_sld_financial_sandbox.md").read_text(encoding="utf-8")
for token in [
"BESS GIS SLD Financial Sandbox",
"grid_export_mw",
"duration_hours",
"energy_mwh",
"container_size",
"container_mwh",
"layout_mode",
"integrated",
"separated",
"distributed",
"corridor",
"central",
"hv_compound",
"capex_per_mwh",
"revenue_per_mw_year",
"maplibre-gl",
"bess_svg",
]:
assert token in index, token
for forbidden in [
"modules per string",
"PV module rating",
"string inverter",
]:
assert forbidden.lower() not in index.lower(), forbidden
for token in [
"function initMap",
"function syncEnergy",
"function calc",
"function drawLayout",
"BESS containers",
"provide",
"MWh",
"PCS",
"MW",
"Grid export",
]:
assert token in js, token
assert "Cable sizing" in readme
assert "does not handle cable sizing" in (ROOT / "solar-bess-topology-v8" / "README.md").read_text(encoding="utf-8")
assert "bess-gis-sld-financial-sandbox/index.html" in launcher
assert "refresh" in legacy and "bess-gis-sld-financial-sandbox" in legacy
assert "No V7 files are modified" in report
assert "svg-battery" in css
print("V8 BESS GIS SLD financial sandbox checks passed.")GlobalGrid2050 Test Create V8 Battery Energy Storage System (BESS) Electrical Topology Review
A test in the scripts folder covering battery storage (BESS) and solar.
testglobalgrid2050 / scripts/test_create_v8_bess_electrical_topology_review.py · lines 1–50 of 50 · Entry point
- What it does
- It tests battery storage (BESS) and solar. Uses libraries pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS), solar.
- Downstream impact
- Used directly by 2 files: GlobalGrid2050 Create V8 Battery Energy Storage System (BESS) Electrical Topology Review Workflow (globalgrid2050); GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Create V8 Battery Energy Storage System (BESS) Electrical Topology Review Workflow and GlobalGrid2050 Project Signals Acid Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Create V8 Battery Energy Storage System (BESS) Electrical Topology Review Workflow (workflow run), run by GlobalGrid2050 Project Signals Acid Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_create_v8_bess_electrical_topology_review.py:1-50 · blob 147fc87ba73c11de0f6dfe33be303c909f211aae · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-electrical-topology-review"
for name in ["index.html", "bess-electrical-topology-review.css", "bess-electrical-topology-review.js", "README.md"]:
assert (APP / name).exists(), f"Missing {name}"
index = (APP / "index.html").read_text(encoding="utf-8")
css = (APP / "bess-electrical-topology-review.css").read_text(encoding="utf-8")
js = (APP / "bess-electrical-topology-review.js").read_text(encoding="utf-8")
launcher = (ROOT / "solar-bess-topology-v8" / "index.html").read_text(encoding="utf-8")
readme = (ROOT / "solar-bess-topology-v8" / "README.md").read_text(encoding="utf-8")
report = (ROOT / "gridbot_reports" / "create_v8_bess_electrical_topology_review.md").read_text(encoding="utf-8")
for token in [
"BESS Electrical Topology Review",
"bess_power_mw",
"dc_voltage",
"parallel_sets",
"r_ohm_km",
"x_ohm_km",
"pcs_tx_arrangement",
"dc_imd",
"dc_leakage",
"reverse_current",
"protection_status",
"bess_scada",
]:
assert token in index, token
for token in [
"function updateBessTopology",
"function drawScada",
"out_total_dc_current",
"out_current_per_set",
"out_r_path",
"out_x_path",
"out_z_path",
"Protection coordination",
]:
assert token in js, token
assert "scada-dc" in css
assert "bess-electrical-topology-review/index.html" in launcher
assert "bess-electrical-topology-review/" in readme
assert "No V7 files are modified" in report
print("V8 BESS electrical topology review checks passed.")GlobalGrid2050 Test Create V8 Battery Energy Storage System (BESS) Pcs Standalone
A test in the scripts folder covering battery storage (BESS) and solar.
testglobalgrid2050 / scripts/test_create_v8_bess_pcs_standalone.py · lines 1–45 of 45 · Entry point
- What it does
- It tests battery storage (BESS) and solar. Uses libraries pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS), solar.
- Downstream impact
- Used directly by 2 files: GlobalGrid2050 Create V8 Battery Energy Storage System (BESS) Pcs Standalone Workflow (globalgrid2050); GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Create V8 Battery Energy Storage System (BESS) Pcs Standalone Workflow and GlobalGrid2050 Project Signals Acid Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Create V8 Battery Energy Storage System (BESS) Pcs Standalone Workflow (workflow run), run by GlobalGrid2050 Project Signals Acid Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_create_v8_bess_pcs_standalone.py:1-45 · blob 5e9d00194dbe04617bfe32087d290517465996f8 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-pcs-standalone"
required = [
"index.html",
"gis-sld-v5.css",
"gis-sld-v5-config.js",
"gis-sld-v5-helpers.js",
"gis-sld-v5-state.js",
"gis-sld-v5-substations.js",
"gis-sld-v5-map.js",
"gis-sld-v5-calculations.js",
"gis-sld-v5-finance.js",
"gis-sld-v5-ui-core.js",
"gis-sld-v5-drawing.js",
"gis-sld-v5-export.js",
"gis-sld-v5-ui.js",
]
missing = [name for name in required if not (APP / name).exists()]
assert not missing, "Missing copied V8 files: " + ", ".join(missing)
index = (APP / "index.html").read_text(encoding="utf-8")
launcher = (ROOT / "solar-bess-topology-v8" / "index.html").read_text(encoding="utf-8")
readme = (ROOT / "solar-bess-topology-v8" / "README.md").read_text(encoding="utf-8")
report = (ROOT / "gridbot_reports" / "create_v8_bess_pcs_standalone.md").read_text(encoding="utf-8")
assert "BESS PCS Standalone V8" in index
assert "id=\"bess_pcs_study_box\"" in index
assert "id=\"bess_power_mw\"" in index
assert "id=\"bess_dc_voltage\"" in index
assert "id=\"bess_parallel_sets\"" in index
assert "id=\"bess_out_total_current\"" in index
assert "id=\"bess_out_set_current\"" in index
assert "function updateBessPcsStudy" in index
assert index.count("id=\"bess_pcs_study_box\"") == 1
assert index.count("function updateBessPcsStudy") == 1
assert "bess-pcs-standalone/index.html" in launcher
assert "V7 is to remain stable" in readme
assert "BESS power MW / DC voltage" in report
print("V8 BESS PCS standalone creation checks passed.")GlobalGrid2050 Test Patch V8 Battery Energy Storage System (BESS) Tabs Small Step
A test in the scripts folder covering battery storage (BESS).
testglobalgrid2050 / scripts/test_patch_v8_bess_tabs_small_step.py · lines 1–58 of 58 · Entry point
- What it does
- It tests battery storage (BESS). Uses libraries pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS).
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Project Signals Acid Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Project Signals Acid Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_patch_v8_bess_tabs_small_step.py:1-58 · blob f02747d560bc72d9b9d7bcceb23d36203aa51527 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-gis-sld-financial-sandbox"
INDEX = APP / "index.html"
CSS = APP / "gis-sld-v5.css"
UI = APP / "gis-sld-v5-ui.js"
REPORT = ROOT / "gridbot_reports" / "patch_v8_bess_tabs_small_step.md"
for path in [INDEX, CSS, UI, REPORT]:
assert path.exists(), f"Missing {path}"
index = INDEX.read_text(encoding="utf-8")
css = CSS.read_text(encoding="utf-8")
ui = UI.read_text(encoding="utf-8")
report = REPORT.read_text(encoding="utf-8")
for token in [
'id="v8_bess_panel"',
'class="v8-bess-tabs"',
'data-v8-bess-tab="layout"',
'data-v8-bess-tab="pcs"',
'data-v8-bess-tab="finance"',
'data-v8-bess-tab="map"',
'data-v8-bess-tab="notes"',
'data-v8-bess-panel="layout"',
'data-v8-bess-panel="pcs"',
'data-v8-bess-panel="finance"',
'data-v8-bess-panel="map"',
'data-v8-bess-panel="notes"',
'bess_export_mw',
'bess_container_size',
'bess_layout_mode',
'btn_bess_draw_geo',
'btn_bess_export_geojson',
'tab-container v8-hidden-pv',
]:
assert token in index, token
for token in [
'GLOBALGRID2050 V8 BESS TABS SMALL STEP',
'.v8-bess-tabs',
'.v8-bess-tab-btn.active',
'.v8-bess-tab-panel.active',
]:
assert token in css, token
for token in [
'function v8InitBessTabsSmallStep',
'data-v8-bess-tab',
'data-v8-bess-panel',
'v8InitBessTabsSmallStep',
]:
assert token in ui, token
assert 'No V7 files are modified' in report
print('V8 BESS tabs small step checks passed.')GlobalGrid2050 Test Rebuild V8 Battery Energy Storage System (BESS) from V7 GIS Frame
A test in the scripts folder covering battery storage (BESS) and solar.
testglobalgrid2050 / scripts/test_rebuild_v8_bess_from_v7_gis_frame.py · lines 1–74 of 74 · Entry point
- What it does
- It tests battery storage (BESS) and solar. Uses libraries pathlib. Side effects: changes the web page (DOM); reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS), solar.
- Inputs & outputs
- Out: interactive map.
- Downstream impact
- Used directly by 2 files: GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050); GlobalGrid2050 Rebuild V8 Battery Energy Storage System (BESS) from V7 GIS Frame Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Project Signals Acid Workflow and GlobalGrid2050 Rebuild V8 Battery Energy Storage System (BESS) from V7 GIS Frame Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Project Signals Acid Workflow (workflow run), run by GlobalGrid2050 Rebuild V8 Battery Energy Storage System (BESS) from V7 GIS Frame Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_rebuild_v8_bess_from_v7_gis_frame.py:1-74 · blob 38d641e57875d833672b0f699abc3c484f598d0c · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-gis-sld-financial-sandbox"
required = [
"index.html",
"gis-sld-v5.css",
"gis-sld-v5-config.js",
"gis-sld-v5-helpers.js",
"gis-sld-v5-state.js",
"gis-sld-v5-substations.js",
"gis-sld-v5-map.js",
"gis-sld-v5-calculations.js",
"gis-sld-v5-finance.js",
"gis-sld-v5-ui-core.js",
"gis-sld-v5-drawing.js",
"gis-sld-v5-export.js",
"gis-sld-v5-ui.js",
"README.md",
]
for name in required:
assert (APP / name).exists(), f"Missing {name}"
index = (APP / "index.html").read_text(encoding="utf-8")
css = (APP / "gis-sld-v5.css").read_text(encoding="utf-8")
ui = (APP / "gis-sld-v5-ui.js").read_text(encoding="utf-8")
map_js = (APP / "gis-sld-v5-map.js").read_text(encoding="utf-8")
report = (ROOT / "gridbot_reports" / "rebuild_v8_bess_from_v7_gis_frame.md").read_text(encoding="utf-8")
launcher = (ROOT / "solar-bess-topology-v8" / "index.html").read_text(encoding="utf-8")
for token in [
"BESS GIS SLD Financial Sandbox V8",
"v8_bess_panel",
"bess_export_mw",
"bess_duration_h",
"bess_energy_mwh",
"bess_container_size",
"bess_layout_mode",
"bess_pcs_mw",
"btn_bess_draw_geo",
"btn_bess_export_geojson",
"maplibre-gl",
"gis-sld-v5-map.js",
]:
assert token in index, token
for token in [
"v8-bess-panel",
"v8-hidden-pv",
"v8-dev-label",
]:
assert token in css, token
for token in [
"V8 BESS geospatial drawing layer built on working V7 GIS frame",
"function v8BessCalc",
"function v8BuildBessGeoJson",
"function v8DrawBessAtMapCentre",
"function v8ExportBessGeoJson",
"v8-bess-layout",
"bess_container",
"integrated_pcs_transformer",
"grid_export_point",
"not cable sizing",
]:
assert token in ui, token
assert "new maplibregl.Map" in map_js or "maplibregl.Map" in map_js
assert "No V7 files are modified" in report
assert "bess-gis-sld-financial-sandbox/index.html" in launcher
print("V8 BESS rebuild from V7 GIS frame checks passed.")GlobalGrid2050 Test Restore V8 Battery Energy Storage System (BESS) MapLibre Standalone
A test in the scripts folder covering battery storage (BESS) and solar.
testglobalgrid2050 / scripts/test_restore_v8_bess_maplibre_standalone.py · lines 1–70 of 70 · Entry point
- What it does
- It tests battery storage (BESS) and solar. Uses libraries pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: battery storage (BESS), solar.
- Downstream impact
- Used directly by 2 files: GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050); GlobalGrid2050 Restore V8 Battery Energy Storage System (BESS) MapLibre Standalone Workflow (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Run by GlobalGrid2050 Project Signals Acid Workflow and GlobalGrid2050 Restore V8 Battery Energy Storage System (BESS) MapLibre Standalone Workflow.
- Application
- globalgrid2050 · scripts · test
- Uses
- pathlib
- Used by
- run by GlobalGrid2050 Project Signals Acid Workflow (workflow run), run by GlobalGrid2050 Restore V8 Battery Energy Storage System (BESS) MapLibre Standalone Workflow (workflow run)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/test_restore_v8_bess_maplibre_standalone.py:1-70 · blob 49e2ccca29ca1c30b90ce84fcc5a1df9afb0aabd · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = ROOT / "solar-bess-topology-v8" / "bess-gis-sld-financial-sandbox"
INDEX = APP / "index.html"
JS = APP / "bess-gis-sld-financial-sandbox.js"
CSS = APP / "bess-gis-sld-financial-sandbox.css"
REPORT = ROOT / "gridbot_reports" / "restore_v8_bess_maplibre_standalone.md"
for path in [INDEX, JS, CSS, REPORT]:
assert path.exists(), f"Missing {path}"
index = INDEX.read_text(encoding="utf-8")
js = JS.read_text(encoding="utf-8")
css = CSS.read_text(encoding="utf-8")
report = REPORT.read_text(encoding="utf-8")
# This must be the standalone BESS app, not the V7 PV GIS SLD clone.
for token in [
"BESS GIS SLD Financial Sandbox V8",
"maplibre-gl",
"bess-gis-sld-financial-sandbox.css",
"bess-gis-sld-financial-sandbox.js",
"data-tab=\"layout\"",
"data-tab=\"finance\"",
"data-tab=\"notes\"",
"btn_draw_at_center",
"btn_reset_geo",
"btn_export_geojson",
"geo_rotation_deg",
]:
assert token in index, token
for token in [
"buildBessGeoJsonAt",
"drawBessGeoLayoutAtMapCenter",
"ensureBessGeoLayers",
"bess_container",
"integrated_pcs_transformer",
"external_transformer",
"grid_export_point",
"dc_collection_path",
"not cable sizing",
"exportBessGeoJson",
]:
assert token in js, token
for token in [
".tabs",
".tab-panel",
"#map",
".map-toolbar",
]:
assert token in css, token
# Guard against the broken V7 frame copy returning here.
for forbidden in [
"gis-sld-v5-map.js",
"gis-sld-v5-ui.js",
"Solar Photovoltaic (PV)",
"tabbtn_string",
"tabbtn_central",
"v8-hidden-pv",
"target_dc_mwp",
]:
assert forbidden not in index, f"Forbidden V7 PV clone token in index: {forbidden}"
assert "f90d9e53965e83fd9a11b94e81ed23aefd3aef7f" in report
print("V8 BESS MapLibre standalone restore checks passed.")