Skip to content

Commit

Permalink
Deploying to gh-pages from @ 98576a6 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Oct 4, 2023
1 parent 7504e64 commit 66fa3fc
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 125cba01644678bc296b784225bab5c7
config: 46f64e69ea55ff94dc8e6b2ae3ce2fb1
tags: 645f666f9bcd5a90fca523b33c5a78b7
6 changes: 6 additions & 0 deletions _downloads/621e2c7711e8623173875c33222eddb6/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,9 @@
added:
- Chart formatting utilities.
date: 2023-08-02 12:54:44
- bump: minor
changes:
fixed:
- Bump numpy version
- Fix numpy record compatibility issue
date: 2023-10-04 14:51:40
4 changes: 3 additions & 1 deletion _modules/policyengine_core/parameters/helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ <h1>Source code for policyengine_core.parameters.helpers</h1><div class="highlig


<div class="viewcode-block" id="contains_nan"><a class="viewcode-back" href="../../../python_api/parameters.html#policyengine_core.parameters.helpers.contains_nan">[docs]</a><span class="k">def</span> <span class="nf">contains_nan</span><span class="p">(</span><span class="n">vector</span><span class="p">):</span>
<span class="k">if</span> <span class="n">numpy</span><span class="o">.</span><span class="n">issubdtype</span><span class="p">(</span><span class="n">vector</span><span class="o">.</span><span class="n">dtype</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">record</span><span class="p">):</span>
<span class="k">if</span> <span class="n">numpy</span><span class="o">.</span><span class="n">issubdtype</span><span class="p">(</span><span class="n">vector</span><span class="o">.</span><span class="n">dtype</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">record</span><span class="p">)</span> <span class="ow">or</span> <span class="n">numpy</span><span class="o">.</span><span class="n">issubdtype</span><span class="p">(</span>
<span class="n">vector</span><span class="o">.</span><span class="n">dtype</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">void</span>
<span class="p">):</span>
<span class="k">return</span> <span class="nb">any</span><span class="p">([</span><span class="n">contains_nan</span><span class="p">(</span><span class="n">vector</span><span class="p">[</span><span class="n">name</span><span class="p">])</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">vector</span><span class="o">.</span><span class="n">dtype</span><span class="o">.</span><span class="n">names</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">numpy</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">vector</span><span class="p">)</span><span class="o">.</span><span class="n">any</span><span class="p">()</span></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ <h1>Source code for policyengine_core.parameters.vectorial_parameter_node_at_ins
<span class="n">node</span><span class="p">:</span> <span class="s2">&quot;ParameterNode&quot;</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="s2">&quot;VectorialParameterNodeAtInstant&quot;</span><span class="p">:</span>
<span class="n">VectorialParameterNodeAtInstant</span><span class="o">.</span><span class="n">check_node_vectorisable</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
<span class="n">subnodes_name</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">_children</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="n">subnodes_name</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">_children</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span>
<span class="c1"># Recursively vectorize the children of the node</span>
<span class="n">vectorial_subnodes</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span>
<span class="p">[</span>
Expand Down Expand Up @@ -466,7 +466,9 @@ <h1>Source code for policyengine_core.parameters.vectorial_parameter_node_at_ins
<span class="p">)</span>

<span class="c1"># If the result is not a leaf, wrap the result in a vectorial node.</span>
<span class="k">if</span> <span class="n">numpy</span><span class="o">.</span><span class="n">issubdtype</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">dtype</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">record</span><span class="p">):</span>
<span class="k">if</span> <span class="n">numpy</span><span class="o">.</span><span class="n">issubdtype</span><span class="p">(</span>
<span class="n">result</span><span class="o">.</span><span class="n">dtype</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">record</span>
<span class="p">)</span> <span class="ow">or</span> <span class="n">numpy</span><span class="o">.</span><span class="n">issubdtype</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">dtype</span><span class="p">,</span> <span class="n">numpy</span><span class="o">.</span><span class="n">void</span><span class="p">):</span>
<span class="k">return</span> <span class="n">VectorialParameterNodeAtInstant</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_name</span><span class="p">,</span> <span class="n">result</span><span class="o">.</span><span class="n">view</span><span class="p">(</span><span class="n">numpy</span><span class="o">.</span><span class="n">recarray</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">_instant_str</span>
<span class="p">)</span>
Expand Down
3 changes: 3 additions & 0 deletions _static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #E40000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #008400 } /* Generic.Inserted */
Expand Down Expand Up @@ -98,6 +99,7 @@ body[data-theme="dark"] .highlight .c1 { color: #ababab; font-style: italic } /*
body[data-theme="dark"] .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
body[data-theme="dark"] .highlight .gd { color: #d22323 } /* Generic.Deleted */
body[data-theme="dark"] .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
body[data-theme="dark"] .highlight .ges { color: #d0d0d0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
body[data-theme="dark"] .highlight .gr { color: #d22323 } /* Generic.Error */
body[data-theme="dark"] .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
body[data-theme="dark"] .highlight .gi { color: #589819 } /* Generic.Inserted */
Expand Down Expand Up @@ -183,6 +185,7 @@ body:not([data-theme="light"]) .highlight .c1 { color: #ababab; font-style: ital
body:not([data-theme="light"]) .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
body:not([data-theme="light"]) .highlight .gd { color: #d22323 } /* Generic.Deleted */
body:not([data-theme="light"]) .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
body:not([data-theme="light"]) .highlight .ges { color: #d0d0d0; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
body:not([data-theme="light"]) .highlight .gr { color: #d22323 } /* Generic.Error */
body:not([data-theme="light"]) .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
body:not([data-theme="light"]) .highlight .gi { color: #589819 } /* Generic.Inserted */
Expand Down
Loading

0 comments on commit 66fa3fc

Please sign in to comment.