-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresentation.tex
266 lines (234 loc) · 9.56 KB
/
presentation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
% no notes
\documentclass{beamer}
% notes and slides
%\documentclass[notes]{beamer}
% notes only
% \documentclass[notes=only]{beamer}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{multirow}
\usepackage{tikz}
\usepackage{circuitikz}
\usepackage{url}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{groupplots,dateplot}
\usetikzlibrary{patterns,shapes.arrows}
\usepackage{standalone}
\usepackage{adjustbox}
\usepackage{lmodern}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{multimedia}
\usepackage{standalone}
\usepackage{csquotes}
\usepackage[outputdir=build]{minted}
% This command allows to reset the footnote to include e.g. a customized copyright reference
% and still include the slide numbers in the original format
% usage: to use this just for one slide, put a { before starting the frame, then write
% \referencefootnote{your copyright text} and then put a } after the end of the frame
\newcommand{\referencefootnote}[1]{\setbeamertemplate{footline}[text line]{%%%
\parbox{0.9\paperwidth}{\vspace*{-23pt}\tiny{\textcolor{gray}{#1}}\hfill\scriptsize\insertframenumber}}}
\PassOptionsToPackage{american}{babel} % change this to your language(s), main language last
% Spanish languages need extra options in order to work with this template
% \PassOptionsToPackage{spanish,es-lcroman}{babel}
\usepackage{babel}
\PassOptionsToPackage{%
backend=biber,bibencoding=utf8, %instead of bibtex
%backend=bibtex8,bibencoding=ascii,%
language=auto,%
style=numeric-comp,%
%style=authoryear-comp, % Author 1999, 2010
%bibstyle=authoryear,dashed=false, % dashed: substitute rep. author with ---
style=alphabetic,
sorting=nyt, % name, year, title
maxbibnames=10, % default: 3, et al.
%backref=true,%
%natbib=true % natbib compatibility mode (\citep and \citet still work)
}{biblatex}
\usepackage{biblatex}
\addbibresource{bib.bib}
% Acronyms. See: http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/acro/acro_en.pdf
\usepackage{acro}
\acsetup{make-links}
\DeclareAcronym{ml}{
short = ML,
long = Machine Learning,
}
\DeclareAcronym{plos}{
short = PLOS,
long = Public Library of Science,
}
\DeclareAcronym{icml}{
short = ICML,
long = International Conference on Machine Learning,
}
\DeclareAcronym{neurips}{
short = NeurIPS,
long = Conference on Neural Information Processing Systems,
}
\DeclareAcronym{pip}{
short = pip,
long = package installer for Python,
}
\DeclareAcronym{pypa}{
short = PyPA,
long = Python Packaging Authority,
}
\DeclareAcronym{pmlr}{
short = PMLR,
long = Proceedings of Machine Learning Research
}
\DeclareAcronym{iclr}{
short = ICLR,
long = International Conference on Learning Representations
}
\DeclareAcronym{pep}{
short = PEP,
long = Python Enhancement Proposal
}
\usetheme{metropolis} % Use metropolis theme
\setbeamertemplate{caption}[default]
\title{Supervising software projects}
\date{10.02.2025}
\institute{HPCA-Lab, Universität Bonn}
\author{Moritz Wolter}
\titlegraphic{\includegraphics[width=2.00cm]{UNI_Bonn_Logo_Standard_RZ.pdf}}
\begin{document}
\maketitle
\begin{frame}
\frametitle{Overview}
\tableofcontents
\end{frame}
\begin{frame}{Motivation}
\begin{itemize}
\item Software engineering protects us from critical faliures and bugs.
\item In 2024 for example, a failure to test software caused rougly 8.5 million Microsoft Windows operating systems to crash worldwide, causing global disruption of critical services
during the CrowdStrike-related IT outages.
\item We are in science, we need to be able to reproduce our and others results.
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Motivation 2, example from science}
Lets play with \url{https://simpleitk.org/}, a standard library for medical image processing,
by opening a DICOM series from the ProstateX dataset.
\begin{minted}{python}
>>> import SimpleITK as sitk
>>> import numpy as np
>>> reader = sitk.ImageSeriesReader()
>>> files = reader.GetGDCMSeriesFileNames(
'./1.3.6.1.4.1.14519.5.2.1.7311.5101.972587624360040843943663321466')
>>> reader.SetFileNames(files)
>>> image = reader.Execute()
>>> image.GetSize()
(384, 384, 19)
>>> sitk.GetArrayFromImage(image).shape
(19, 384, 384)
\end{minted}
\end{frame}
\begin{frame}{Motivation}
\begin{itemize}
\item Numerous projects rely on the current implementation of \texttt{sitk}.
\item $\rightarrow$ Software engineering protects the sanity of ourselves and those around us.
\item $\rightarrow$ Bugs in test code can invalidate the results of entire projects. They lead to wasted time and embarrassing retractions.
\end{itemize}
\end{frame}
\begin{frame}{Why Python}
\begin{figure}
\includestandalone[width=0.4\textwidth]{figures/uses_python}
\includestandalone[width=0.4\textwidth]{figures/ml_in_2024_uses_python}
\caption{(left) Python use at the international conference of machine learning (ml) over time.
(right) python use of works linked at major 2024 ml conferences.}
\end{figure}
\end{frame}
\section{Existing best practices}
\begin{frame}{Software engineering best practices}
\begin{itemize}
\item Version control
\item Documenting requirements
\item Systematic testing
\item Packaging code
\item Continuous integration
\end{itemize}
\end{frame}
\begin{frame}{Version control}
\begin{itemize}
\item Version control is a must for any software project.
\item The university of Bonn for example provides a GitLab instance for students and employees
at \url{https://gitlab.uni-bonn.de/}.
\item Ask you students to share projects links with you.
\item Next we will discuss what to look for in a repository.
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Documenting requirements}
\begin{itemize}
\item With PyTorch, for example, \enquote{reproducible results are not guaranteed across PyTorch releases, individual commits, or different platforms} \cite{PyTorch2024randomness}.
The same is true for most of the software-world, really.
For reproducibility, it is important to document the software environment.
\item With the \acf{pip},
\begin{minted}{bash}
pip freeze > requirements.txt
\end{minted}
does the trick,
\item recommend
\begin{minted}{bash}
conda env export > environment.yml
\end{minted}
to people using conda.
\end{itemize}
\end{frame}
\begin{frame}{Systematic testing}
\begin{itemize}
\item Ask your students to follow a systematic testing approach.
Python projects should have a \texttt{src} and \texttt{tests}-folder \cite{packaging2025python}.
\item We want tests to run automatically. Point people towards \texttt{pytest}
\cite{pytest2025docs} or \texttt{unittest} \cite{unittest2025pythondocs}.
\item Run tests in containers recommend Nox \cite{nox2025docs} or
Tox \cite{tox2025docs}.
\end{itemize}
\end{frame}
\begin{frame}{Packaging}
\begin{itemize}
\item Packaging allows others to install code automatically.
Ultimately packaging is about reducing code duplication, by
making code installable via a Python \texttt{import} statement.
\item It requires us to structure our code and to create a \texttt{pyproject.toml} file.
\item Asks you students to read: Packaging Python-Projects
from the Python-Packaging-Authority~\cite{packaging2025python}.
\end{itemize}
\end{frame}
\begin{frame}{Automatic workflows}
\begin{itemize}
\item Programm a server to run tests automatically.
\item This is a part of what people describe as continuous integration.
\item It helps teams by getting the computer to tell members when they break something.
\end{itemize}
It typically requires us to write a single configuration file.
\end{frame}
\section{Adoption in Machine Learning research}
\begin{frame}{Best Practice adoption in Machine Learning research}
Most of the aforementioned best practices are required by the NeurIPS-Code guide \cite{NeuripsCodeguide}.
\begin{figure}
\centering
\includestandalone[width=0.4\textwidth]{figures/ml_in_2024_license_and_readme}
\includestandalone[width=0.4\textwidth]{figures/ml_in_2024_requirements}
\includestandalone[width=0.4\textwidth]{figures/ml_in_2024_packaging}
\includestandalone[width=0.4\textwidth]{figures/ml_in_2024_tests}
\end{figure}
\end{frame}
\section{Conclusion}
\begin{frame}{Conclusion}
\begin{itemize}
\item When done well software engineering makes everyones lives easier.
\item We get to reuse our own code more easily.
\item Others get to use our code, we reach more people and create more impact.
\item We protect ourselfs from embarrassing retractions.
\item By training networks on tested pre-processing pipelines we reduce waste.
\item Continuous integration protects team members from bugs created elsewhere.
\item \textbf{When you hire for software related positions ask applicants about this!}
\end{itemize}
\end{frame}
\begin{frame}[allowframebreaks]{Literature}
\printbibliography
\end{frame}
\end{document}