You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: introduction/introduction_case_studies/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1941,7 +1941,7 @@ <h1 id="epm-in-practice">EPM in Practice<a class="headerlink" href="#epm-in-prac
1941
1941
<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>
Copy file name to clipboardExpand all lines: run/run_data_sync/index.html
+46-28Lines changed: 46 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -2070,6 +2070,8 @@
2070
2070
2071
2071
2072
2072
<h1id="publishing-syncing-data-dvc">Publishing & Syncing Data (DVC)<aclass="headerlink" href="#publishing-syncing-data-dvc" title="Permanent link">¶</a></h1>
2073
+
<style>.md-typeset { font-size:0.8rem; }</style>
2074
+
2073
2075
<p>EPM <strong>code</strong> is public, but the <strong>data</strong> (input CSVs, results) is kept in a <strong>private
2074
2076
store</strong> — not in this public repository. The repo only keeps tiny <strong>pointer files</strong>
2075
2077
(<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
2089
2091
<hr/>
2090
2092
<h2id="1-set-up-your-machine-once">1. Set up your machine (once)<aclass="headerlink" href="#1-set-up-your-machine-once" title="Permanent link">¶</a></h2>
2091
2093
<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><divclass="highlight"><pre><span></span><code><aid="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><spanclass="c1"># in your EPM Python environment (the one you use to run EPM)</span>
<aid="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>git<spanclass="w"></span>checkout<spanclass="w"></span><your-branch><spanclass="w"></span><spanclass="c1"># e.g. blacksea_2026</span>
2101
-
<aid="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a>conda<spanclass="w"></span>activate<spanclass="w"></span><your-epm-env><spanclass="w"></span><spanclass="c1"># your EPM Python environment</span>
2106
+
<aid="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>git<spanclass="w"></span>checkout<spanclass="w"></span><your-branch><spanclass="w"></span><spanclass="c1"># e.g. blacksea_2026</span>
2107
+
<aid="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a>conda<spanclass="w"></span>activate<spanclass="w"></span><your-epm-env><spanclass="w"></span><spanclass="c1"># your EPM Python environment</span>
<p><strong>Then (both cases) add your store keys — once:</strong></p>
2105
2114
<ol>
2106
2115
<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
2129
2138
<h2id="3-onboard-a-new-model-once-per-model">3. Onboard a new model (once per model)<aclass="headerlink" href="#3-onboard-a-new-model-once-per-model" title="Permanent link">¶</a></h2>
2130
2139
<p>This moves a model's data <strong>out of git</strong> into the store. Do it <strong>once</strong>, by whoever sets the
2131
2140
model up; afterwards everyone just uses <em>setup + publish/sync</em>.</p>
2132
-
<divclass="highlight"><pre><span></span><code><aid="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><spanclass="c1"># 1. Initialise DVC for the repo (once per repo)</span>
<aid="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><spanclass="c1"># 3. In .gitignore: remove the line that force-tracks your data folder,</span>
2140
-
<aid="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><spanclass="c1"># and add an exception for its pointer:</span>
<aid="__codelineno-3-12" name="__codelineno-3-12" href="#__codelineno-3-12"></a><spanclass="c1"># 4. Stop tracking the data in git (files stay on your disk), then hand it to DVC</span>
<aid="__codelineno-3-14" name="__codelineno-3-14" href="#__codelineno-3-14"></a>dvc<spanclass="w"></span>add<spanclass="w"></span>epm/input/data_<model><spanclass="w"></span><spanclass="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
+
<divclass="highlight"><pre><span></span><code><aid="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>powershell<spanclass="w"></span>-File<spanclass="w"></span>tools/setup_model.ps1<spanclass="w"></span>data_<model><spanclass="w"></span><spanclass="c1"># e.g. data_sapp</span>
2146
2143
</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
+
<detailsclass="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
+
<divclass="highlight"><pre><span></span><code><aid="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><spanclass="c1"># 1. Initialise DVC for the repo (once per repo)</span>
<aid="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><spanclass="c1"># 2. Point DVC at the store (once — already set in this repo's .dvc/config)</span>
<aid="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><spanclass="c1"># 3. .gitignore: drop the whitelist of the data folder, keep its pointer tracked</span>
<aid="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><spanclass="c1"># 4. Stop tracking the data in git (files stay), then hand the folder to DVC</span>
<h2id="5-get-the-data-back-any-machine-the-server">5. Get the data back (any machine / the server)<aclass="headerlink" href="#5-get-the-data-back-any-machine-the-server" title="Permanent link">¶</a></h2>
0 commit comments