Tutorial Description
Title:
"Introduction to Reusable Python"
Abstract:
Learn how to organize python code into reusable units such as containers, functions, modules, and packages; and how to reuse those units, locally and globally, by installing and distributing them using pip and conda.
Description
This tutorial introduces the basics of organizing and sharing your python code for reuse through a series of student exercises that build on each other. The content is intentionally limited to the core aspects of python scope, modules, packaging, pip, and conda needed to get you started writing reusable code and contributing to the shared ecosystem of reusable scientific python software.
We start with a python terminal session, save the history to a script, and organize that script using containers and functions. Then we create a python module that we import or run as a script, explore some aspects of scope, create a python package, and write a setup.py to install the package. Next, we introduce conda for managing environments and packages. We go on to write a conda recipe for our python package, and use conda-build to create a conda package from our recipe. Finally we install our conda package locally and upload it to conda-forge.
Intended Audience
Intermediate
If you are a beginner in python, but very comfortable with use of the terminal (Linux or Mac) or command prompt (Windows), including setting and changing environment variables, you are encouraged to attend.
This tutorial really is intended for scientists and analysts, not for experienced python developers or dev-ops folks. If you have already have had PRs merged into master on projects like numpy, pandas, or conda, you probably don't need this tutorial!
Prerequisite Skills:
Summary List
Prerequisite Skills:
- Basic computer use
- Basic text editor use
- Intermediate terminal/command-prompt use
- Basic python use
Detailed List
- Basic computer use:
- find and launch applications
- turn on and off WIFI
- use a web browser to download files
- access to a user account
- ability to write files to user home paths
- ability to run installer files as the same user
- test by downloading and installing Chrome to your laptop
- Basic text editor use:
- locate and open a text editor, e.g. sublime text
- use a text edit to create, modify, and save files to known locations
- Intermediate terminal use:
- any: Linux, Mac, or Windows
- open a terminal or command-prompt
- use a terminal to list current working directory
- use a terminal to list contents of a directory
- use a terminal to change current directory
- use a terminal to execute/run a script
- use a terminal to change file permissions
- setting and changing environment variables
- Basic python use:
- assign a value to a variable name
- call a function, passing input parameters, storing return values
- define a simple function using def and return
- create a dictionary, and inspect its contents
Instructor Biography
Jason Vestuto is a scientist and python developer working with the Space and Geophysics Laboratory at the University of Texas in Austin. He uses the scientific python stack daily to develop software tools and perform analysis of GNSS data. He holds degrees in both physics and science education. He has taught science, math, and coding at high schools, colleges, universities, and as a former Python Trainer with Continuum Analytics, has trained scientific Python and conda at large private companies and national science labs.