<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Integrating CBS Tools in the Nipy community]]></title><description><![CDATA[My development blog for the Google Summer of Code 2017]]></description><link>https://juhuntenburg.github.io/gsoc2017</link><image><url>http://github.com/juhuntenburg/gsoc2017/blob/gh-pages/images/blog_cover.png</url><title>Integrating CBS Tools in the Nipy community</title><link>https://juhuntenburg.github.io/gsoc2017</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Aug 2017 17:08:46 GMT</lastBuildDate><atom:link href="https://juhuntenburg.github.io/gsoc2017/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Final report]]></title><description><![CDATA[<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>As it is the last week of Google Summer of Code, this post is also my final project report, summarizing what I have worked on during the past 3 months, what I have learned, and what is left to do.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_result">The result</h2>
<div class="sectionbody">
<div class="paragraph">
<p>I worked on developing <strong>Nighres</strong>&#8201;&#8212;&#8201;a Python package for processing of high-resolution neuroimaging data. It provides a Python framework for the Java-based <a href="https://www.cbs.mpg.de/institute/software/cbs-tools">CBS High-Res Brain Processing Tools</a>, aiming to make those tools easier to install, use and extend.</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/nighres/nighres">Github repository</a> (168 commits, 290,780+/207,108- lines of code)</p>
</li>
<li>
<p><a href="http://nighres.readthedocs.io/en/latest/">Documentation</a></p>
</li>
<li>
<p><a href="https://pypi.python.org/pypi/nighres">PyPI package</a></p>
</li>
<li>
<p><a href="https://juhuntenburg.github.io/gsoc2017/">Development blog</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_experience">The experience</h2>
<div class="sectionbody">
<div class="paragraph">
<p>It is cool to have built a software package. But even more satisfying to know that every step to get there meant learning something I had never done before. Without a course, or a book, simply by doing it. I have written about most of these steps in previous posts, but here is an overview with links:</p>
</div>
<div class="ulist">
<div class="title"><strong>What I have learned</strong></div>
<ul>
<li>
<p>Making software design choices (blog: <a href="../../05/11/Wisdom-of-the-crowd.html">Wisdom of the crowd</a>, <a href="../../07/28/Nighres.html">Nighres</a>, <a href="../../08/11/Documentation.html">Documentation</a>)</p>
</li>
<li>
<p>Distribution (blog: <a href="../../06/03/To-Docker-or-not-to-Docker.html">To Docker or not to Docker</a>, <a href="../../06/16/Distributing.html">Distributing</a>)</p>
<div class="ulist">
<ul>
<li>
<p>Creating a PyPI package (blog: <a href="../../07/16/Brainhack-Vancouver.html">Brainhack Vancouver</a>, <a href="../../07/28/MANIFEST-in.html">Manifesting</a>, code: <a href="https://github.com/nighres/nighres/blob/master/setup.py">setup.py</a>, <a href="https://github.com/nighres/nighres/blob/master/MANIFEST.in">MANIFEST.in</a>)</p>
</li>
<li>
<p>Choosing a license (blog: <a href="../../07/26/Licenses.html">Licenses</a>, code: <a href="https://github.com/nighres/nighres/blob/master/LICENSE">LICENSE</a>)</p>
</li>
<li>
<p>Building Java classes and wrappers (blog: <a href="../../07/16/Brainhack-Vancouver.html">Brainhack Vancouver</a>, code: <a href="https://github.com/nighres/nighres/blob/master/build.sh">build.sh</a> )</p>
</li>
<li>
<p>Continuous integration and deployment with Travis (blog: <a href="../../08/18/travis.html">Travis CI</a>, code: <a href="https://github.com/nighres/nighres/blob/master/.travis.yml">travis.yml</a>)</p>
</li>
<li>
<p>Using docker and virtualbox for platform testing (blog: <a href="../../06/03/To-Docker-or-not-to-Docker.html">To Docker or not to Docker</a>, code: <a href="https://github.com/nighres/nighres/blob/master/test_docker_trusty.sh">test_docker_trusty.sh</a>)</p>
</li>
<li>
<p>Hosting example data on NITRC (online: <a href="https://www.nitrc.org/projects/nighres">NITRC project</a>)</p>
</li>
</ul>
</div>
</li>
<li>
<p>Documentation</p>
<div class="ulist">
<ul>
<li>
<p>Docstring styles (blog: <a href="../../07/18/A-documentation-for-documentation.html">A documentation for documentation</a>)</p>
</li>
<li>
<p>Creating a documentation with Sphinx and writing in ReStructuredText(blog: <a href="../../08/11/Documentation.html#sphinx">Sphinx</a>, code:  <a href="https://github.com/nighres/nighres/tree/master/doc">doc</a>)</p>
</li>
<li>
<p>Rendering illustrative examples with sphinx gallery (blog: <a href="../../08/11/Documentation.html#sphinx-gallery">Sphinx Gallery</a>, code: <a href="https://github.com/nighres/nighres/blob/master/doc/conf.py#L47-L64">conf.py</a>, <a href="https://github.com/nighres/nighres/tree/master/examples">examples</a>, online: <a href="http://nighres.readthedocs.io/en/latest/auto_examples/index.html">Nighres usage examples</a>)</p>
</li>
<li>
<p>Hosting documentation on readthedocs (blog: <a href="../../08/11/Documentation.html#read-the-docs">Read the docs</a>, online: <a href="http://nighres.readthedocs.io/en/latest/">readthedocs</a>)</p>
</li>
</ul>
</div>
</li>
<li>
<p>Using Github for project management (blog: <a href="../../07/21/Github-project-management.html">Github project management</a>, online: <a href="https://github.com/nighres/nighres/projects/1">GSoC project</a>)</p>
</li>
<li>
<p>Creating a blog using hubpress and writing in AsciiDoc (blog: <a href="../..html">Like a real blog</a> , code: <a href="https://github.com/juhuntenburg/gsoc2017">gsoc2017</a>)</p>
</li>
</ul>
</div>
<div class="ulist">
<div class="title"><strong>What I got better at</strong></div>
<ul>
<li>
<p>Writing good Python code</p>
</li>
<li>
<p>Writing good docstrings</p>
</li>
<li>
<p>Using Git and Github</p>
</li>
<li>
<p>Using virtualenv for clean Python environments</p>
</li>
<li>
<p>Raising exceptions, errors, warnings in Python</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_the_future">The future</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Open issues can be found on the <a href="https://github.com/nighres/nighres/issues">Github issue tracker</a>. In my opinion, these are the most crucial next steps:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Writing unittests and testing against different versions of Python, Numpy and Nibabel on Travis</p>
</li>
<li>
<p>Supporting different platforms and architectures</p>
</li>
<li>
<p>Becoming part of the <a href="http://nipy.org/">Nipy</a> community of practice</p>
</li>
<li>
<p>Writing instructions for developers to make contributing easy</p>
</li>
<li>
<p>Wrapping more CBS Tools modules and writing the interfaces for them</p>
</li>
<li>
<p>Adding more examples and make them executable on readthedocs (currently too big)</p>
</li>
<li>
<p>Providing a docker image</p>
</li>
</ul>
</div>
</div>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/08/25/final_report.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/08/25/final_report.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 25 Aug 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Travis CI]]></title><description><![CDATA[<div class="paragraph">
<p>This week I set up continuous integration (CI) with <a href="https://travis-ci.org/">travis</a> for our project. I knew very little about travis&#8201;&#8212;&#8201;or CI&#8201;&#8212;&#8201;before, and had thought of it more in terms of running automatic tests. And we don&#8217;t even have unit tests yet.</p>
</div>
<div class="paragraph">
<p>But it turns out travis also very useful for another reason: to automatically build the package&#8201;&#8212;&#8201;including compiling of Java classes, wrappers and all&#8201;&#8212;&#8201;and <a href="https://docs.travis-ci.com/user/deployment/pypi/">deploy it to PyPI</a>. With the build script from <a href="../../07/16/Brainhack-Vancouver.html">Brainhack Vancouver</a> and, as usual, lots of peeking into other packages, it was easier than I had thought to put together the <a href="https://github.com/nighres/nighres/blob/master/.travis.yml">travis.yml</a> script.</p>
</div>
<div class="paragraph">
<p>We currently deploy to TestPyPI every time changes are pushed to master. But once Nighres is ready for the official release, it&#8217;s easy to switch to the real PyPI server and deploy only tagged releases.</p>
</div>
<div class="paragraph">
<p>And when we have proper tests for the Python code, we can extend the travis script to run the tests against different versions of Python and the dependencies (Numpy and Nibabel), to ensure that changes to the existing code don&#8217;t break current functionality.</p>
</div>
<div class="paragraph">
<p>With the current script, travis builds on Linux Ubuntu Trusty x86_64. It will be important to set up similar builds for other architectures and platforms, so that we can make the precompiled package available for more users. But one step after the other.</p>
</div>
<div class="paragraph">
<p>For now, at the end of the second last week of GSoC, what could be more satisfying:</p>
</div>
<div id="build-passing" class="paragraph">
<p><span class="image"><a class="image" href="https://travis-ci.org/nighres/nighres"><img src="https://travis-ci.org/nighres/nighres.svg?branch=master" alt="Build Status"></a></span></p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/08/18/travis.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/08/18/travis.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 18 Aug 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Documentation Part II]]></title><description><![CDATA[<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Through contributing to
other projects I have learned how to write docstrings. But I have never set up the actual online documentation myself. For Nighres, I looked into two approaches: <a href="#_github_wiki">Github wiki</a> and <a href="#_sphinx">Sphinx</a></p>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph lead">
<p><strong>Summary</strong></p>
</div>
<div class="ulist">
<ul>
<li>
<p>Github wiki is easy to use but needs to be updated manually</p>
</li>
<li>
<p>Sphinx is harder to learn but easier to maintain</p>
</li>
<li>
<p>Current docs: <a href="http://nighres.readthedocs.io/en/latest/" class="bare">http://nighres.readthedocs.io/en/latest/</a></p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_github_wiki">Github wiki</h2>
<div class="sectionbody">
<div class="paragraph">
<p>One idea was to document the package with a  <a href="https://guides.github.com/features/wikis/">github wiki</a>. Github wikis are easy to set up and there are some really nice <a href="https://github.com/showcases/projects-with-great-wikis">examples</a>.</p>
</div>
<div class="paragraph">
<p>What I don&#8217;t like about the wiki is that all documentation has to be written and edited by hand. That means, if someone changes a function&#8217;s docstring or adds a new function, they also have to make the respective changes in the sepearte wiki repo (nighres.wiki).</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_sphinx">Sphinx</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The other option I looked into is <a href="http://www.sphinx-doc.org/en/stable/">sphinx</a>, which I have seen used for many other Python projects. The big advantage of sphinx is that functions (classes, modules, etc) can be documented automatically using the <a href="http://www.sphinx-doc.org/en/stable/ext/autodoc.html">autodoc extension</a>. That means changes in the main code are automatically integrated when rebuilding the documentation. Or maybe one line needs to be added for a new function.</p>
</div>
<div class="paragraph">
<p>Now sphinx is <strong>much</strong> harder to get started on than github wiki. There is good documentation on the basics (e.g. <a href="http://matplotlib.org/sampledoc/index.html">this tutorial</a>), but it took me days to understand how to use the actually interesting features and make it look nice.</p>
</div>
<div class="paragraph">
<p>What helped me most was to dig into the documentations of similar projects (in my case <a href="http://nilearn.github.io/">Nilearn</a> and <a href="http://nipype.readthedocs.io/en/latest/">Nipype</a>), imitate what they do and then start to make changes.</p>
</div>
<div class="sect3">
<h4 id="_read_the_docs">Read The Docs</h4>
<div class="paragraph">
<p>For hosting the documentation I tried out <a href="https://docs.readthedocs.io/en/latest/index.html">read the docs</a>. If you write your documentation in sphinx and your code is on github, it is really easy (and free) to set up a searchable documentation website under the <em>.readthedocs.io</em> domain. The best about it: the page automatically rebuilds, whenever you push changes to your repo. Or whenever you make a new stable release, depending on your settings.</p>
</div>
<div class="paragraph">
<p>Read the docs also has their own custom sphinx theme, which I am using for now. It has many built-in features that make the documentation look nice without much styling. The theme needs to be installed separately:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>pip install sphinx-rtd-theme</pre>
</div>
</div>
<div class="paragraph">
<p>And then in the sphinx <code>conf.py</code> add:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>html_theme = sphinx_rtd_theme</pre>
</div>
</div>
<div class="paragraph">
<p><a href="http://iwatermark.readthedocs.io/en/latest/demo.html">This demo</a> shows how different reStructuredText constructs come out in the read the docs theme. It is also possible to modify the theme, as I found out by peeking into the sphinx gallery documentation (see <a href="https://github.com/sphinx-gallery/sphinx-gallery/blob/master/doc/_static/theme_override.css">here</a> and <a href="https://github.com/sphinx-gallery/sphinx-gallery/blob/master/doc/conf.py#L138-L139">here</a>). I have also played around with a more Nipy-like documentation style, and generally not too many changes would be necessary to switch. But before someone has more time to fiddle with making a pretty custom website, the rtd theme seems like the best choice to me.</p>
</div>
</div>
<div class="sect3">
<h4 id="_sphinx_gallery">Sphinx Gallery</h4>
<div class="paragraph">
<p>Finally, inspired by the Nilearn documentation, I also learned how to document examples using <a href="https://sphinx-gallery.readthedocs.io/en/latest/">sphinx gallery</a>. To understand how it is used in Nilearn, and learn from that, I had to build the Nilearn documentation locally to see all the folders and files.</p>
</div>
<div class="paragraph">
<p>Since it took me a moment to understand the error messages when trying that, here is what you need to install in order to build documentation using sphinx gallery:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>pip install sphinx-gallery
pip install matplotlib
pip install pillow</pre>
</div>
</div>
<div class="paragraph">
<p>Once correctly set up in the <code>config.py</code> file, sphinx gallery beautifully renders the example code and creates pretty click-able fields (=the gallery), which are easy to include in the documentation. Each function can be set to auto-reference the examples that it is used in.</p>
</div>
</div>
</div>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/08/11/Documentation.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/08/11/Documentation.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 11 Aug 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Nighres]]></title><description><![CDATA[<div class="paragraph">
<p>This week was special, the official birth of <strong><em>Nighres&#8201;&#8212;&#8201;Processing tools for high-resolution neuroimaging</em></strong>.</p>
</div>
<div class="paragraph">
<p>Nighres is the name that we decided on for our package. <em>Ni</em> for consistency with other neuroimaging tools in the <a href="http://nipy.org/">Nipy</a> (Neuroimaging in Python) community. And <em>nighres</em> in analogy to <em>highres</em> (as in high-resolution data), and because it&#8217;s easy to remember and type, and not yet taken on github.</p>
</div>
<div class="paragraph">
<p>Just born and baptized, nighres soon started making its first step into the software world. It got its own <a href="https://github.com/nighres">github organization</a>, including a <a href="https://nighres.github.io/">website</a>, and inherited the <a href="https://github.com/nighres/nighres">repo</a> I had been working on so far during GSoC. Conveniently, github makes it super easy to <a href="https://help.github.com/articles/transferring-a-repository-owned-by-your-personal-account/">transfer a repo</a> with all history and even issues and project boards.</p>
</div>
<div class="paragraph">
<p>Excited to help <em>nighres</em> grow into a real software package during the next weeks, so that it soon start to make friends in the Nipy community!</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/28/Nighres.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/28/Nighres.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 28 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[MANIFEST.in(g)]]></title><description><![CDATA[<div class="paragraph">
<p>When setting up the new nighres repo I also worked on the <a href="https://github.com/nighres/nighres/blob/master/build.sh">build script</a> from Brainhack Vancouver. It now pulls the raw Java classes from the original cbstools repo, compiles and wraps them using JCC and finally builds the PyPI-ready wheel. The wheel installs nighres, the cbstools wrappers which are called internally (but can also be accessed by advanced users), as well as atlas data that some of the algorithms need.</p>
</div>
<div class="paragraph">
<p>When dealing with those atlas file I learned that including data files recursively using the setup function is a pain. But thanks to <a href="https://stackoverflow.com/questions/1612733/including-non-python-files-with-setup-py">this post</a> I switched to specifying the data directories in a MANIFEST.in file, which is automatically read when setting <code>include_package_data=True</code> in the setup function. Simple and works like a charm.</p>
</div>
<div class="paragraph">
<p>So far everything is only tested on my linux setup, so I have to look into other systems and continuous integration. But yet another step closer to nice and clean distribution.</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/28/MANIFEST-in.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/28/MANIFEST-in.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 28 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Like a real blog]]></title><description><![CDATA[<div class="paragraph">
<p>Today I moved my blog from pure github pages to <a href="https://github.com/HubPress/hubpress.io">hubpress</a> (which is built on github pages). Takes a few hours of figuring out the setup and switching from Markdown to <a href="http://asciidoctor.org/docs/asciidoc-writers-guide/">AsciiDoc</a>.* But from there writing and publishing new posts is simple, and it just looks a bit more like a real blog (maybe I even figure out the cover image eventually). It&#8217;s cool how many different things I get to learn through GSoC, for which I probably wouldn&#8217;t take time otherwise during my PhD.</p>
</div>
<div class="paragraph">
<p><em>* I found <a href="https://atom.io">atom</a>'s AsciiDoc preview and syntax highlighting extensions to help a lot with that</em></p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/27/A-real-blog.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/27/A-real-blog.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Thu, 27 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Licenses]]></title><description><![CDATA[<div class="paragraph">
<p>Trying to decide how to license our package I was reading around and found that <a href="https://choosealicense.com/" class="bare">https://choosealicense.com/</a> was helpful for a quick overview on the basics, and <a href="https://opensource.org/licenses" class="bare">https://opensource.org/licenses</a> for detailed info on all licenses.</p>
</div>
<div class="paragraph">
<p>What eventually helped me most was reaching out to the community via the <a href="https://brainhack-slack-invite.herokuapp.com/">brainhack slack</a> once again.</p>
</div>
<div class="paragraph">
<p>The final choice came down to <a href="https://choosealicense.com/licenses/mit/">MIT</a> <em>versus</em> <a href="https://choosealicense.com/licenses/apache-2.0/">Apache 2.0</a>. While both are similarly permissive regarding use and re-use of the code, Apache 2.0 additionally addresses the question of patents. I didn&#8217;t really understand what that means in practice, and if it was important for us, but found two posts that helped me get at least a rough idea (<a href="https://softwareengineering.stackexchange.com/questions/187958/apache-license-and-patents">here</a> and <a href="https://opensource.stackexchange.com/questions/1881/against-what-does-the-apache-2-0-patent-clause-protect">here</a>).</p>
</div>
<div class="paragraph">
<p>We eventually decided for Apache 2.0, it seems there is no loss but potential gain in comparison to MIT. Also, while MIT came out of academia and might be more naive regarding corporate issues, Apache 2.0 (or similar) is used by big software projects such as Google&#8217;s tensorflow and Mozilla.</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/26/Licenses.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/26/Licenses.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Wed, 26 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Github project management]]></title><description><![CDATA[<div class="paragraph">
<p>Following a workshop at Brainhack Vancouver by the amazing <a href="https://twitter.com/kirstie_j">@kirstie_j</a>, I started organizing my GSoC work using <a href="https://help.github.com/articles/tracking-the-progress-of-your-work-with-project-boards/">github project boards</a>. I probably use it a bit differently than intended&#8201;&#8212;&#8201;mostly to keep track of my own tasks and asking questions to my mentors&#8201;&#8212;&#8201;but find it extremely useful. We still have more detailed or organizational discussions on slack, but the project board is great to keep an overview without yet another tool (such as Trello &amp; Co.)</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/21/Github-project-management.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/21/Github-project-management.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 21 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[A documentation for documentation]]></title><description><![CDATA[<div class="paragraph">
<p>These days I am writing the Python interfaces to the JCC-wrapped Java code, that will eventually be exposed to the user. This also means writing comprehensive docstrings. Up until now I mostly freestyled docstrings, roughly trying to imitate what I had seen (and liked) in other packages, or other functions of the package I worked on. But searching for something docstring-related I stumbled upon the <a href="https://www.python.org/dev/peps/pep-0257/">PEP257 docstring conventions</a>. Maybe not so surprising that they exist. More surprising, there are specific <a href="https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard">NumPy/SciPy docstring conventions</a> (and <a href="http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html">examples</a>). It makes sense for us to follow the Scientific Python community convenstions, and so far I find the style clean, easy to follow and flexible enough for package specifics. Plus the warm and fuzzy feeling of following standards (#GermanAfterAll). Hooray!</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/18/A-documentation-for-documentation.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/18/A-documentation-for-documentation.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Tue, 18 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Brainhack Vancouver]]></title><description><![CDATA[<div class="paragraph">
<p>From June 22-24 I was at the <a href="https://ohbm.github.io/hackathon2017/">OHBM Hackathon 2017</a> in Vancouver and <a href="https://docs.google.com/presentation/d/1OG7BWQRG93nNkFRYnfPNnj7AoosHUQwAdbQgAAq78i8/edit?usp=sharing">pitched</a> a project to implement the distribution for cbstools-python. I mostly hoped that some of the folks there had some advice, but did not really expect anyone to get overly excited about joining this pretty specific project. Turns out I still underestimate the power of <a href="http://www.brainhack.org/about.html">brainhack</a>&#8201;&#8212;&#8201;right after the pitch <a href="https://github.com/kofalt">kofalt</a> came up to me and said he would love to join.</p>
</div>
<div class="paragraph">
<p>Within two &amp; 1/2 intense and fun days we managed to pool his expertise on software packaging and distribution, my recently acquired knowledge about PyPI and what we want for cbstools-python, and some helpful insights from other brainhackers into a single, but powerful <a href="https://github.com/kofalt/cbstools-public/blob/master/build.sh">script</a>. It performs the following essential steps:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Download the MIPAV and JIST dependencies (should become redundant soon)</p>
</li>
<li>
<p>Compile the Java code</p>
</li>
<li>
<p>Wrap the Java classes using JCC</p>
</li>
<li>
<p>Build the right folder structure and finally a wheel</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>This automates all steps necessary for continuous integration and distribution via PyPI. It will need to be adapted once the high-level Python interfaces have been added and we have decided on the final code organization. Also a few small issues regarding continuous integration are still to be solved. But it is still a <em>massive step forward</em> and much more than I ever expected to get done in that short time.</p>
</div>
<div class="paragraph">
<p>As usual, I left brainhack tired but thrilled: about this awesome, inspiring community, and about having learned more in a few days than in a regular month or more back at university. If you are into neuroscience and coding, you should definitely check out the next brainhack in your region, or just organize one yourself.</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/07/16/Brainhack-Vancouver.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/07/16/Brainhack-Vancouver.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Sun, 16 Jul 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Distributing]]></title><description><![CDATA[<div class="paragraph">
<p>Recently I tried to learn about <a href="https://python-packaging-user-guide.readthedocs.io/tutorials/distributing-packages/">distributing Python packages through PyPI</a>. While that seems more or less straightforward for pure Python projects, the story gets more complicated for our case, where extensions in another language need to be compiled in a platform-dependent manner. I ended up with some insights, but also a lot of remaining confusion:</p>
</div>
<div class="olist arabic">
<div class="title">Generally there are two options:</div>
<ol class="arabic">
<li>
<p>compiling the extensions during installation</p>
</li>
<li>
<p>distributing pre-compiled binaries</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>For 1. I found very little information on how to actually implement that. One option seems to <a href="https://docs.python.org/2/extending/building.html">build the extensions using distutils</a> in the setup.py script, although I am not sure if that requires the user to install from source, instead of installing using pip. One <a href="https://stackoverflow.com/questions/31380578/how-to-avoid-building-c-library-with-my-python-package">post</a> mentions that they used <code>build_ext</code> with pip to build a C extension during installation, but I could just not find any information on how exactly that works.</p>
</div>
<div class="paragraph">
<p>I found much more information on option 2. The preferred way to package binary extensions through are <a href="https://python-packaging-user-guide.readthedocs.io/tutorials/distributing-packages/#wheels">wheels</a>.
&gt;A wheel is a built package that can be installed without needing to go through the build process. Installing wheels is substantially faster for the end user than installing from a source distribution.</p>
</div>
<div class="paragraph">
<p>In our case we would need to create a Platform Wheel, which is a platform dependent wheel that contains compiled extensions. PyPI currently supports wheels for Windows and OS X but only a compatible <a href="https://www.python.org/dev/peps/pep-0513/">subset of linux distributions</a>. Wheels appear to be the preferred and more standardized way of packaging versus the older egg format (see this <a href="https://packaging.python.org/discussions/wheel-vs-egg/">discussion</a>) and are used e.g. to manage <a href="https://pypi.python.org/pypi/numpy">Numpy</a> distribution.</p>
</div>
<div class="paragraph">
<div class="title">Conda</div>
<p>Another option is to use conda to package our project. This is where I am still confused. Building a <a href="https://conda.io/docs/build_tutorials/pkgs.html">conda package from an existing PyPI project</a> seems straightforward. Those can apparently be build for one platfrom, converted for others and then uploaded to anaconda.org. But I am not sure if that is only true for Python packages, or for binary extensions too, and how it works in the latter case (do the extensions already have to be on PyPI?). There is also a tutorial how to build a <a href="https://conda.io/docs/build_tutorials/postgis.html">conda package from scratch for any language</a>, for which no PyPI project is required. But it is still a bit obscure to me how exactly that works, and what are the advantages over using PyPI with wheels. I found some thoughts on the latter question <a href="https://jakevdp.github.io/blog/2016/08/25/conda-myths-and-misconceptions/">here under Myth#6</a></p>
</div>
<div class="paragraph">
<p>Hopefully I can update with a better understanding soon.</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/06/16/Distributing.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/06/16/Distributing.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Fri, 16 Jun 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[To Docker or not to Docker]]></title><description><![CDATA[<div class="paragraph">
<p>Reaching out to the neuroimaging community regarding means of software distribution got me many helpful replies and I learned quite a bit about Docker and related tools along the way. My main take-aways:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Docker as a scientific tool in the neuroimaging community is of growing importance, as exemplified by <a href="http://bids-apps.neuroimaging.io/">BIDS Apps</a> or <a href="http://natacha-beck.github.io/cbrain_docker/#/">CBRAIN</a>. However, it still in an early stage so that widespread adoption will take time and installation procedures might need to be tweaked due to changes to the Docker project itself.</p>
</li>
<li>
<p>Default Docker images such as AlpineLinux do not add a lot of overhead (they are much smaller than virtual machines) and should not result in a significant performance penalties unless one is dealing with super efficient numerical code.</p>
</li>
<li>
<p>Using Docker in combination with <a href="http://singularity.lbl.gov/">Singularity</a> helps to run containers without root access and without Docker being actually installed, e.g. on HPCs</p>
</li>
<li>
<p>When distributing through Docker it is even more important to have good regression tests across platforms and software versions. There are two projects trying to make this easier: <a href="https://github.com/kaczmarj/neurodocker">neurodocker</a> and <a href="https://github.com/ReproNim/niceman">niceman</a></p>
</li>
<li>
<p>One interesting approach is, in addition to the Docker image, to publish a <a href="https://github.com/poldracklab/fmriprep/blob/master/wrapper/fmriprep_docker.py">standalone script</a> that generates Docker commands for users through <a href="https://pypi.python.org/pypi/fmriprep-docker">PyPI</a>, so it can be install with pip.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>One of the most helpful comments regarding our project I found to be this (<a href="https://neurostars.org/t/using-docker-to-distribute-highres-neuroimaging-software/442/2?u=juhuntenburg">on neurostars.org</a>):</p>
</div>
<div class="sidebarblock">
<div class="content">
<div class="paragraph">
<p>"If you are looking to distribute a library that is intended to be integrated with other software wrapping it in Docker will make it hard if not impossible. If you are looking to distribute a command line tool with complex set of dependencies Docker is a good fit."</p>
</div>
</div>
</div>
<div class="paragraph">
<p>From the replies and talking to my mentors I got the sense that it will be the best choice for us to focus on more traditional ways of download and installation for now. Especially, because integrating our tools with other software is a main objective of this project. But we will also explore if it makes sense to additionally provide a Docker Image later on.</p>
</div>
<div class="paragraph">
<p><em>Thanks for all the helpful comments and suggestions!</em></p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/06/03/To-Docker-or-not-to-Docker.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/06/03/To-Docker-or-not-to-Docker.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Sat, 03 Jun 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Wisdom of the crowd]]></title><description><![CDATA[<div class="paragraph">
<p>This week, GSoC started with the "community bonding" phase. I already feel pretty bonded with my software community (in fact I constitute 1/3 of it), so I use the time to reach out to the larger neuroimaging community regarding one of the first issues I want to address:</p>
</div>
<div class="paragraph">
<p><em>What is the best way to distribute the Python version of CBS Tools?</em></p>
</div>
<div class="paragraph">
<p>I have previously discussed this question with my mentors and other colleagues, and one suggestion that came up is to deploy the tools via <a href="https://www.docker.com/">Docker</a>. In order to find out what neuroimaging folks think about docker I have started discussion threads on <a href="https://neurostars.org/t/using-docker-to-distribute-highres-neuroimaging-software/442">neurostars</a> and in the <a href="https://brainhack-slack-invite.herokuapp.com/">brainhack slack team</a>.</p>
</div>
<div class="paragraph">
<p>I know very little about docker myself, so I also started watching some <a href="https://www.youtube.com/playlist?list=PLoYCgNOIyGAAzevEST2qm2Xbe3aeLFvLc">tutorials</a>. Whether we end up using it or not, my feeling is it won&#8217;t hurt in the future to know a thing or two about docker.</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/05/11/Wisdom-of-the-crowd.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/05/11/Wisdom-of-the-crowd.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Thu, 11 May 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Google Summer of Code (GSoC)]]></title><description><![CDATA[<div class="paragraph">
<p>On this site I will document my work during the Google Summer of Code 2017 with INCF. Follow the links for a project description in <a href="https://summerofcode.withgoogle.com/projects/?sp-page=2#5716469263368192">short</a> or <a href="https://docs.google.com/document/d/1lkcTpcYT1r1qwh4GwccyWjY3cq2VZ89AlQoKa4Fd2aQ/edit?usp=sharing">long</a>.</p>
</div>]]></description><link>https://juhuntenburg.github.io/gsoc2017/2017/05/08/Google-Summer-of-Code-G-SC.html</link><guid isPermaLink="true">https://juhuntenburg.github.io/gsoc2017/2017/05/08/Google-Summer-of-Code-G-SC.html</guid><dc:creator><![CDATA[Julia Huntenburg]]></dc:creator><pubDate>Mon, 08 May 2017 00:00:00 GMT</pubDate></item></channel></rss>