Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
289 changes: 289 additions & 0 deletions slides/01_intro.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "bd484b42",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Sharing scientific tools: script to desktop application\n",
"\n",
"**Jonathan Rocher, Siddhant Wahal, Jason Chambless, Corran Webster, Prabhu Ramachandran**\n",
"\n",
"**SciPy 2022**\n"
]
},
{
"cell_type": "markdown",
"id": "d143aab8",
"metadata": {
"lines_to_next_cell": 2,
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Preliminaries\n",
"\n",
"If you haven't already:\n",
"- Clone the repository: https://github.com/jonathanrocher/ets_tutorial\n",
"- Install packages:\n",
" - Using Enthought Deployment Manager (recommended)\n",
" (https://www.enthought.com/edm):\n",
"\n",
" ```bash\n",
" edm envs create bootstrap\n",
" edm install --environment bootstrap click\n",
" edm run -e bootstrap -- python ci build --environment ets_tutorial\n",
" ```\n",
" - `ets_tutorial` will be our working Python environment. To activate:\n",
" ```bash\n",
" edm shell -e ets_tutorial\n",
" ```\n",
" - Follow instructions in README for conda and pip"
]
},
{
"cell_type": "markdown",
"id": "b3d7f1d2",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Motivation\n",
"\n",
"- Some tasks are easier with a GUI\n",
"- Seeing a lot of information in one shot\n",
"- Easier for non-programmers\n",
"- Easier to share\n"
]
},
{
"cell_type": "markdown",
"id": "282af803",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Why ETS? When ETS?\n",
"\n",
"- Open-source\n",
"- Mature\n",
"- Easy to start, easy to grow\n",
"- Tools promotes reusable code and good design patterns\n",
"- Largely declarative UI\n",
"- Backend-agnostic: avoid having to update when PyQt, wxPython, ... update!\n",
"- Limitless around data tools, in particular plotting!\n",
"- Reduced development costs (single programming language)\n",
"- No architecture mind shift necessary (client-server) and no exposure to \n",
" server hacking.\n",
"\n",
"Limitations:\n",
"- Limited by back-end when it comes to widgets compared to Javascript\n",
"- Desktop application isn't a solution for all needs\n"
]
},
{
"cell_type": "markdown",
"id": "03d0901c",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## What is ETS?\n",
"\n",
"- Enthought Tool Suite: https://docs.enthought.com/ets\n",
"- Open Source\n",
"- Packages\n",
" - Traits: Python object attributes on steroids\n",
" - TraitsUI: Easy GUI-building\n",
" - PyFace: Low-level GUI components\n",
" - Envisage: plug-in application framework\n",
" - Chaco: interactive plotting library\n",
" - Mayavi: 3D plotting\n",
" - traits_futures: running tasks in parallel/background\n",
" - And many others...\n"
]
},
{
"cell_type": "markdown",
"id": "b04fb05b",
"metadata": {
"lines_to_next_cell": 2,
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Layered package design\n",
"\n",
"<center>\n",
"<img src=\"images/application_layers.png\" height=\"90%\" align=\"center\"/>\n",
"</center>\n"
]
},
{
"cell_type": "markdown",
"id": "516819ae",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Sample screenshots\n",
"\n",
"- Can make quite sophisticated UIs\n",
"- Much less code\n",
"- Easy to write\n"
]
},
{
"cell_type": "markdown",
"id": "699c3043",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## A Mayavi-based dialog\n",
"\n",
"<center>\n",
"<img src=\"images/lorenz_ui.png\" height=\"90%\" align=\"center\"/>\n",
"</center>\n"
]
},
{
"cell_type": "markdown",
"id": "98615314",
"metadata": {
"lines_to_next_cell": 2,
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## A customized viewer\n",
"\n",
"<center>\n",
"<img src=\"images/pysph_viewer.png\" height=\"90%\" align=\"center\"/>\n",
"</center>\n"
]
},
{
"cell_type": "markdown",
"id": "949e9a9c",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Goals\n",
"\n",
"- Start with simple Python script\n",
" - Detect faces\n",
" - Extract Image metadata\n",
"\n",
"- Build a full-fledged desktop application\n",
" - Easy to use UI\n",
" - Learn a little MVC\n",
" - Design application to scale\n",
"\n",
"- Share the application with others\n"
]
},
{
"cell_type": "markdown",
"id": "37ef3b1a",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Result\n",
"\n",
"Final application we will be building in this tutorial:\n",
"\n",
"<img src=\"../pycasa_final.png\" height=\"90%\" width=\"90%\" align=\"center\"/>\n"
]
},
{
"cell_type": "markdown",
"id": "2f69a9db",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Schedule\n",
"\n",
"- Step 1: Python script\n",
"- Step 2: Using Traits.\n",
"- Step 3: Basic GUI using TraitsUI\n",
"- Step 4: PyFace application: tree navigator\n",
"- Step 5: More features\n",
"- Step 6: Menus and branding\n",
"- Step 7: [OPTIONAL] Advanced features\n",
"- Step 8: [OPTIONAL] Packaging and sharing\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "dceead88",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Basic Python script\n",
"\n",
"- Uses: `PIL`, `skimage`, and `matplotlib`\n",
"- Detects faces in a given image\n",
"- Look inside ...\n"
]
},
{
"cell_type": "markdown",
"id": "923e8267",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Next steps\n",
"\n",
"- Learn more about traits\n",
"- Build a clean model for our task with traits\n",
"- Learn why models are useful\n"
]
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,md"
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
1 change: 1 addition & 0 deletions slides/01_intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
jupyter:
jupytext:
formats: ipynb,md
text_representation:
extension: .md
format_name: markdown
Expand Down
Loading