diff options
author | Prabhu Ramachandran | 2016-12-22 00:21:18 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2016-12-22 00:21:18 +0530 |
commit | 62ced6cae957a19e66bdcca3699f9196257505d9 (patch) | |
tree | b891793e7529bb66319b7b83a0866659d24648cc /scipy | |
parent | 4e39fc303ced001ab8e963179747b9e8de011692 (diff) | |
download | python-workshops-62ced6cae957a19e66bdcca3699f9196257505d9.tar.gz python-workshops-62ced6cae957a19e66bdcca3699f9196257505d9.tar.bz2 python-workshops-62ced6cae957a19e66bdcca3699f9196257505d9.zip |
Add intro and prelim slides.
The intro adds a brief introduction on Python and why it is useful. The
second is a set of slides to help make a few things clearer.
Diffstat (limited to 'scipy')
-rw-r--r-- | scipy/basic/data/intro/blank.png | bin | 0 -> 3371 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/dam_break_poster.png | bin | 0 -> 1591720 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/dam_break_poster_0.png | bin | 0 -> 1365261 bytes | |||
-rwxr-xr-x | scipy/basic/data/intro/django_page.png | bin | 0 -> 206548 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/m2_app.png | bin | 0 -> 168736 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/mayavi-ipython.png | bin | 0 -> 87517 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/python-orgs.png | bin | 0 -> 422631 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/python_download.png | bin | 0 -> 825396 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/scipy_screenie.png | bin | 0 -> 149954 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/traits_ui_qt.png | bin | 0 -> 48441 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/traits_ui_wx.png | bin | 0 -> 35938 bytes | |||
-rw-r--r-- | scipy/basic/data/intro/wxpy_demo.png | bin | 0 -> 183327 bytes | |||
-rw-r--r-- | scipy/basic/intro.tex | 325 | ||||
-rw-r--r-- | scipy/basic/prelims.tex | 265 |
14 files changed, 590 insertions, 0 deletions
diff --git a/scipy/basic/data/intro/blank.png b/scipy/basic/data/intro/blank.png Binary files differnew file mode 100644 index 0000000..b425201 --- /dev/null +++ b/scipy/basic/data/intro/blank.png diff --git a/scipy/basic/data/intro/dam_break_poster.png b/scipy/basic/data/intro/dam_break_poster.png Binary files differnew file mode 100644 index 0000000..18b7421 --- /dev/null +++ b/scipy/basic/data/intro/dam_break_poster.png diff --git a/scipy/basic/data/intro/dam_break_poster_0.png b/scipy/basic/data/intro/dam_break_poster_0.png Binary files differnew file mode 100644 index 0000000..c7d2a66 --- /dev/null +++ b/scipy/basic/data/intro/dam_break_poster_0.png diff --git a/scipy/basic/data/intro/django_page.png b/scipy/basic/data/intro/django_page.png Binary files differnew file mode 100755 index 0000000..f95e8a4 --- /dev/null +++ b/scipy/basic/data/intro/django_page.png diff --git a/scipy/basic/data/intro/m2_app.png b/scipy/basic/data/intro/m2_app.png Binary files differnew file mode 100644 index 0000000..24e5e2f --- /dev/null +++ b/scipy/basic/data/intro/m2_app.png diff --git a/scipy/basic/data/intro/mayavi-ipython.png b/scipy/basic/data/intro/mayavi-ipython.png Binary files differnew file mode 100644 index 0000000..3730167 --- /dev/null +++ b/scipy/basic/data/intro/mayavi-ipython.png diff --git a/scipy/basic/data/intro/python-orgs.png b/scipy/basic/data/intro/python-orgs.png Binary files differnew file mode 100644 index 0000000..feeaeb6 --- /dev/null +++ b/scipy/basic/data/intro/python-orgs.png diff --git a/scipy/basic/data/intro/python_download.png b/scipy/basic/data/intro/python_download.png Binary files differnew file mode 100644 index 0000000..cc4a939 --- /dev/null +++ b/scipy/basic/data/intro/python_download.png diff --git a/scipy/basic/data/intro/scipy_screenie.png b/scipy/basic/data/intro/scipy_screenie.png Binary files differnew file mode 100644 index 0000000..6a6bf39 --- /dev/null +++ b/scipy/basic/data/intro/scipy_screenie.png diff --git a/scipy/basic/data/intro/traits_ui_qt.png b/scipy/basic/data/intro/traits_ui_qt.png Binary files differnew file mode 100644 index 0000000..6330e67 --- /dev/null +++ b/scipy/basic/data/intro/traits_ui_qt.png diff --git a/scipy/basic/data/intro/traits_ui_wx.png b/scipy/basic/data/intro/traits_ui_wx.png Binary files differnew file mode 100644 index 0000000..468f7ff --- /dev/null +++ b/scipy/basic/data/intro/traits_ui_wx.png diff --git a/scipy/basic/data/intro/wxpy_demo.png b/scipy/basic/data/intro/wxpy_demo.png Binary files differnew file mode 100644 index 0000000..a62bba8 --- /dev/null +++ b/scipy/basic/data/intro/wxpy_demo.png diff --git a/scipy/basic/intro.tex b/scipy/basic/intro.tex new file mode 100644 index 0000000..03c0ad0 --- /dev/null +++ b/scipy/basic/intro.tex @@ -0,0 +1,325 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%Tutorial slides on Python. +% +% Author: FOSSEE +% Copyright (c) 2009-2016, FOSSEE, IIT Bombay +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass[14pt,compress]{beamer} + +% Modified from: generic-ornate-15min-45min.de.tex +\mode<presentation> +{ + \usetheme{Warsaw} + \useoutertheme{infolines} + \setbeamercovered{transparent} +} + +% Remove navigation symbols. +\setbeamertemplate{navigation symbols}{} + +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +%\usepackage{times} +\usepackage[T1]{fontenc} + +% Taken from Fernando's slides. +\usepackage{ae,aecompl} +\usepackage{mathpazo,courier,euler} +\usepackage[scaled=.95]{helvet} + +\definecolor{darkgreen}{rgb}{0,0.5,0} + +\usepackage{listings} +\lstset{language=Python, + basicstyle=\ttfamily\bfseries, + commentstyle=\color{red}\itshape, + stringstyle=\color{darkgreen}, + showstringspaces=false, + keywordstyle=\color{blue}\bfseries} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Macros +\setbeamercolor{emphbar}{bg=blue!20, fg=black} +\newcommand{\emphbar}[1] +{\begin{beamercolorbox}[rounded=true]{emphbar} + {#1} + \end{beamercolorbox} +} +\newcounter{time} +\setcounter{time}{0} +\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} + +\newcommand{\typ}[1]{\lstinline{#1}} + +\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } + +\newcommand\BackgroundPicture[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[width=1.0\paperwidth,height=1.0\paperheight]{#1} + \hfill \vfill +}}} + +% For non-wide pictures, set the width so that the height scales +% appropriately. +\newcommand\BackgroundPictureWidth[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[width=1.0\paperwidth]{#1} + \hfill \vfill +}}} + +% For shorter pictures, set the height so that the width scales +% appropriately. +\newcommand\BackgroundPictureHeight[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[height=1.0\paperheight]{#1} + \hfill \vfill +}}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Title page +\title[Introduction]{Introductory Scientific Computing with +Python} +\subtitle{Introduction to Python} + +\author[FOSSEE] {FOSSEE} + +\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} +\date[] {Mumbai, India +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} +%\logo{\pgfuseimage{iitmlogo}} + + +%% Delete this, if you do not want the table of contents to pop up at +%% the beginning of each subsection: +\AtBeginSubsection[] +{ + \begin{frame}<beamer> + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +\AtBeginSection[] +{ + \begin{frame}<beamer> + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +% If you wish to uncover everything in a step-wise fashion, uncomment +% the following command: +%\beamerdefaultoverlayspecification{<+->} + +%%\includeonlyframes{current,current1,current2,current3,current4,current5,current6} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% DOCUMENT STARTS +\begin{document} + +\begin{frame} + \maketitle +\end{frame} + +\begin{frame} + \frametitle{Acknowledgement} + \Large + \begin{center} + \alert{FOSSEE group (\url{fossee.in})} \\ + based at\\ + \alert{IIT Bombay}\\ + and funded by\\ + The National Mission on Education through ICT, \\ + \alert{Ministry of HRD, India} + \end{center} +\end{frame} + + +\begin{frame}[plain] + \begin{center} + \Huge + Why Python? + \vspace*{1in} + + For Scientific Computing? + \end{center} + +\end{frame} + +\begin{frame} + \frametitle{Need: Toolkit for diversity} + \Large + \begin{itemize} + \item Numeric and Symbolic + \item Exploration and Visualization + \item High performance + \item Parallel computing + \item User interfaces, Web + \item Other tasks + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Why Python?} + \Large + \begin{itemize} + \item Easy to read and learn + \item Powerful interactive interpreter + \item Scalable, general purpose + \item High-level, modular + \item Procedural, OO, functional + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Why Python?} + \Large + \begin{itemize} + \item Extensive libraries + \item Rapid application development + \item Interface to C++, C and FORTRAN + \item Cross-platform + \item Open Source + \end{itemize} +\end{frame} + + +\begin{frame}[plain] + \frametitle{Requirements: numeric computation} + + \begin{center} + \pgfimage[height=3.5in]{data/intro/scipy_screenie} + + \end{center} + +\end{frame} + +\begin{frame}[plain] + \frametitle{SciPy} + \begin{itemize} + \item Linear algebra + \item Numerical integration + \item Fourier transforms + \item Signal processing + \item Special functions + \item Statistics + \item Optimization + \item Image processing + \item ODE solvers + \vspace*{0.2in} + \item Uses LAPACK, QUADPACK, ODEPACK, FFTPACK etc. from netlib + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Requirement: Exploration/Visualization} + \begin{center} + \pgfimage[height=3.0in]{data/intro/mayavi-ipython} + \end{center} + \end{frame} + +\begin{frame}[plain] + \frametitle{3D visualization with Mayavi2} + \vspace*{-0.3in} + \begin{center} + \hspace*{-0.3in}\pgfimage[width=4.75in]{data/intro/m2_app} + \end{center} +\end{frame} + +\begin{frame}[plain] + \frametitle{Requirement: HPC, parallel computing} + \begin{center} + \includegraphics[height=1.75in]{data/intro/dam_break_poster_0} + \includegraphics[height=1.75in]{data/intro/dam_break_poster} + \end{center} +\end{frame} + +\begin{frame}[plain] + \frametitle{Requirement: UI} + + \begin{center} + \pgfimage[height=3.25in]{data/intro/wxpy_demo} + + \end{center} + +\end{frame} + +\begin{frame}[plain, fragile] + \frametitle{Super-simple UIs} +%\footnotesize +\begin{lstlisting} +from traits.api import * +class Person(HasTraits): + name = Str('name') + age = Range(0.0, 200.0) + sex = Enum('male', 'female') + +p = Person(name='Ram') +p.configure_traits() +\end{lstlisting} +\hrule +\pgfimage[width=0.5\textwidth, interpolate=true]{data/intro/traits_ui_wx} +\pgfimage[width=0.5\textwidth, interpolate=true]{data/intro/traits_ui_qt} +\begin{center}WxPython/Qt +\end{center} +\end{frame} + + + +\BackgroundPicture{data/intro/django_page} +\begin{frame}[plain] +\end{frame} +\BackgroundPicture{data/intro/blank} + +\begin{frame}[plain,fragile] + \frametitle{Easy to read and still compact?} + \footnotesize + \begin{lstlisting} +def qsort(L): + """Quick sort for given sequence, `L`.""" + if not L: return L # exit recursion if input is empty + pivot, rest = L[0], L[1:] + less_than = [ lt for lt in rest if lt < pivot ] + greater_eq = [ ge for ge in rest if ge >= pivot ] + return qsort(less_than) + [pivot] + qsort(greater_eq) + + \end{lstlisting} +\end{frame} + +\begin{frame}[plain] + \Huge + \begin{center} + + \structure{Python users?} + \end{center} +\end{frame} + +\BackgroundPictureWidth{data/intro/python-orgs} +\begin{frame}[plain] +\end{frame} +\BackgroundPicture{data/intro/blank} + +\begin{frame}[plain] + \emphbar{\Large \hfill Diverse needs, one language \hfill } + \emphbar{\Large \hfill Python! \hfill} + \begin{center} + %\structure{Python!} + \pgfimage[height=2in]{data/intro/python_only_logo} + + \url{www.python.org} + \end{center} + +\end{frame} + + +\end{document} diff --git a/scipy/basic/prelims.tex b/scipy/basic/prelims.tex new file mode 100644 index 0000000..aad257f --- /dev/null +++ b/scipy/basic/prelims.tex @@ -0,0 +1,265 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%Tutorial slides on Python. +% +% Author: FOSSEE +% Copyright (c) 2009-2016, FOSSEE, IIT Bombay +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass[14pt,compress]{beamer} + +% Modified from: generic-ornate-15min-45min.de.tex +\mode<presentation> +{ + \usetheme{Warsaw} + \useoutertheme{infolines} + \setbeamercovered{transparent} +} + +% Remove navigation symbols. +\setbeamertemplate{navigation symbols}{} + +\usepackage[english]{babel} +\usepackage[latin1]{inputenc} +%\usepackage{times} +\usepackage[T1]{fontenc} + +% Taken from Fernando's slides. +\usepackage{ae,aecompl} +\usepackage{mathpazo,courier,euler} +\usepackage[scaled=.95]{helvet} + +\definecolor{darkgreen}{rgb}{0,0.5,0} + +\usepackage{listings} +\lstset{language=Python, + basicstyle=\ttfamily\bfseries, + commentstyle=\color{red}\itshape, + stringstyle=\color{darkgreen}, + showstringspaces=false, + keywordstyle=\color{blue}\bfseries} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Macros +\setbeamercolor{emphbar}{bg=blue!20, fg=black} +\newcommand{\emphbar}[1] +{\begin{beamercolorbox}[rounded=true]{emphbar} + {#1} + \end{beamercolorbox} +} +\newcounter{time} +\setcounter{time}{0} +\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} + +\newcommand{\typ}[1]{\lstinline{#1}} + +\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } + +\newcommand\BackgroundPicture[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[width=1.0\paperwidth,height=1.0\paperheight]{#1} + \hfill \vfill +}}} + +% For non-wide pictures, set the width so that the height scales +% appropriately. +\newcommand\BackgroundPictureWidth[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[width=1.0\paperwidth]{#1} + \hfill \vfill +}}} + +% For shorter pictures, set the height so that the width scales +% appropriately. +\newcommand\BackgroundPictureHeight[1]{% + \setbeamertemplate{background}{% + \parbox[c][\paperheight]{\paperwidth}{% + \vfill \hfill + \pgfimage[height=1.0\paperheight]{#1} + \hfill \vfill +}}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Title page +\title[Introduction]{Introductory Scientific Computing with +Python} +\subtitle{Some preliminaries} + +\author[FOSSEE] {FOSSEE} + +\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} +\date[] {Mumbai, India +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo} +%\logo{\pgfuseimage{iitmlogo}} + + +%% Delete this, if you do not want the table of contents to pop up at +%% the beginning of each subsection: +\AtBeginSubsection[] +{ + \begin{frame}<beamer> + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +\AtBeginSection[] +{ + \begin{frame}<beamer> + \frametitle{Outline} + \tableofcontents[currentsection,currentsubsection] + \end{frame} +} + +% If you wish to uncover everything in a step-wise fashion, uncomment +% the following command: +%\beamerdefaultoverlayspecification{<+->} + +%%\includeonlyframes{current,current1,current2,current3,current4,current5,current6} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% DOCUMENT STARTS +\begin{document} + +\begin{frame} + \maketitle +\end{frame} + +\begin{frame}[plain] + \frametitle{What is Python?} + \large + \begin{itemize} + \item Python: the programming language + + \vspace*{0.5in} + \item \typ{python}: the interpreter + \end{itemize} +\end{frame} + +\begin{frame}[fragile] + \frametitle{The interpreter} + \small + \begin{lstlisting} +$ python +Python 2.7.9 (default, Feb 10 2015, 03:29:10) +Type "help", "copyright", "credits" or "license" for more information. +>>> +\end{lstlisting} %$ +\end{frame} + +\begin{frame}[fragile] + \frametitle{The interpreter} + \small +\begin{lstlisting} +$ python hello.py +hello world +$ +\end{lstlisting} +\end{frame} + +\begin{frame}[plain] + \frametitle{Python standard library} + \begin{itemize} + \item Built-in + \item Batteries included + \item Lot of important functionality + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Python packages} + \begin{itemize} + \item Many other packages available + \item \typ{ipython} + \item \typ{numpy} + \item \typ{scipy} + \item \typ{matplotlib} + \item \typ{PyQt} + \item \typ{django} + \item \typ{mayavi} + \item About 1 lakh packages! + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Official Python} + \begin{center} + \url{www.python.org/downloads} + + \includegraphics[height=2.75in]{data/intro/python_download} + \end{center} +\end{frame} + +\begin{frame} + \frametitle{Python distributions} + \begin{itemize} + \item GNU/Linux: easy to install + \item Usually many packages are easy to install + \item Example: \typ{apt-get}, \typ{yum} etc. + \item Not so easy on OS X and Windows + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Python distribution: Canopy} + \begin{itemize} + \item \url{www.enthought.com/products/canopy} + \item Easy to use, simple + \item Cross platform: Linux, OSX, Windows + \item Free installer + \item Many packages + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Python distribution: Anaconda} + \begin{itemize} + \item \url{www.continuum.io/downloads} + \item Easy to use, simple + \item Cross platform: Linux, OSX, Windows + \item Free installer + \item Many packages + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{For this course} + \begin{itemize} + \item Using Canopy! + \item Simple UI + \item Easy for beginners + \vspace*{0.25in} + \item Advanced users can use anything they want! + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Setup} + \begin{itemize} + \item Download for your platform + \item Install it + \item Start Canopy + \end{itemize} +\end{frame} + +\begin{frame}[plain] + \frametitle{Summary} + \begin{itemize} + \item Python: the programming language + \item \typ{python}: the interpreter + \item Python standard library + \item Other Python packages + \item Python distributions + \end{itemize} +\end{frame} + + + + +\end{document} |