Skip to content

Commit

Permalink
Deploying to gh-pages from @ 02d84f7 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 6, 2025
1 parent b10f93c commit 4f9ab10
Show file tree
Hide file tree
Showing 66 changed files with 846 additions and 723 deletions.
2 changes: 1 addition & 1 deletion _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<link href="../_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />

<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/styles/sphinx-book-theme.css?v=a3416100" />
<link rel="stylesheet" type="text/css" href="../_static/togglebutton.css?v=13237357" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
Expand Down
106 changes: 53 additions & 53 deletions _modules/taxcalc/calcfunctions.html

Large diffs are not rendered by default.

165 changes: 83 additions & 82 deletions _modules/taxcalc/calculator.html

Large diffs are not rendered by default.

39 changes: 22 additions & 17 deletions _modules/taxcalc/consumption.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<link href="../../_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />

<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../../_static/styles/sphinx-book-theme.css?v=a3416100" />
<link rel="stylesheet" type="text/css" href="../../_static/togglebutton.css?v=13237357" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
Expand Down Expand Up @@ -400,15 +400,15 @@ <h1>Source code for taxcalc.consumption</h1><div class="highlight"><pre>
<span class="c1"># pycodestyle consumption.py</span>
<span class="c1"># pylint --disable=locally-disabled consumption.py</span>

<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">taxcalc.parameters</span> <span class="kn">import</span> <span class="n">Parameters</span>
<span class="kn">from</span> <span class="nn">taxcalc.policy</span> <span class="kn">import</span> <span class="n">Policy</span>
<span class="kn">from</span> <span class="nn">taxcalc.records</span> <span class="kn">import</span> <span class="n">Records</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">os</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">taxcalc.parameters</span><span class="w"> </span><span class="kn">import</span> <span class="n">Parameters</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">taxcalc.policy</span><span class="w"> </span><span class="kn">import</span> <span class="n">Policy</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">taxcalc.records</span><span class="w"> </span><span class="kn">import</span> <span class="n">Records</span>


<div class="viewcode-block" id="Consumption">
<a class="viewcode-back" href="../../api/consumption.html#taxcalc.consumption.Consumption">[docs]</a>
<span class="k">class</span> <span class="nc">Consumption</span><span class="p">(</span><span class="n">Parameters</span><span class="p">):</span>
<span class="k">class</span><span class="w"> </span><span class="nc">Consumption</span><span class="p">(</span><span class="n">Parameters</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Consumption is a subclass of the abstract Parameters class, and</span>
<span class="sd"> therefore, inherits its methods (none of which are shown here).</span>
Expand All @@ -429,15 +429,15 @@ <h1>Source code for taxcalc.consumption</h1><div class="highlight"><pre>
<span class="n">DEFAULTS_FILE_NAME</span> <span class="o">=</span> <span class="s1">&#39;consumption.json&#39;</span>
<span class="n">DEFAULTS_FILE_PATH</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="vm">__file__</span><span class="p">))</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">last_budget_year</span><span class="o">=</span><span class="n">Policy</span><span class="o">.</span><span class="n">LAST_BUDGET_YEAR</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">last_budget_year</span><span class="o">=</span><span class="n">Policy</span><span class="o">.</span><span class="n">LAST_BUDGET_YEAR</span><span class="p">):</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">()</span>
<span class="n">nyrs</span> <span class="o">=</span> <span class="n">Policy</span><span class="o">.</span><span class="n">number_of_years</span><span class="p">(</span><span class="n">last_budget_year</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="n">Consumption</span><span class="o">.</span><span class="n">JSON_START_YEAR</span><span class="p">,</span> <span class="n">nyrs</span><span class="p">)</span>

<div class="viewcode-block" id="Consumption.read_json_update">
<a class="viewcode-back" href="../../api/consumption.html#taxcalc.consumption.Consumption.read_json_update">[docs]</a>
<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">read_json_update</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">read_json_update</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return a revision dictionary suitable for use with update_consumption</span>
<span class="sd"> method derived from the specified JSON object, which can be None or</span>
Expand All @@ -449,7 +449,7 @@ <h1>Source code for taxcalc.consumption</h1><div class="highlight"><pre>

<div class="viewcode-block" id="Consumption.update_consumption">
<a class="viewcode-back" href="../../api/consumption.html#taxcalc.consumption.Consumption.update_consumption">[docs]</a>
<span class="k">def</span> <span class="nf">update_consumption</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">revision</span><span class="p">,</span>
<span class="k">def</span><span class="w"> </span><span class="nf">update_consumption</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">revision</span><span class="p">,</span>
<span class="n">print_warnings</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">raise_errors</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Update consumption default values using specified revision dictionary.</span>
Expand All @@ -465,25 +465,25 @@ <h1>Source code for taxcalc.consumption</h1><div class="highlight"><pre>

<div class="viewcode-block" id="Consumption.has_response">
<a class="viewcode-back" href="../../api/consumption.html#taxcalc.consumption.Consumption.has_response">[docs]</a>
<span class="k">def</span> <span class="nf">has_response</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">has_response</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return true if any MPC parameters are positive for current_year or</span>
<span class="sd"> if any BEN value parameters are less than one for current_year;</span>
<span class="sd"> return false if all MPC parameters are zero and all BEN value</span>
<span class="sd"> parameters are one</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="n">Consumption</span><span class="o">.</span><span class="n">RESPONSE_VARS</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;MPC_</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">var</span><span class="p">))</span> <span class="o">&gt;</span> <span class="mf">0.0</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s1">&#39;MPC_</span><span class="si">{</span><span class="n">var</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mf">0.0</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="n">Consumption</span><span class="o">.</span><span class="n">BENEFIT_VARS</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;BEN_</span><span class="si">{}</span><span class="s1">_value&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">var</span><span class="p">))</span> <span class="o">&lt;</span> <span class="mf">1.0</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s1">&#39;BEN_</span><span class="si">{</span><span class="n">var</span><span class="si">}</span><span class="s1">_value&#39;</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mf">1.0</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">True</span>
<span class="k">return</span> <span class="kc">False</span></div>


<div class="viewcode-block" id="Consumption.response">
<a class="viewcode-back" href="../../api/consumption.html#taxcalc.consumption.Consumption.response">[docs]</a>
<span class="k">def</span> <span class="nf">response</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">records</span><span class="p">,</span> <span class="n">income_change</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">response</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">records</span><span class="p">,</span> <span class="n">income_change</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Changes consumption-related records variables given income_change</span>
<span class="sd"> and the current values of the MPC consumption parameters</span>
Expand All @@ -492,19 +492,24 @@ <h1>Source code for taxcalc.consumption</h1><div class="highlight"><pre>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;records is not a Records object&#39;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="n">Consumption</span><span class="o">.</span><span class="n">RESPONSE_VARS</span><span class="p">:</span>
<span class="n">records_var</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">records</span><span class="p">,</span> <span class="n">var</span><span class="p">)</span>
<span class="n">mpc_var</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;MPC_</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">var</span><span class="p">))</span>
<span class="n">mpc_var</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s1">&#39;MPC_</span><span class="si">{</span><span class="n">var</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="n">records_var</span><span class="p">[:]</span> <span class="o">+=</span> <span class="n">mpc_var</span> <span class="o">*</span> <span class="n">income_change</span></div>


<div class="viewcode-block" id="Consumption.benval_params">
<a class="viewcode-back" href="../../api/consumption.html#taxcalc.consumption.Consumption.benval_params">[docs]</a>
<span class="k">def</span> <span class="nf">benval_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">benval_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns list of BEN_*_value parameter values</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">[</span><span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s1">&#39;BEN_</span><span class="si">{}</span><span class="s1">_value&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">var</span><span class="p">))</span>
<span class="k">return</span> <span class="p">[</span><span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="sa">f</span><span class="s1">&#39;BEN_</span><span class="si">{</span><span class="n">var</span><span class="si">}</span><span class="s1">_value&#39;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="n">Consumption</span><span class="o">.</span><span class="n">BENEFIT_VARS</span><span class="p">]</span></div>
</div>


<span class="k">def</span><span class="w"> </span><span class="nf">set_rates</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Consumption class has no parameter indexing rates.</span>
<span class="sd"> &quot;&quot;&quot;</span></div>

</pre></div>

Expand Down
Loading

0 comments on commit 4f9ab10

Please sign in to comment.