Skip to content

Commit 5cef334

Browse files
committed
deploy: 612d57f
1 parent 1422679 commit 5cef334

3 files changed

Lines changed: 48 additions & 30 deletions

File tree

introduction/introduction_case_studies/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ <h1 id="epm-in-practice">EPM in Practice<a class="headerlink" href="#epm-in-prac
19411941
<p>As the World Bank's primary power sector planning tool, EPM has been applied in over 80 countries to support project teams, national utilities, and energy ministries across Africa, Asia, Latin America, and the Middle East.</p>
19421942
<hr />
19431943
<h2 id="coverage">Coverage<a class="headerlink" href="#coverage" title="Permanent link">&para;</a></h2>
1944-
<div style="display:inline-block; margin:0.1rem 0 0.7rem 0; padding:4px 11px; border:1px solid #d8b24a; border-radius:8px; background:#fcf6e6; font-size:0.66rem; font-style:italic; color:#7a5d1e;">
1944+
<div style="display:inline-block; margin:0.1rem 0 0.7rem 0; padding:3px 10px; border:1px solid #d8b24a; border-radius:8px; background:#fcf6e6; font-size:0.58rem; font-style:italic; color:#7a5d1e;">
19451945
→ Explore the data &amp; results interactively in
19461946
<a href="https://epm-data-explorer.vercel.app" target="_blank" rel="noopener" style="font-style:normal; font-weight:600; color:#1E6DB8;">EPM&nbsp;View</a>
19471947
&nbsp;·&nbsp;<span style="color:#a98a4a;">access required — ask the team</span>

run/run_data_sync/index.html

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,8 @@
20702070

20712071

20722072
<h1 id="publishing-syncing-data-dvc">Publishing &amp; Syncing Data (DVC)<a class="headerlink" href="#publishing-syncing-data-dvc" title="Permanent link">&para;</a></h1>
2073+
<style>.md-typeset { font-size: 0.8rem; }</style>
2074+
20732075
<p>EPM <strong>code</strong> is public, but the <strong>data</strong> (input CSVs, results) is kept in a <strong>private
20742076
store</strong> — not in this public repository. The repo only keeps tiny <strong>pointer files</strong>
20752077
(<code>*.dvc</code>); the real data lives in the store and is fetched on demand.</p>
@@ -2089,18 +2091,25 @@ <h2 id="the-idea-in-one-picture">The idea in one picture<a class="headerlink" hr
20892091
<hr />
20902092
<h2 id="1-set-up-your-machine-once">1. Set up your machine (once)<a class="headerlink" href="#1-set-up-your-machine-once" title="Permanent link">&para;</a></h2>
20912093
<p>You work in <strong>your clone of the EPM repo</strong> — the same folder you run EPM from.</p>
2092-
<p><strong>A. If you already run EPM on this machine</strong> (Python env ready) — just add the data tools:</p>
2093-
<p><div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="c1"># in your EPM Python environment (the one you use to run EPM)</span>
2094-
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>pip<span class="w"> </span>install<span class="w"> </span>-r<span class="w"> </span>requirements.txt
2094+
<div class="tabbed-set tabbed-alternate" data-tabs="1:2"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Already running EPM here</label><label for="__tabbed_1_2">Fresh machine</label></div>
2095+
<div class="tabbed-content">
2096+
<div class="tabbed-block">
2097+
<p>Your Python environment is ready — just add the data tools:
2098+
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>pip<span class="w"> </span>install<span class="w"> </span>-r<span class="w"> </span>requirements.txt
20952099
</code></pre></div>
2096-
This installs <strong>DVC</strong>, <code>s3fs</code>, and (on Windows) <code>pip-system-certs</code>.</p>
2097-
<p><strong>B. If it's a fresh machine</strong> — set EPM up first, then the line above:</p>
2100+
Installs <strong>DVC</strong>, <code>s3fs</code>, and (on Windows) <code>pip-system-certs</code>.</p>
2101+
</div>
2102+
<div class="tabbed-block">
2103+
<p>Set EPM up first, then install:
20982104
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/ESMAP-World-Bank-Group/EPM.git
20992105
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="nb">cd</span><span class="w"> </span>EPM
2100-
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>git<span class="w"> </span>checkout<span class="w"> </span>&lt;your-branch&gt;<span class="w"> </span><span class="c1"># e.g. blacksea_2026</span>
2101-
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a>conda<span class="w"> </span>activate<span class="w"> </span>&lt;your-epm-env&gt;<span class="w"> </span><span class="c1"># your EPM Python environment</span>
2106+
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>git<span class="w"> </span>checkout<span class="w"> </span>&lt;your-branch&gt;<span class="w"> </span><span class="c1"># e.g. blacksea_2026</span>
2107+
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a>conda<span class="w"> </span>activate<span class="w"> </span>&lt;your-epm-env&gt;<span class="w"> </span><span class="c1"># your EPM Python environment</span>
21022108
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a>pip<span class="w"> </span>install<span class="w"> </span>-r<span class="w"> </span>requirements.txt
2103-
</code></pre></div>
2109+
</code></pre></div></p>
2110+
</div>
2111+
</div>
2112+
</div>
21042113
<p><strong>Then (both cases) add your store keys — once:</strong></p>
21052114
<ol>
21062115
<li>Copy the template: <code>tools/.env.example</code><code>tools/.env</code></li>
@@ -2129,33 +2138,38 @@ <h2 id="2-is-your-model-already-on-the-store">2. Is your model already on the st
21292138
<h2 id="3-onboard-a-new-model-once-per-model">3. Onboard a new model (once per model)<a class="headerlink" href="#3-onboard-a-new-model-once-per-model" title="Permanent link">&para;</a></h2>
21302139
<p>This moves a model's data <strong>out of git</strong> into the store. Do it <strong>once</strong>, by whoever sets the
21312140
model up; afterwards everyone just uses <em>setup + publish/sync</em>.</p>
2132-
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="c1"># 1. Initialise DVC for the repo (once per repo)</span>
2133-
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>dvc<span class="w"> </span>init
2134-
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a>
2135-
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="c1"># 2. Point DVC at the store</span>
2136-
<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a>dvc<span class="w"> </span>remote<span class="w"> </span>add<span class="w"> </span>-d<span class="w"> </span>store<span class="w"> </span>s3://&lt;bucket&gt;/dvcstore
2137-
<a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a>dvc<span class="w"> </span>remote<span class="w"> </span>modify<span class="w"> </span>store<span class="w"> </span>endpointurl<span class="w"> </span>&lt;endpoint&gt;
2138-
<a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a>
2139-
<a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="c1"># 3. In .gitignore: remove the line that force-tracks your data folder,</span>
2140-
<a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="c1"># and add an exception for its pointer:</span>
2141-
<a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="c1"># !epm/input/data_&lt;model&gt;.dvc</span>
2142-
<a id="__codelineno-3-11" name="__codelineno-3-11" href="#__codelineno-3-11"></a>
2143-
<a id="__codelineno-3-12" name="__codelineno-3-12" href="#__codelineno-3-12"></a><span class="c1"># 4. Stop tracking the data in git (files stay on your disk), then hand it to DVC</span>
2144-
<a id="__codelineno-3-13" name="__codelineno-3-13" href="#__codelineno-3-13"></a>git<span class="w"> </span>rm<span class="w"> </span>-r<span class="w"> </span>--cached<span class="w"> </span>epm/input/data_&lt;model&gt;
2145-
<a id="__codelineno-3-14" name="__codelineno-3-14" href="#__codelineno-3-14"></a>dvc<span class="w"> </span>add<span class="w"> </span>epm/input/data_&lt;model&gt;<span class="w"> </span><span class="c1"># creates the .dvc pointer</span>
2141+
<p><strong>One command</strong> (from the repo root) — it asks for confirmation, then makes the change locally:</p>
2142+
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>powershell<span class="w"> </span>-File<span class="w"> </span>tools/setup_model.ps1<span class="w"> </span>data_&lt;model&gt;<span class="w"> </span><span class="c1"># e.g. data_sapp</span>
21462143
</code></pre></div>
2147-
<p>Then <strong>publish</strong> (step 4). Finally, to make <strong>EPM View</strong> read this model from the store, add
2148-
its branch name to <code>R2_BRANCHES</code> in <code>src/utils/epmFetch.js</code> of the <code>epm-data-explorer</code> repo.</p>
2144+
<p>Then <strong>review</strong> (<code>git status</code>) and <strong>publish</strong> (double-click <code>Publish.bat</code>). Finally, to make
2145+
<strong>EPM View</strong> show this model, add its branch name to <code>R2_BRANCHES</code> in <code>src/utils/epmFetch.js</code>
2146+
of the <code>epm-data-explorer</code> repo.</p>
2147+
<details class="info">
2148+
<summary>What <code>setup_model.ps1</code> does under the hood (the manual steps)</summary>
2149+
<p>The script automates exactly these — your files <strong>stay on disk</strong>, and it commits/pushes
2150+
nothing (you review, then publish):</p>
2151+
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="c1"># 1. Initialise DVC for the repo (once per repo)</span>
2152+
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a>dvc<span class="w"> </span>init
2153+
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="c1"># 2. Point DVC at the store (once — already set in this repo&#39;s .dvc/config)</span>
2154+
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a>dvc<span class="w"> </span>remote<span class="w"> </span>add<span class="w"> </span>-d<span class="w"> </span>store<span class="w"> </span>s3://&lt;bucket&gt;/dvcstore
2155+
<a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a>dvc<span class="w"> </span>remote<span class="w"> </span>modify<span class="w"> </span>store<span class="w"> </span>endpointurl<span class="w"> </span>&lt;endpoint&gt;
2156+
<a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><span class="c1"># 3. .gitignore: drop the whitelist of the data folder, keep its pointer tracked</span>
2157+
<a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="c1"># !epm/input/data_&lt;model&gt;.dvc</span>
2158+
<a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="c1"># 4. Stop tracking the data in git (files stay), then hand the folder to DVC</span>
2159+
<a id="__codelineno-4-9" name="__codelineno-4-9" href="#__codelineno-4-9"></a>git<span class="w"> </span>rm<span class="w"> </span>-r<span class="w"> </span>--cached<span class="w"> </span>epm/input/data_&lt;model&gt;
2160+
<a id="__codelineno-4-10" name="__codelineno-4-10" href="#__codelineno-4-10"></a>dvc<span class="w"> </span>add<span class="w"> </span>epm/input/data_&lt;model&gt;<span class="w"> </span><span class="c1"># creates the .dvc pointer</span>
2161+
</code></pre></div>
2162+
</details>
21492163
<hr />
21502164
<h2 id="4-publish-your-data">4. Publish your data<a class="headerlink" href="#4-publish-your-data" title="Permanent link">&para;</a></h2>
21512165
<p>Whenever you change inputs (or want to show new results), <strong>publish in one action</strong>:</p>
2152-
<div class="tabbed-set tabbed-alternate" data-tabs="1:2"><input checked="checked" id="__tabbed_1_1" name="__tabbed_1" type="radio" /><input id="__tabbed_1_2" name="__tabbed_1" type="radio" /><div class="tabbed-labels"><label for="__tabbed_1_1">Windows</label><label for="__tabbed_1_2">Command line</label></div>
2166+
<div class="tabbed-set tabbed-alternate" data-tabs="2:2"><input checked="checked" id="__tabbed_2_1" name="__tabbed_2" type="radio" /><input id="__tabbed_2_2" name="__tabbed_2" type="radio" /><div class="tabbed-labels"><label for="__tabbed_2_1">Windows</label><label for="__tabbed_2_2">Command line</label></div>
21532167
<div class="tabbed-content">
21542168
<div class="tabbed-block">
21552169
<p>Double-click <strong><code>Publish.bat</code></strong> at the repo root.</p>
21562170
</div>
21572171
<div class="tabbed-block">
2158-
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>powershell<span class="w"> </span>-File<span class="w"> </span>tools/publish.ps1
2172+
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>powershell<span class="w"> </span>-File<span class="w"> </span>tools/publish.ps1
21592173
</code></pre></div>
21602174
</div>
21612175
</div>
@@ -2202,10 +2216,10 @@ <h2 id="4-publish-your-data">4. Publish your data<a class="headerlink" href="#4-
22022216
</div>
22032217
<hr />
22042218
<h2 id="5-get-the-data-back-any-machine-the-server">5. Get the data back (any machine / the server)<a class="headerlink" href="#5-get-the-data-back-any-machine-the-server" title="Permanent link">&para;</a></h2>
2205-
<div class="tabbed-set tabbed-alternate" data-tabs="2:2"><input checked="checked" id="__tabbed_2_1" name="__tabbed_2" type="radio" /><input id="__tabbed_2_2" name="__tabbed_2" type="radio" /><div class="tabbed-labels"><label for="__tabbed_2_1">Server (Linux)</label><label for="__tabbed_2_2">Windows</label></div>
2219+
<div class="tabbed-set tabbed-alternate" data-tabs="3:2"><input checked="checked" id="__tabbed_3_1" name="__tabbed_3" type="radio" /><input id="__tabbed_3_2" name="__tabbed_3" type="radio" /><div class="tabbed-labels"><label for="__tabbed_3_1">Server (Linux)</label><label for="__tabbed_3_2">Windows</label></div>
22062220
<div class="tabbed-content">
22072221
<div class="tabbed-block">
2208-
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>bash<span class="w"> </span>tools/sync.sh
2222+
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>bash<span class="w"> </span>tools/sync.sh
22092223
</code></pre></div>
22102224
</div>
22112225
<div class="tabbed-block">
@@ -2246,6 +2260,10 @@ <h2 id="files-in-tools">Files (in <code>tools/</code>)<a class="headerlink" href
22462260
<td>get code + data (Windows / server)</td>
22472261
</tr>
22482262
<tr>
2263+
<td><code>setup_model.ps1</code></td>
2264+
<td>onboard a new model's data to the store (one-time, step 3)</td>
2265+
</tr>
2266+
<tr>
22492267
<td><code>upload_to_r2.py</code>, <code>upload_output_view_to_r2.py</code></td>
22502268
<td>upload the readable copies</td>
22512269
</tr>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)