# Develop on BornAgain

file:///usr/share/doc/bornagain/html/dev/dev/index.html Recent content in Develop on BornAgain Hugo en-us

# Manual checks

file:///usr/share/doc/bornagain/html/dev/dev/manual_checks.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/dev/dev/manual_checks.html <h2 id="manual-checks">Manual checks</h2> <p>Tests that cannot be automatized should occasionally be run manually.</p> <h4 id="unused-code">Unused code</h4> <p>Unused code, in particular unused functions, can be detected with the tool <a href="https://github.com/mgehre/xunused">xunused</a>.</p> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">cd</span> build </span></span><span class="line"><span class="cl">cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS<span class="o">=</span>ON </span></span><span class="line"><span class="cl">vi compile_commands.json <span class="c1"># rm source files in 3rdparty and Fit/3rdparty</span> </span></span><span class="line"><span class="cl">xunused compile_commands.json 2&gt;<span class="p">&amp;</span><span class="m">1</span> &gt;/dev/null <span class="p">|</span> tee /io/unused.txt </span></span></code></pre></div><p>Use judgement: not all currently unused functions must be removed.</p> <h4 id="static-code-analysis-with-clang-tidy">Static code analysis with clang-tidy</h4> <p>&hellip;</p> <h4 id="coverage">Coverage</h4> <p>&hellip;</p>

# Debug

file:///usr/share/doc/bornagain/html/dev/dev/debug.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/dev/dev/debug.html <h2 id="using-gdb">Using gdb</h2> <p>If BornAgain GUI or a script crashes, re-run under gdb.</p> <h4 id="scripts-under-pyenv">Scripts under pyenv</h4> <p>If Python is under pyenv control the command</p> <pre tabindex="0"><code>gdb python </code></pre><p>will not work. Instead, use</p> <pre tabindex="0"><code>gdb -ex r --args bash python &lt;script&gt; </code></pre><p>(source: <a href="https://stackoverflow.com/a/53007303/1017348">https://stackoverflow.com/a/53007303/1017348</a>)</p>

# Webdoc

file:///usr/share/doc/bornagain/html/dev/dev/webdoc.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/dev/dev/webdoc.html <h2 id="how-to-contribute-to-this-documentation">How to contribute to this documentation</h2> <p>Here we explain how to edit this documentation locally and submit changes for online publication.</p> <h3 id="general-information">General information</h3> <p>This web site is generated using the static site generator <a href="https://gohugo.io/">Hugo</a>. Sources are mostly writen in the MarkDown format. Hugo translates them into HTML.</p> <p>To submit improvements of the documentation proceed as follows:</p> <h3 id="install-hugo">Install Hugo</h3> <p>Install Hugo either using a package manager, or directly from upstream: Download the archive file for your platform from <a href="https://github.com/gohugoio/hugo/releases">https://github.com/gohugoio/hugo/releases</a> . This archive contains a single binary. Put it into a directory that is in your PATH.</p>

# Code analyses

file:///usr/share/doc/bornagain/html/dev/dev/analyses.html Mon, 01 Jan 0001 00:00:00 +0000 file:///usr/share/doc/bornagain/html/dev/dev/analyses.html <h2 id="some-code-analyses">Some code analyses</h2> <h4 id="gui">GUI</h4> <p>Data and job view class hierarchy:</p> <figure > <a href="file:///usr/share/doc/bornagain/html/img/auto/src_doc/data&#43;job-view.svg"> <img src="file:///usr/share/doc/bornagain/html/img/auto/src_doc/data&#43;job-view.svg" width="800px"> </a> <figcaption> <p></p> </figcaption> </figure> <p>Qt graphics classes:</p> <figure > <a href="file:///usr/share/doc/bornagain/html/img/auto/src_doc/qclasses.svg"> <img src="file:///usr/share/doc/bornagain/html/img/auto/src_doc/qclasses.svg" width="800px"> </a> <figcaption> <p></p> </figcaption> </figure> <p>Mask collaboration:</p> <figure > <a href="file:///usr/share/doc/bornagain/html/img/auto/src_doc/mask-classes.svg"> <img src="file:///usr/share/doc/bornagain/html/img/auto/src_doc/mask-classes.svg" width="800px"> </a> <figcaption> <p></p> </figcaption> </figure> <h4 id="python">Python</h4> <p>Calls inside ba_plot:</p> <figure > <a href="file:///usr/share/doc/bornagain/html/img/auto/src_doc/ba_plot.svg"> <img src="file:///usr/share/doc/bornagain/html/img/auto/src_doc/ba_plot.svg" width="800px"> </a> <figcaption> <p></p> </figcaption> </figure>