<div dir="ltr">Hi again, Erik.<div><br></div><div>To better illustrate (and hopefully make working with BaikalETK easier for you), I just performed the second step of the NRPy+ development process on BaikalETK: creating a separate Python module for generating BaikalETK.</div><div><br></div><div>Simply do a git pull then from within, e.g., iPython, type:</div><div><br></div><div>import BaikalETK.BaikalETK_Pymodule as BE<br>BE.BaikalETK_codegen(outrootdir=&quot;BaikalETK-validate&quot;)<br></div><div><br></div><div>The full function call allows for many parameters to be adjusted as desired:</div><div><span style="font-family:&quot;DejaVu Sans Mono&quot;;font-size:9pt;color:rgb(0,0,128);font-weight:bold">def </span><span style="color:rgb(0,0,0);font-family:&quot;DejaVu Sans Mono&quot;;font-size:9pt">BaikalETK_codegen(outrootdir = </span><span style="font-family:&quot;DejaVu Sans Mono&quot;;font-size:9pt;color:rgb(0,128,128);font-weight:bold">&quot;BaikalETK/&quot;</span><span style="color:rgb(0,0,0);font-family:&quot;DejaVu Sans Mono&quot;;font-size:9pt">,</span><br></div><div><pre style="color:rgb(0,0,0);font-family:&quot;DejaVu Sans Mono&quot;;font-size:9pt">              FD_order=<span style="color:rgb(0,0,255)">4</span>, <span style="color:rgb(128,128,128);font-style:italic"># Finite difference order: even numbers only, starting with 2. 12 is generally unstable<br></span><span style="color:rgb(128,128,128);font-style:italic">              </span>LapseCondition  = <span style="color:rgb(0,128,128);font-weight:bold">&quot;OnePlusLog&quot;</span>, <span style="color:rgb(128,128,128);font-style:italic"># Set the standard 1+log lapse condition<br></span><span style="color:rgb(128,128,128);font-style:italic">              </span>ShiftCondition  = <span style="color:rgb(0,128,128);font-weight:bold">&quot;GammaDriving2ndOrder_NoCovariant&quot;</span>, <span style="color:rgb(128,128,128);font-style:italic"># Set the standard, second-order advecting-shift,<br></span><span style="color:rgb(128,128,128);font-style:italic">                                                                    # Gamma-driving shift condition<br></span><span style="color:rgb(128,128,128);font-style:italic">              </span>add_stress_energy_source_terms = <span style="color:rgb(0,0,128);font-weight:bold">False</span>,  <span style="color:rgb(128,128,128);font-style:italic"># Enable stress-energy terms?<br></span><span style="color:rgb(128,128,128);font-style:italic">              </span>default_KO_strength = <span style="color:rgb(0,0,255)">0.1 </span><span style="color:rgb(128,128,128);font-style:italic"># default Kreiss-Oliger dissipation strength; adjustable within thorn&#39;s param.ccl.<br></span><span style="color:rgb(128,128,128);font-style:italic">              </span>):<br></pre></div><div>Admittedly, the BaikalETK_Pymodule isn&#39;t very... modular at this point. Instead it calls on a number of largely infrastructure-agnostic NRPy+ modules. Once there are modules within NRPy+ for, e.g., setting param.ccl etc, modules like this one will shrink and simplify considerably. This is one of the goals of the proposed ETK/NRPy+ development. </div><div><br></div><div>If you wish, you are free to modify either the Python module (git friendly) or the Jupyter notebook (not as git-friendly, but where the documentation is housed), but are required to update both in the end. I think you&#39;d agree that any code updates should require corresponding documentation updates.</div><div><br></div><div>I haven&#39;t yet updated the BaikalETK Jupyter notebook to validate that its output agrees perfectly with the separate BaikalETK_Pymodule Python module (we call this &quot;self-validation&quot;), but I did confirm independently that only a couple of harmless whitespace differences appear in the generated C code between the BaikalETK notebook &amp; BaikalETK_Pymodule.</div><div><br></div><div>Thanks again for your feedback.</div><div><br><div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px">-Zach</div><div style="font-size:12.8px"><br></div><span style="font-size:12.8px">*     *     *</span><br style="font-size:12.8px"><span style="font-size:12.8px">Prof. Zachariah Etienne</span></div><div dir="ltr">Physics &amp; Astronomy Dept.<br style="font-size:12.8px"><div style="font-size:12.8px">West Virginia University</div><div><a href="http://astro.phys.wvu.edu/zetienne/" target="_blank">http://astro.phys.wvu.edu/zetienne/</a></div><div><a href="http://blackholesathome.net/" target="_blank">http://blackholesathome.net</a><a href="https://blackholesathome.net" style="font-size:12.8px" target="_blank"><br></a><br></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 12:15 PM Zach Etienne &lt;<a href="mailto:zachetie@gmail.com" target="_blank">zachetie@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Erik,<div><br></div><div>Thanks for the feedback, and sorry to hear about the frustration. Indeed BaikalETK is only a proof-of-principle code at the moment, in which the second stage of development (copying the code blocks in the Jupyter notebook to a proper, callable, git-friendly Python module) hasn&#39;t been completed yet. I&#39;m hoping that with more resources to combine ETK &amp; NRPy+ development, the full modularization of all the ETK Jupyter notebooks can be completed.</div><div><br></div><div>&gt;  The only way I see is to undo my changes (&quot;git checkout&quot;), and then pull your changes. In this case that&#39;s fine because there are no major changes, but if I had made changes I&#39;d be in trouble.</div><div><br></div><div>I generally do a `git diff` if `git pull` complains about conflicts, and it&#39;s usually easy to see if anything significant has changed (and then do `git checkout` if not). Maybe if I chose a standard way of prefixing lines that are ignorable comments (e.g., &quot;COMMENT: Finished BSSN symbolic expressions in&quot;) a simple script could be written that checks for trivial differences like these. Removing all output isn&#39;t a good idea as it would wipe away the &quot;standard&quot; output displayed on nbviewer (<a href="https://nbviewer.jupyter.org/github/zachetienne/nrpytutorial/blob/master/NRPyPlus_Tutorial.ipynb" target="_blank">https://nbviewer.jupyter.org/github/zachetienne/nrpytutorial/blob/master/NRPyPlus_Tutorial.ipynb</a>) in case the user wants only to learn from the Jupyter documentation.</div><div><br></div><div>Also if in doubt, one can simply compare the thorn output from the master Jupyter notebook with your own version. We&#39;re making it easier to redirect all NRPy+ output to whatever directory you like, so that such diffs can be made quickly and easily.</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px">-Zach</div><div style="font-size:12.8px"><br></div><span style="font-size:12.8px">*     *     *</span><br style="font-size:12.8px"><span style="font-size:12.8px">Prof. Zachariah Etienne</span></div><div dir="ltr">Physics &amp; Astronomy Dept.<br style="font-size:12.8px"><div style="font-size:12.8px">West Virginia University</div><div><a href="http://astro.phys.wvu.edu/zetienne/" target="_blank">http://astro.phys.wvu.edu/zetienne/</a></div><div><a href="http://blackholesathome.net/" target="_blank">http://blackholesathome.net</a><a href="https://blackholesathome.net" style="font-size:12.8px" target="_blank"><br></a><br></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 11:56 AM Erik Schnetter &lt;<a href="mailto:schnetter@cct.lsu.edu" target="_blank">schnetter@cct.lsu.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Mon, Nov 4, 2019 at 8:38 AM Zach Etienne &lt;<a href="mailto:trac-noreply@einsteintoolkit.org" target="_blank">trac-noreply@einsteintoolkit.org</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#2064: Add GiRaFFE to the Einstein Toolkit
<table style="border-spacing:1ex 0pt">
<tbody><tr><td style="text-align:right"> Reporter:</td><td>Zach Etienne</td></tr>
<tr><td style="text-align:right">   Status:</td><td>open</td></tr>
<tr><td style="text-align:right">Milestone:</td><td>ET_2019_10</td></tr>
<tr><td style="text-align:right">  Version:</td><td>development version</td></tr>
<tr><td style="text-align:right">     Type:</td><td>enhancement</td></tr>
<tr><td style="text-align:right"> Priority:</td><td>minor</td></tr>
<tr><td style="text-align:right">Component:</td><td>EinsteinToolkit thorn</td></tr>
</tbody></table>

<p>Comment (by Zach Etienne):</p>
<p><span>@Ian Hinder</span> : Version control with Jupyter is only slightly more difficult than with plain source code, as its JSON is plaintext. </p>
<blockquote>
<p>Is it a good idea to pull the whole code into notebooks? I don’t know how sustainable it is when you have multiple contributors; merging changes from different people can become very difficult.</p>
</blockquote>
<p>Writing the Jupyter notebook is only the first step in NRPy+ development, but arguably the most important as it contains the documentation and some validation checks. I’d liken the Jupyter notebook phase more to collaboratively writing a journal article with a shared git repo than code development within such a repo.</p></blockquote><div><br></div><div>I&#39;d like to add a point to this, out of frustration:</div><div><br></div><div>A few weeks ago I downloaded and ran Tutorial-BaikalETK.ipynb. Today I try to &quot;git pull&quot;, and it doesn&#39;t work, because there are differences in the output everywhere (e.g. &quot;Finished BSSN symbolic expressions in 1.2987918853759766 seconds&quot;). The only way I see is to undo my changes (&quot;git checkout&quot;), and then pull your changes. In this case that&#39;s fine because there are no major changes, but if I had made changes I&#39;d be in trouble.</div><div><br></div><div>I think the problem is that the output is stored in the git repo. In the future, you might want to switch to a system where (a) notebooks automatically have all output removed before they are committed, and (b) upon commit, Travis or a similar system creates for-viewing-only notebooks with a standardized output.</div><div><br></div><div>-erik</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p> </p>
<p>After the notebook has been written, a separate Python module containing the code developed in the Jupyter notebook is then written. At the bottom of every NRPy+ Jupyter notebook it is required to include a self-validation check against the separate Python module (many NRPy+ Jupyter notebooks have additional validation checks). Further, all NRPy+ Python modules must include proper unit testing on all symbolic expressions generated, so that Travis CI can confirm agreement with the trusted version. This has the nice consequence of often requiring developers to update the documentation any time the module is updated in order for the Jupyter notebook to pass self-validation tests, though generally NRPy+ developers prefer updating the Jupyter notebooks as a first step, then propagating changes to the module &amp; unit tests. Proper documentation makes our lives much easier and is the foundation of a sustainable codebase.</p>
<p>The above approach has worked fine with multiple contributors so far, as NRPy+ is extremely modular, with 70+ Python modules &amp; about 100 Jupyter notebooks. Also I generally don’t put multiple students on exactly the same project (though they certainly do interact and benefit from each others&#39; documentation). Thus 
</p><p>--<br>
Ticket URL: <a href="https://bitbucket.org/einsteintoolkit/tickets/issues/2064/add-giraffe-to-the-einstein-toolkit" target="_blank">https://bitbucket.org/einsteintoolkit/tickets/issues/2064/add-giraffe-to-the-einstein-toolkit</a></p>

_______________________________________________<br>
Trac mailing list<br>
<a href="mailto:Trac@einsteintoolkit.org" target="_blank">Trac@einsteintoolkit.org</a><br>
<a href="http://lists.einsteintoolkit.org/mailman/listinfo/trac" rel="noreferrer" target="_blank">http://lists.einsteintoolkit.org/mailman/listinfo/trac</a><br>
<p></p></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Erik Schnetter &lt;<a href="mailto:schnetter@cct.lsu.edu" target="_blank">schnetter@cct.lsu.edu</a>&gt;<br><a href="http://www.perimeterinstitute.ca/personal/eschnetter/" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a></div><div><br></div></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@einsteintoolkit.org" target="_blank">Users@einsteintoolkit.org</a><br>
<a href="http://lists.einsteintoolkit.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.einsteintoolkit.org/mailman/listinfo/users</a><br>
</blockquote></div>
</blockquote></div>