Skip to content

Commit 23c8193

Browse files
Merge pull request #75 from jonathanrocher/enh/add-notebooks
Add jupyter notebooks for slides
2 parents b69cafd + 22e35f7 commit 23c8193

File tree

9 files changed

+2345
-5
lines changed

9 files changed

+2345
-5
lines changed

slides/01_intro.ipynb

Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "bd484b42",
6+
"metadata": {
7+
"slideshow": {
8+
"slide_type": "slide"
9+
}
10+
},
11+
"source": [
12+
"## Sharing scientific tools: script to desktop application\n",
13+
"\n",
14+
"**Jonathan Rocher, Siddhant Wahal, Jason Chambless, Corran Webster, Prabhu Ramachandran**\n",
15+
"\n",
16+
"**SciPy 2022**\n"
17+
]
18+
},
19+
{
20+
"cell_type": "markdown",
21+
"id": "d143aab8",
22+
"metadata": {
23+
"lines_to_next_cell": 2,
24+
"slideshow": {
25+
"slide_type": "slide"
26+
}
27+
},
28+
"source": [
29+
"## Preliminaries\n",
30+
"\n",
31+
"If you haven't already:\n",
32+
"- Clone the repository: https://github.com/jonathanrocher/ets_tutorial\n",
33+
"- Install packages:\n",
34+
" - Using Enthought Deployment Manager (recommended)\n",
35+
" (https://www.enthought.com/edm):\n",
36+
"\n",
37+
" ```bash\n",
38+
" edm envs create bootstrap\n",
39+
" edm install --environment bootstrap click\n",
40+
" edm run -e bootstrap -- python ci build --environment ets_tutorial\n",
41+
" ```\n",
42+
" - `ets_tutorial` will be our working Python environment. To activate:\n",
43+
" ```bash\n",
44+
" edm shell -e ets_tutorial\n",
45+
" ```\n",
46+
" - Follow instructions in README for conda and pip"
47+
]
48+
},
49+
{
50+
"cell_type": "markdown",
51+
"id": "b3d7f1d2",
52+
"metadata": {
53+
"slideshow": {
54+
"slide_type": "slide"
55+
}
56+
},
57+
"source": [
58+
"## Motivation\n",
59+
"\n",
60+
"- Some tasks are easier with a GUI\n",
61+
"- Seeing a lot of information in one shot\n",
62+
"- Easier for non-programmers\n",
63+
"- Easier to share\n"
64+
]
65+
},
66+
{
67+
"cell_type": "markdown",
68+
"id": "282af803",
69+
"metadata": {
70+
"slideshow": {
71+
"slide_type": "slide"
72+
}
73+
},
74+
"source": [
75+
"## Why ETS? When ETS?\n",
76+
"\n",
77+
"- Open-source\n",
78+
"- Mature\n",
79+
"- Easy to start, easy to grow\n",
80+
"- Tools promotes reusable code and good design patterns\n",
81+
"- Largely declarative UI\n",
82+
"- Backend-agnostic: avoid having to update when PyQt, wxPython, ... update!\n",
83+
"- Limitless around data tools, in particular plotting!\n",
84+
"- Reduced development costs (single programming language)\n",
85+
"- No architecture mind shift necessary (client-server) and no exposure to \n",
86+
" server hacking.\n",
87+
"\n",
88+
"Limitations:\n",
89+
"- Limited by back-end when it comes to widgets compared to Javascript\n",
90+
"- Desktop application isn't a solution for all needs\n"
91+
]
92+
},
93+
{
94+
"cell_type": "markdown",
95+
"id": "03d0901c",
96+
"metadata": {
97+
"slideshow": {
98+
"slide_type": "slide"
99+
}
100+
},
101+
"source": [
102+
"## What is ETS?\n",
103+
"\n",
104+
"- Enthought Tool Suite: https://docs.enthought.com/ets\n",
105+
"- Open Source\n",
106+
"- Packages\n",
107+
" - Traits: Python object attributes on steroids\n",
108+
" - TraitsUI: Easy GUI-building\n",
109+
" - PyFace: Low-level GUI components\n",
110+
" - Envisage: plug-in application framework\n",
111+
" - Chaco: interactive plotting library\n",
112+
" - Mayavi: 3D plotting\n",
113+
" - traits_futures: running tasks in parallel/background\n",
114+
" - And many others...\n"
115+
]
116+
},
117+
{
118+
"cell_type": "markdown",
119+
"id": "b04fb05b",
120+
"metadata": {
121+
"lines_to_next_cell": 2,
122+
"slideshow": {
123+
"slide_type": "slide"
124+
}
125+
},
126+
"source": [
127+
"## Layered package design\n",
128+
"\n",
129+
"<center>\n",
130+
"<img src=\"images/application_layers.png\" height=\"90%\" align=\"center\"/>\n",
131+
"</center>\n"
132+
]
133+
},
134+
{
135+
"cell_type": "markdown",
136+
"id": "516819ae",
137+
"metadata": {
138+
"slideshow": {
139+
"slide_type": "slide"
140+
}
141+
},
142+
"source": [
143+
"## Sample screenshots\n",
144+
"\n",
145+
"- Can make quite sophisticated UIs\n",
146+
"- Much less code\n",
147+
"- Easy to write\n"
148+
]
149+
},
150+
{
151+
"cell_type": "markdown",
152+
"id": "699c3043",
153+
"metadata": {
154+
"slideshow": {
155+
"slide_type": "slide"
156+
}
157+
},
158+
"source": [
159+
"## A Mayavi-based dialog\n",
160+
"\n",
161+
"<center>\n",
162+
"<img src=\"images/lorenz_ui.png\" height=\"90%\" align=\"center\"/>\n",
163+
"</center>\n"
164+
]
165+
},
166+
{
167+
"cell_type": "markdown",
168+
"id": "98615314",
169+
"metadata": {
170+
"lines_to_next_cell": 2,
171+
"slideshow": {
172+
"slide_type": "slide"
173+
}
174+
},
175+
"source": [
176+
"## A customized viewer\n",
177+
"\n",
178+
"<center>\n",
179+
"<img src=\"images/pysph_viewer.png\" height=\"90%\" align=\"center\"/>\n",
180+
"</center>\n"
181+
]
182+
},
183+
{
184+
"cell_type": "markdown",
185+
"id": "949e9a9c",
186+
"metadata": {
187+
"slideshow": {
188+
"slide_type": "slide"
189+
}
190+
},
191+
"source": [
192+
"## Goals\n",
193+
"\n",
194+
"- Start with simple Python script\n",
195+
" - Detect faces\n",
196+
" - Extract Image metadata\n",
197+
"\n",
198+
"- Build a full-fledged desktop application\n",
199+
" - Easy to use UI\n",
200+
" - Learn a little MVC\n",
201+
" - Design application to scale\n",
202+
"\n",
203+
"- Share the application with others\n"
204+
]
205+
},
206+
{
207+
"cell_type": "markdown",
208+
"id": "37ef3b1a",
209+
"metadata": {
210+
"slideshow": {
211+
"slide_type": "slide"
212+
}
213+
},
214+
"source": [
215+
"## Result\n",
216+
"\n",
217+
"Final application we will be building in this tutorial:\n",
218+
"\n",
219+
"<img src=\"../pycasa_final.png\" height=\"90%\" width=\"90%\" align=\"center\"/>\n"
220+
]
221+
},
222+
{
223+
"cell_type": "markdown",
224+
"id": "2f69a9db",
225+
"metadata": {
226+
"slideshow": {
227+
"slide_type": "slide"
228+
}
229+
},
230+
"source": [
231+
"## Schedule\n",
232+
"\n",
233+
"- Step 1: Python script\n",
234+
"- Step 2: Using Traits.\n",
235+
"- Step 3: Basic GUI using TraitsUI\n",
236+
"- Step 4: PyFace application: tree navigator\n",
237+
"- Step 5: More features\n",
238+
"- Step 6: Menus and branding\n",
239+
"- Step 7: [OPTIONAL] Advanced features\n",
240+
"- Step 8: [OPTIONAL] Packaging and sharing\n",
241+
"\n"
242+
]
243+
},
244+
{
245+
"cell_type": "markdown",
246+
"id": "dceead88",
247+
"metadata": {
248+
"slideshow": {
249+
"slide_type": "slide"
250+
}
251+
},
252+
"source": [
253+
"## Basic Python script\n",
254+
"\n",
255+
"- Uses: `PIL`, `skimage`, and `matplotlib`\n",
256+
"- Detects faces in a given image\n",
257+
"- Look inside ...\n"
258+
]
259+
},
260+
{
261+
"cell_type": "markdown",
262+
"id": "923e8267",
263+
"metadata": {
264+
"slideshow": {
265+
"slide_type": "slide"
266+
}
267+
},
268+
"source": [
269+
"## Next steps\n",
270+
"\n",
271+
"- Learn more about traits\n",
272+
"- Build a clean model for our task with traits\n",
273+
"- Learn why models are useful\n"
274+
]
275+
}
276+
],
277+
"metadata": {
278+
"jupytext": {
279+
"formats": "ipynb,md"
280+
},
281+
"kernelspec": {
282+
"display_name": "Python 3",
283+
"language": "python",
284+
"name": "python3"
285+
}
286+
},
287+
"nbformat": 4,
288+
"nbformat_minor": 5
289+
}

slides/01_intro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
jupyter:
33
jupytext:
4+
formats: ipynb,md
45
text_representation:
56
extension: .md
67
format_name: markdown

0 commit comments

Comments
 (0)