Skip to content

Commit

Permalink
Deploying to gh-pages from @ ec9c02f 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Apr 25, 2024
1 parent a04b739 commit 5115d1b
Show file tree
Hide file tree
Showing 9 changed files with 1,489 additions and 34 deletions.
17 changes: 14 additions & 3 deletions _modules/ccc/get_taxcalc_rates.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ <h1>Source code for ccc.get_taxcalc_rates</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">get_calculator</span><span class="p">(</span>
<span class="n">baseline</span><span class="p">,</span>
<span class="n">calculator_start_year</span><span class="p">,</span>
<span class="n">baseline_policy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">reform</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">data</span><span class="o">=</span><span class="s2">&quot;cps&quot;</span><span class="p">,</span>
<span class="n">gfactors</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
Expand All @@ -397,6 +398,7 @@ <h1>Source code for ccc.get_taxcalc_rates</h1><div class="highlight"><pre>
<span class="sd"> Args:</span>
<span class="sd"> baseline (bool): `True` if baseline tax policy</span>
<span class="sd"> calculator_start_year (integer): first year of budget window</span>
<span class="sd"> baseline_policy (dictionary): IIT baseline parameters</span>
<span class="sd"> reform (dictionary): IIT reform parameters</span>
<span class="sd"> data (string or Pandas DataFrame): path to file or DataFrame</span>
<span class="sd"> for Tax-Calculator Records object (optional)</span>
Expand Down Expand Up @@ -430,10 +432,14 @@ <h1>Source code for ccc.get_taxcalc_rates</h1><div class="highlight"><pre>
<span class="n">records1</span> <span class="o">=</span> <span class="n">Records</span><span class="p">()</span> <span class="c1"># pragma: no cover</span>

<span class="k">if</span> <span class="n">baseline</span><span class="p">:</span>
<span class="c1"># Should not be a reform if baseline is True</span>
<span class="k">assert</span> <span class="ow">not</span> <span class="n">reform</span>
<span class="k">if</span> <span class="p">(</span>
<span class="n">baseline_policy</span>
<span class="p">):</span> <span class="c1"># if something other than current law policy baseline</span>
<span class="n">update_policy</span><span class="p">(</span><span class="n">policy1</span><span class="p">,</span> <span class="n">baseline_policy</span><span class="p">)</span>

<span class="k">if</span> <span class="ow">not</span> <span class="n">baseline</span><span class="p">:</span>
<span class="k">if</span> <span class="n">baseline_policy</span><span class="p">:</span> <span class="c1"># update baseline policy to layer reform on top</span>
<span class="n">update_policy</span><span class="p">(</span><span class="n">policy1</span><span class="p">,</span> <span class="n">baseline_policy</span><span class="p">)</span>
<span class="n">update_policy</span><span class="p">(</span><span class="n">policy1</span><span class="p">,</span> <span class="n">reform</span><span class="p">)</span>

<span class="c1"># the default set up increments year to 2013</span>
Expand All @@ -454,7 +460,11 @@ <h1>Source code for ccc.get_taxcalc_rates</h1><div class="highlight"><pre>
<div class="viewcode-block" id="get_rates">
<a class="viewcode-back" href="../../content/api/get_taxcalc_rates.html#ccc.get_taxcalc_rates.get_rates">[docs]</a>
<span class="k">def</span> <span class="nf">get_rates</span><span class="p">(</span>
<span class="n">baseline</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">start_year</span><span class="o">=</span><span class="n">DEFAULT_START_YEAR</span><span class="p">,</span> <span class="n">reform</span><span class="o">=</span><span class="p">{},</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;cps&quot;</span>
<span class="n">baseline</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">start_year</span><span class="o">=</span><span class="n">DEFAULT_START_YEAR</span><span class="p">,</span>
<span class="n">baseline_policy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">reform</span><span class="o">=</span><span class="p">{},</span>
<span class="n">data</span><span class="o">=</span><span class="s2">&quot;cps&quot;</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This function computes weighted average marginal tax rates using</span>
Expand All @@ -473,6 +483,7 @@ <h1>Source code for ccc.get_taxcalc_rates</h1><div class="highlight"><pre>
<span class="n">calc1</span> <span class="o">=</span> <span class="n">get_calculator</span><span class="p">(</span>
<span class="n">baseline</span><span class="o">=</span><span class="n">baseline</span><span class="p">,</span>
<span class="n">calculator_start_year</span><span class="o">=</span><span class="n">start_year</span><span class="p">,</span>
<span class="n">baseline_policy</span><span class="o">=</span><span class="n">baseline_policy</span><span class="p">,</span>
<span class="n">reform</span><span class="o">=</span><span class="n">reform</span><span class="p">,</span>
<span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
<span class="p">)</span>
Expand Down
8 changes: 7 additions & 1 deletion _modules/ccc/parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ <h1>Source code for ccc.parameters</h1><div class="highlight"><pre>
<span class="n">baseline</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">year</span><span class="o">=</span><span class="n">DEFAULT_START_YEAR</span><span class="p">,</span>
<span class="n">call_tc</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">baseline_policy</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">iit_reform</span><span class="o">=</span><span class="p">{},</span>
<span class="n">data</span><span class="o">=</span><span class="s2">&quot;cps&quot;</span><span class="p">,</span>
<span class="p">):</span>
Expand All @@ -412,6 +413,7 @@ <h1>Source code for ccc.parameters</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">test</span> <span class="o">=</span> <span class="n">test</span>
<span class="bp">self</span><span class="o">.</span><span class="n">baseline</span> <span class="o">=</span> <span class="n">baseline</span>
<span class="bp">self</span><span class="o">.</span><span class="n">year</span> <span class="o">=</span> <span class="n">year</span>
<span class="bp">self</span><span class="o">.</span><span class="n">baseline_policy</span> <span class="o">=</span> <span class="n">baseline_policy</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iit_reform</span> <span class="o">=</span> <span class="n">iit_reform</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span>
<span class="c1"># initialize parameter values from JSON</span>
Expand All @@ -435,7 +437,11 @@ <h1>Source code for ccc.parameters</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">call_tc</span><span class="p">:</span>
<span class="c1"># Find individual income tax rates from Tax-Calculator</span>
<span class="n">indiv_rates</span> <span class="o">=</span> <span class="n">get_rates</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">baseline</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">year</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">iit_reform</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span>
<span class="bp">self</span><span class="o">.</span><span class="n">baseline</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">year</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">baseline_policy</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">iit_reform</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tau_pt</span> <span class="o">=</span> <span class="n">indiv_rates</span><span class="p">[</span><span class="s2">&quot;tau_pt&quot;</span><span class="p">]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tau_div</span> <span class="o">=</span> <span class="n">indiv_rates</span><span class="p">[</span><span class="s2">&quot;tau_div&quot;</span><span class="p">]</span>
Expand Down
Loading

0 comments on commit 5115d1b

Please sign in to comment.