Skip to content

Commit

Permalink
Deploying to gh-pages from @ 6f13113 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Dec 5, 2023
1 parent 805252a commit 7e6277f
Show file tree
Hide file tree
Showing 19 changed files with 2,144 additions and 332 deletions.
1,778 changes: 1,773 additions & 5 deletions _sources/model/validation.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/income-sources.html

Large diffs are not rendered by default.

80 changes: 40 additions & 40 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,76 +283,76 @@ <h3>Baseline estimation<a class="headerlink" href="#baseline-estimation" title="
</thead>
<tbody>
<tr>
<th>SOUTH_EAST</th>
<td>10.7</td>
<td>36.7</td>
<th>LONDON</th>
<td>12.1</td>
<td>37.6</td>
<td>9.1</td>
</tr>
<tr>
<th>LONDON</th>
<td>11.9</td>
<td>41.4</td>
<td>9.0</td>
<th>SOUTH_EAST</th>
<td>10.5</td>
<td>46.6</td>
<td>9.1</td>
</tr>
<tr>
<th>NORTH_WEST</th>
<td>6.9</td>
<td>17.9</td>
<td>7.2</td>
<td>6.7</td>
<td>28.5</td>
<td>7.4</td>
</tr>
<tr>
<th>EAST_OF_ENGLAND</th>
<td>6.4</td>
<td>19.1</td>
<th>SCOTLAND</th>
<td>2.4</td>
<td>10.5</td>
<td>6.1</td>
</tr>
<tr>
<th>WEST_MIDLANDS</th>
<td>5.8</td>
<td>21.3</td>
<td>5.8</td>
<td>4.7</td>
<td>18.3</td>
<td>5.9</td>
</tr>
<tr>
<th>SOUTH_WEST</th>
<td>5.0</td>
<td>17.7</td>
<td>5.5</td>
<th>EAST_OF_ENGLAND</th>
<td>6.5</td>
<td>24.6</td>
<td>5.9</td>
</tr>
<tr>
<th>YORKSHIRE</th>
<td>5.0</td>
<td>13.4</td>
<td>5.4</td>
<td>4.2</td>
<td>13.0</td>
<td>5.6</td>
</tr>
<tr>
<th>SCOTLAND</th>
<td>5.2</td>
<td>16.2</td>
<td>5.3</td>
<th>SOUTH_WEST</th>
<td>5.6</td>
<td>24.8</td>
<td>5.4</td>
</tr>
<tr>
<th>EAST_MIDLANDS</th>
<td>3.6</td>
<td>11.8</td>
<td>4.8</td>
<td>4.2</td>
<td>15.0</td>
<td>4.7</td>
</tr>
<tr>
<th>WALES</th>
<td>2.3</td>
<td>6.6</td>
<td>3.0</td>
<td>0.6</td>
<td>5.5</td>
<td>3.1</td>
</tr>
<tr>
<th>NORTH_EAST</th>
<td>2.3</td>
<td>5.3</td>
<td>2.6</td>
<td>2.2</td>
<td>5.9</td>
<td>2.7</td>
</tr>
<tr>
<th>NORTHERN_IRELAND</th>
<td>1.3</td>
<td>3.8</td>
<td>1.8</td>
<td>1.5</td>
<td>3.7</td>
<td>2.1</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -393,7 +393,7 @@ <h3>Reform evaluation<a class="headerlink" href="#reform-evaluation" title="Perm
</div>
</details>
<div class="cell_output docutils container">
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&#39;Revenue: £16.4bn&#39;
<div class="output text_plain highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>&#39;Revenue: £15.4bn&#39;
</pre></div>
</div>
</div>
Expand Down
39 changes: 17 additions & 22 deletions model/validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ <h1>Validation<a class="headerlink" href="#validation" title="Permalink to this
<span class="p">)</span>

<span class="kn">import</span> <span class="nn">plotly.express</span> <span class="k">as</span> <span class="nn">px</span>
<span class="kn">from</span> <span class="nn">policyengine_core.charts</span> <span class="kn">import</span> <span class="n">format_fig</span><span class="p">,</span> <span class="n">BLUE_COLOR_SCALE</span><span class="p">,</span> <span class="n">GRAY</span>
<span class="kn">from</span> <span class="nn">policyengine_core.charts</span> <span class="kn">import</span> <span class="n">format_fig</span><span class="p">,</span> <span class="n">BLUE_COLOUR_SCALE</span><span class="p">,</span> <span class="n">GRAY</span>

<span class="n">fig</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">px</span><span class="o">.</span><span class="n">bar</span><span class="p">(</span>
Expand All @@ -467,9 +467,9 @@ <h1>Validation<a class="headerlink" href="#validation" title="Permalink to this
<span class="n">color_discrete_map</span><span class="o">=</span><span class="p">{</span>
<span class="s2">&quot;Official&quot;</span><span class="p">:</span> <span class="n">GRAY</span><span class="p">,</span>
<span class="c1"># &quot;Official (error)&quot;: GRAY,</span>
<span class="s2">&quot;PolicyEngine&quot;</span><span class="p">:</span> <span class="n">BLUE_COLOR_SCALE</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span>
<span class="s2">&quot;PolicyEngine&quot;</span><span class="p">:</span> <span class="n">BLUE_COLOUR_SCALE</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span>
<span class="c1"># &quot;PolicyEngine (error)&quot;: BLUE_COLOR_SCALE[3],</span>
<span class="s2">&quot;UKMOD&quot;</span><span class="p">:</span> <span class="n">BLUE_COLOR_SCALE</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="s2">&quot;UKMOD&quot;</span><span class="p">:</span> <span class="n">BLUE_COLOUR_SCALE</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="c1"># &quot;UKMOD (error)&quot;: BLUE_COLOR_SCALE[0],</span>
<span class="p">},</span>
<span class="p">)</span>
Expand All @@ -490,25 +490,20 @@ <h1>Validation<a class="headerlink" href="#validation" title="Permalink to this
</details>
<div class="cell_output docutils container">
<div class="output traceback highlight-ipythontb notranslate"><div class="highlight"><pre><span></span><span class="gt">---------------------------------------------------------------------------</span>
<span class="ne">ImportError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
<span class="n">Cell</span> <span class="n">In</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">line</span> <span class="mi">222</span>
<span class="g g-Whitespace"> </span><span class="mi">203</span> <span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">concat</span><span class="p">(</span>
<span class="g g-Whitespace"> </span><span class="mi">204</span> <span class="p">[</span>
<span class="g g-Whitespace"> </span><span class="mi">205</span> <span class="n">df</span><span class="p">,</span>
<span class="p">(</span><span class="o">...</span><span class="p">)</span>
<span class="g g-Whitespace"> </span><span class="mi">218</span> <span class="p">]</span>
<span class="g g-Whitespace"> </span><span class="mi">219</span> <span class="p">)</span>
<span class="g g-Whitespace"> </span><span class="mi">221</span> <span class="kn">import</span> <span class="nn">plotly.express</span> <span class="k">as</span> <span class="nn">px</span>
<span class="ne">--&gt; </span><span class="mi">222</span> <span class="kn">from</span> <span class="nn">policyengine_core.charts</span> <span class="kn">import</span> <span class="n">format_fig</span><span class="p">,</span> <span class="n">BLUE_COLOR_SCALE</span><span class="p">,</span> <span class="n">GRAY</span>
<span class="g g-Whitespace"> </span><span class="mi">224</span> <span class="n">fig</span> <span class="o">=</span> <span class="p">(</span>
<span class="g g-Whitespace"> </span><span class="mi">225</span> <span class="n">px</span><span class="o">.</span><span class="n">bar</span><span class="p">(</span>
<span class="g g-Whitespace"> </span><span class="mi">226</span> <span class="n">df</span><span class="p">[</span><span class="o">~</span><span class="n">df</span><span class="o">.</span><span class="n">error</span><span class="p">][::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">sort_values</span><span class="p">([</span><span class="s2">&quot;year&quot;</span><span class="p">,</span> <span class="s2">&quot;value&quot;</span><span class="p">]),</span>
<span class="p">(</span><span class="o">...</span><span class="p">)</span>
<span class="g g-Whitespace"> </span><span class="mi">250</span> <span class="o">.</span><span class="n">update_traces</span><span class="p">(</span><span class="n">hovertemplate</span><span class="o">=</span><span class="s2">&quot;%</span><span class="si">{customdata[0]}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="g g-Whitespace"> </span><span class="mi">251</span> <span class="p">)</span>
<span class="g g-Whitespace"> </span><span class="mi">252</span> <span class="n">fig</span> <span class="o">=</span> <span class="n">format_fig</span><span class="p">(</span><span class="n">fig</span><span class="p">)</span>

<span class="ne">ImportError</span>: cannot import name &#39;BLUE_COLOR_SCALE&#39; from &#39;policyengine_core.charts&#39; (/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/policyengine_core/charts/__init__.py)
<span class="ne">ModuleNotFoundError</span><span class="g g-Whitespace"> </span>Traceback (most recent call last)
<span class="n">Cell</span> <span class="n">In</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">line</span> <span class="mi">103</span>
<span class="g g-Whitespace"> </span><span class="mi">96</span> <span class="k">def</span> <span class="nf">estimate</span><span class="p">(</span><span class="n">variable</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="g g-Whitespace"> </span><span class="mi">97</span> <span class="k">return</span> <span class="p">[</span>
<span class="g g-Whitespace"> </span><span class="mi">98</span> <span class="n">sim</span><span class="o">.</span><span class="n">calculate</span><span class="p">(</span><span class="n">variable</span><span class="p">,</span> <span class="n">period</span><span class="o">=</span><span class="n">year</span><span class="p">,</span> <span class="n">map_to</span><span class="o">=</span><span class="s2">&quot;household&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span> <span class="o">/</span> <span class="mf">1e9</span>
<span class="nn"> 99 for year</span> in <span class="ni">range</span><span class="nt">(2023, 2026)</span>
<span class="g g-Whitespace"> </span><span class="mi">100</span> <span class="p">]</span>
<span class="ne">--&gt; </span><span class="mi">103</span> <span class="kn">from</span> <span class="nn">policyengine_uk.data.datasets.frs.calibration.loss</span> <span class="kn">import</span> <span class="p">(</span>
<span class="g g-Whitespace"> </span><span class="mi">104</span> <span class="n">calibration_parameters</span><span class="p">,</span>
<span class="g g-Whitespace"> </span><span class="mi">105</span> <span class="p">)</span>
<span class="g g-Whitespace"> </span><span class="mi">106</span> <span class="kn">from</span> <span class="nn">policyengine_core.parameters</span> <span class="kn">import</span> <span class="n">get_parameter</span>
<span class="g g-Whitespace"> </span><span class="mi">109</span> <span class="k">def</span> <span class="nf">official_estimate</span><span class="p">(</span><span class="n">parameter</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>

<span class="ne">ModuleNotFoundError</span>: No module named &#39;policyengine_uk.data.datasets.frs.calibration.loss&#39;
</pre></div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions programs/contrib/ubi-center/carbon-tax.html

Large diffs are not rendered by default.

Loading

0 comments on commit 7e6277f

Please sign in to comment.