Skip to content
Snippets Groups Projects
Commit 20ad11f9 authored by Joern Ungermann's avatar Joern Ungermann
Browse files

iffTeX update

parent 0341b242
No related branches found
No related tags found
1 merge request!8iffTeX update
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
figures/CODE_shows_definitions.png

216 KiB

figures/argparse.png

374 KiB

figures/logging.png

156 KiB

figures/pdb_4_gwmf_on_ofi_code.png

127 KiB

figures/pdb_and_test_ofi_gwmf.png

402 KiB

figures/pdb_and_test_ofi_gwmf_after_lz_filt.png

493 KiB

figures/pdb_and_test_ofi_lz.png

142 KiB

figures/template_add_features.png

405 KiB

figures/template_main_and_call.png

295 KiB

figures/template_parser.png

390 KiB

......@@ -37,9 +37,9 @@
}
\usetheme{Juelich}
\title{Title}
\subtitle{Subtitle}
\author{L. Krasauskas, M. Geldenhuys}
\title{Coding in RS Group}
\subtitle{\small GIT, automatic testing, standards, programming tools ...}
\author{M. Geldenhuys, L. Krasauskas, P. Preusse, C. Strube, J. Ungermann}
\institute{Forschungszentrum J\"ulich}
\date{\today}
\titlegraphic{
......@@ -50,25 +50,58 @@
\maketitle
\include{git}
\begin{frame}
\frametitle{Frame titile}
\framesubtitle{Frame subtitle}
\frametitle{4-eye priciple}
\framesubtitle{Some general rules we try to follow}
\begin{columns}[onlytextwidth,T]
\begin{column}{0.45\linewidth}
\centering
\includegraphics[width=\textwidth]{gloria_nice_cad.png}
\begin{column}{\linewidth}
\begin{itemize}
\item Readability first!
\begin{itemize}
\item Use python for human-readable code
\item Lesser loops are better
\item Do not over-pythonize
\item In most cases performance is not an issue
\end{itemize}
\item Not every user wants to read the program
\begin{itemize}
\item Provide good help messages to script calls
\item Provide helpful error messages for crashs
\end{itemize}
\item Review some things before you start programming
\begin{itemize}
\item Main data structures of large programs
\item Main file formats
\end{itemize}
\end{itemize}
\end{column}
\begin{column}{0.45\linewidth}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{4-eye priciple}
\framesubtitle{Other does and don'ts: Things which should be trivial}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\begin{itemize}
\item First point
\item Second point
\item organize your data: dictionaries (of arrays)
\item use NCDF for data files
\item include metadata (automatic generation)
\item do not copy and paste
\item can you replace multiple {\it if}-statements by some list?
\item do not re-invent the wheel
\item longevity (do not use exotic libraries)
\item a function with $>$ 50 lines of code is too long
\item use comments
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\include{git}
\begin{frame}
\frametitle{Python}
......@@ -80,6 +113,7 @@
\item Why is good practice important?
\begin{itemize}
\item Readability (group of developers)
\item Less and earlier-detected bugs
\item Makes life easier (Automatically generate documentation)
\end{itemize}
\bigskip
......@@ -146,6 +180,85 @@ def fun(a, b=0., c=True):
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Template script}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\begin{itemize}
\item template script for juwave S3D:
\path{juwave/sinfit/scripts/template_script.py}
\item argparse
\begin{itemize}
\item command-line options
\item automatic help messages with \path{python} \path{script.py} \path{--help}
\end{itemize}
\end{itemize}
\includegraphics[width=0.7\textwidth]{figures/argparse.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Template script}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\begin{itemize}
\item logging
\begin{itemize}
\item by keyword: console output written to logfile
\item additional debugging output possible
\end{itemize}
\end{itemize}
\includegraphics[width=0.7\textwidth]{figures/logging.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Template script}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\begin{itemize}
\item consistent structure for easy testing (\path{--version}, \path{--help}, \path{construct_parser()})
\item file access checks
\item function template with generic docstring
\item copyright declaration string
\includegraphics[width=0.95\textwidth]{figures/template_add_features.png}
\end{itemize}
\end{column}
\end{columns}
\end{frame}
% \begin{frame}
% \frametitle{Template script}
% \framesubtitle{Parser: help messages, required variables, log. and version}
% \begin{columns}[onlytextwidth,T]
% \begin{column}{\linewidth}
% \centering
% \includegraphics[width=0.75\textwidth]{figures/template_parser.png}
% \end{column}
% \end{columns}
% \end{frame}
% \begin{frame}
% \frametitle{template script}
% \framesubtitle{Make it testable, check existence of input and outpath first}
% \begin{columns}[onlytextwidth,T]
% \begin{column}{\linewidth}
% \centering
% \includegraphics[width=0.75\textwidth]{figures/template_main_and_call.png}
% \end{column}
% \end{columns}
% \end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
......@@ -309,4 +422,95 @@ with nc4.Dataset(f"{file_path}.nc", 'w', format='NETCDF4') as ncf:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Editors}
\framesubtitle{E.g. StudioVisualCode helps in programming}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\begin{center}
\includegraphics[width=0.85\textwidth]{figures/CODE_shows_definitions.png}
\end{center}
\begin{itemize}
\item Offers completions
\item Shows next variable needed in function calls
\item Indicates syntax bugs
\item Indicates flake8 errors
\item Runs code
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{PDB}
\framesubtitle{Interactive debugging, using graphics, ...}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\centering
\includegraphics[width=0.85\textwidth]{figures/pdb_4_gwmf_on_ofi_code.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{PDB}
\framesubtitle{Start the debugging from the test case}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\centering
\includegraphics[width=0.85\textwidth]{figures/pdb_and_test_ofi_gwmf.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{PDB}
\framesubtitle{Start the debugging from the test case}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\centering
\includegraphics[width=0.85\textwidth]{figures/pdb_and_test_ofi_gwmf_after_lz_filt.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{PDB}
\framesubtitle{Start the debugging from the test case}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
\centering
\includegraphics[width=0.85\textwidth]{figures/pdb_and_test_ofi_lz.png}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{PDB}
\framesubtitle{Interactive programming}
\begin{columns}[onlytextwidth,T]
\begin{column}{\linewidth}
If you feel uncertain how to set up a certain peace of code ...
\begin{itemize}
\item Set up the test case
\item Set up the code until problematic piece
\item Stop with debugger there $\rightarrow$ all input available
\item try your code in PDB, look at results
\item carry over to program
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment