Commit e31ebba0 authored by Alexander Schoch's avatar Alexander Schoch

Merge branch 'master' of

parents a9f88eac b7cd1042
# LaTeX traces
# Bibtex traces
# PythonTeX traces and binaries
# Gedit
\usepackage[T1]{fontenc} %pipes don't display properly without this
\usepackage[T1]{fontenc} % the pipe character doesn't display properly without this
\usepackage{minted} % COMPILE WITH `pdflatex -shell-escape`!
\usepackage{siunitx} %pretty measurement unit rendering
\usepackage{hyperref} %enable hyperlink for urls
\usepackage{siunitx} % pretty measurement unit rendering
\usepackage{hyperref} % enable hyperlink for URLs
\usepackage[os=win]{menukeys} % by default keys are given for MacOS
......@@ -26,9 +28,9 @@
%Define generic colors
%Define data colors
This source diff could not be displayed because it is too large. You can view the blob instead.
git /gitlab tutorial planned for UZH zentrale informatik
target group:
bachelor informatik
master/phd students
both mostly want to use git with code or latex
version control (backup, recover old state, make changes visible)
publish (how, which license)
contribute (work together on same project)
presentation and then practical examples for each topic
for each topic add link/resource to more advanced explanations
motivation 10'/5':
demonstrate how git can recover files and make visible who changed what
explain service provider benefits (backup, collaboration)
ask what interest of participants are to focus advanced topics
git intro 5'/15':
install git
create first local repository
do first commit
show it worked with git status / git log
remote intro 10'/30':
create repository online
do steps of git global config on welcome screen
do steps of create new repository on welcome screen
edit Readme to learn about markdown
do add license on gitlab webpage
git GUI client 5'/15':
install github desktop
open repo & do commit
sync with push/pull
view changes of previous commits
advanced topics sorted by preference (each around 20'):
create branch & merge request
create issue & mention it in commit
fork & merge back into origin
add different remotes
use SSH key
resources considered:
compicampus course gives a good overview, but not suitable structured has many advanced resources
git boot on has many advanced resources
cheatsheet github
"git for ages 4 and up" (well made youtube tutorial)
personal experience
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<h1>Hallo Welt</h1>
<h2>Hallo Welt</h2>
\ No newline at end of file
author = {Horea-Ioan Ioanas and Markus Rudin},
title = {Reproducible Self-Publishing for {P}ython-Based Research},
year = 2018,
month = aug,
publisher = {EuroSciPy},
url = {},
doi = {10.6084/m9.figshare.7247339.v1},
author = {Horea-Ioan Ioanas and Bechara Saab and Markus Rudin},
title = {Gentoo Linux for Neuroscience - a replicable, flexible, scalable, rolling-release environment that provides direct access to development software},
volume = {3},
number = {},
year = {2017},
doi = {10.3897/rio.3.e12095},
publisher = {Pensoft Publishers},
abstract = {},
issn = {},
pages = {e12095},
URL = {},
eprint = {},
journal = {Research Ideas and Outcomes}
#!/usr/bin/env bash
pdflatex -shell-escape slides.tex
bibtex slides
pdflatex -shell-escape slides.tex
pdflatex -shell-escape slides.tex
#!/usr/bin/env bash
wget -O samri/
# reset the system
rm -rf /var/db/repos/chymeric/
emerge -C samri
# reset the overlay repo
cd overlay/location/with/Chymera/account
git reset --hard commitwhichwasbeforethepull
git push -f origin master
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE pkgmetadata SYSTEM "">
<maintainer type="person">
<name>Horea Christian</name>
<longdescription lang="en">
SAMRI (Small Animal Magnetic Resonance Imaging) — pronounced "Sam-rye" — provides
fMRI preprocessing, metadata parsing, and data analysis functions and workflows.
SAMRI integrates functionalities from a number of other packages to create
higher-level tools. The resulting interfaces aim to maximize reproducibility,
simplify batch processing, and minimize the number of function calls required to
generate figures and statistical summaries from the raw data.
<remote-id type="github">IBT-FMI/SAMRI</remote-id>
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
PYTHON_COMPAT=( python{3_5,3_6} )
inherit distutils-r1
DESCRIPTION="Small Animal Magnetic Resonance Imaging"
SRC_URI="${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
test? (
from setuptools import setup, find_packages
packages = find_packages(exclude=('samri.tests*', 'samri.*.tests*'))
description = "Small animal magnetic resonance imaging via Python.",
author = "Horea Christian",
author_email = "",
url = "",
keywords = ["fMRI", "pipelines", "data analysis", "bruker"],
classifiers = [],
install_requires = [],
provides = ["samri"],
packages = packages,
extras_require = {
entry_points = {'console_scripts' : \
['SAMRI = samri.cli:main']
\title{Software Management for Open Science}
\author{Horea Christian}
\institute{SSC TheAlternative | ETHZ and UZH}
\begin{frame}{These Slides}
Type one link, click all others:
\item Download \textcolor{lg}{\href{}{\texttt{}}}
\subsection{... for the demo session}
Linux and MacOS:
\item Check that you can run:
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|ssh YOURUSER@|
\item Download and launch “Git for Windows” from \textcolor{lg}{\href{}{\texttt{}}}.
\item Check that you can run:
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|ssh YOURUSER@|
\begin{frame}{Command Line Text Editor}
Usable via SSH and ubiquitous. There are many alternatives, but here we use \textcolor{lg}{\texttt{nano}}:
\item Open file:
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|nano file|
\item Save via: \keys{\ctrl + o}, \keys{\enter}
\item Exit via: \keys{\ctrl + x}
\begin{frame}{Git and Social Coding}
Git needs to know who you are.
\item On the server, run:
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|git config --global "Your Name"|
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|git config --global|
GitHub is a \textbf{social coding platform} providing free accounts:
\item Register under \textcolor{lg}{\href{}{\texttt{}}}.
\item Use a password which you can remember.
\subsection{What is software management?}
\begin{frame}{The Package}
\textcolor{ldorange}{\Large Better organization for your research!}
A package is a software format which is (easily):
\item Distributable
\item Integrated
\item Testable
\item Updateable
\item Uninstallable
\item Understandable
\begin{frame}{Package Management --- best done automatically}
Packages interact in complex and nontrivial manners:
\item Version-dependent behaviour
\item Optional features
\item Incompatibilities
\item Static/dynamic linking
\caption{Minimal neuroscience package dependency stack \cite{Ioanas2017}}
\begin{frame}{Binary Packages}
\caption{Rudimentary overview of binary package distribution.}
\item Faster installation
\item Less variable installation
\item No access to live software
\item Man-in-the middle
\item Limited support for rolling release
\begin{frame}{Source-Based Packages}
\caption{Rudimentary overview of source-based package distribution.}
\item Live software is a first-class citizen
\item Thin wrapper for upstream
\item Acutely version and linking aware
\item Slower installation
\item More variable installation
\subsection{Why does open science require package management?}
\item Make development more transparent.
\item Get \textbf{constructive} feedback.
\item Ask for help with concrete reproducible examples.
\item Easily manage \textcolor{lg}{\href{}{\texttt{bugs/issues}}} and \textcolor{lg}{\href{}{\texttt{conributions}}}.
\item Implement proper version tracking.
\item Reach more potential users.
\item Communicate with users to improve your software's usability.
\item Retain more users.
\item Establish proof of authorship.
\item Publicize your innovative workflows, solutions, data structures.
\item Create a handle for attribution (including DOI), e.g:
\item BehavioPy: \textcolor{lg}{\href{}{\texttt{10.5281/zenodo.188169}}}
\item Nipype: \textcolor{lg}{\href{}{\texttt{10.5281/zenodo.50186}}}
A sustainable project \textbf{cannot} depend on environments remaining unchanged.
\item Ensure long-term viability of your software.
\item Avoid death-by-PhD.
\item Give your funders their money's worth.
\item Develop a lean start-up.
\item Maintain a reliable and affordable infrastructure for your work.
\begin{frame}{Why Not?}
\item Don't be afraid of your software not being “good/unique enough”!
\item Don't wait until your software is “ready”!
\item A lot of research software you are already using is not written by “professional” programmers.
\subsection{How do I package my software?}
\begin{frame}{Choose Appropriate Technologies}
\caption{Gentoo Linux Logo by Gentoo Foundation and Lennart Andre Rolland - CC BY-SA/2.5.}
\caption{Python Logo by Python Software Foundation.}
\begin{frame}{Python Package Distribution}
You can package your python software by writing \textbf{one short} file.
\item Python provides its own limited package management, e.g. via \textcolor{lg}{\href{}{\texttt{setuptools}}}.
\item Package metadata saved in \texttt{}, e.g. \textcolor{lg}{\href{}{\texttt{SAMRI/}}}.
\begin{frame}{Gentoo Packages}
A Gentoo package is \textbf{one short} file.
\item Regardless of the programming language
\item Can automatically interpret information contained in the package, e.g. in \textcolor{lg}{\texttt{}}
\begin{frame}{Reposit Your Software}
\caption{Git Logo by Jason Long (\href{}{CC-BY-3.0})}
You can self-host, but hosting is also available via social coding platforms:
\item GitLab
\item GitHub
\item Bitbucket
\subsection{Put what you have learned into practice, and start typing...}
\begin{frame}{A Few Basic Gentoo Commands}
\item Check available package names, versions, and details.
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|eix -v nibabel|
\item See package dependencies.
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|equery g nibabel|
\item See what packages depend on a said package.
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|equery d nibabel|
\item See files installed by package.
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|equery f nibabel|
\item Try to install a new package.
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|emerge -p psychopy|
\begin{frame}{Reproduce a Scientific Article}
Novel frameworks, such as RepSeP \cite{repsep} permit articles to be written as software.
\item Get the source code for brand-new articles:
\item Work-in-progress (reexecution time \SI{\approx 2}{\minute})
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|git clone |
\item Preprint (reexecution time \SI{\approx 11}{\minute})
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|git clone |
\item Switch to article directory.
\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|cd nvcz|
\item Attempt to reexecute.
%\mint[bgcolor=tlg,fontsize=\footnotesize]{bash}|git chechout 28b5d2d1|
\begin{frame}{What happened? Dependency requirements happened.}
\textcolor{ldorange}{\Large But you can solve the issue yourself!}
Write a new package atom for the package manager.
\item Gentoo Linux makes this wholly autonomous.
\item Solve one problem only once:
\item Installation will be automatic on all your further systems.
\item And on everybody else's systems!