Find us on GitHub

University of British Columbia - Faculty of Science

Mar 5-6, 2015

9:00 am - 4:30 pm

Instructors: Jenny Bryan, Karina Ramos Musalem, Nancy Soontiens, Daisie Huang, Tiffany Timbers

Helpers: Gloria Li, Julia Gustavsen

General Information

NOTE: This workshop is fully booked. If you registered but things have changed for you and you will not be able to attend both days, please let us know immediately so your spot can be given to one of your peers on the waiting list, by sending an e-mail to Kate Blackburn (blackburn at science.ubc.ca).

Software Carpentry's mission is to help scientists and engineers get more research done in less time and with less pain by teaching them basic lab skills for scientific computing. This hands-on workshop will cover basic concepts and tools, including program design, version control, data management, and task automation. Participants will be encouraged to help one another and to apply what they have learned to their own research problems.

Who: The course is aimed at female graduate students and postdoctoral fellows in the Faculty of Science.

Where: Multipurpose Room 101, Michael Smith Labs. Get directions with OpenStreetMap or Google Maps.

Requirements: Participants must bring a laptop with a few specific software packages installed (listed below). They are also required to abide by Software Carpentry's Code of Conduct.

Contact:

  • Please mail Nancy Soontiens (nsoontie@eos.ubc.ca) for more information regarding workshop content and technical questions.
  • Please contact Kate Blackburn (blackburn at science.ubc.ca) for questions on your registration status, the location and building/room access, and in case you cannot attend.


Setup Instructions

It is important to have your computer set up with the appropriate software before the workshop begins. Please work through each of the sections below and follow the instructions relevant to your operating system. If you need help with setup, instructors will be available at the following times and locations:

  • Thursday February 26 - 1:30pm-3:30pm in ESB 4182
  • Monday March 2 - 10:00am-12:00pm in ESB 3064

Download Files

During the workshop we will be interacting with a few data files. Please download WiSE-swc.zip and extract it on your desktop.

Please also ensure that your computer will connect to one of the ubc wireless networks.

Text Editor

When you're writing code, it's nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words. The default text editor on Mac OS X and Linux is usually set to Vim, which is not famous for being intuitive. if you accidentally find yourself stuck in it, try typing the escape key, followed by ':q!' (colon, lower-case 'q', exclamation mark), then hitting Return to return to the shell.

Windows

nano is the editor installed by the Software Carpentry Installer, it is a basic editor integrated into the lesson material.

Notepad++ is a popular free code editor for Windows. Be aware that you must add its installation directory to your system path in order to launch it from the command line (or have other tools like Git launch it for you). Please ask your instructor to help you do this.

Mac OS X

We recommend Text Wrangler or Sublime Text. In a pinch, you can use nano, which should be pre-installed.

Linux

Kate is one option for Linux users. In a pinch, you can use nano, which should be pre-installed.

The Bash Shell

Bash is a commonly-used shell that gives you the power to do simple tasks more quickly.

Windows

Install Git for Windows by download and running the installer. This will provide you with both Git and Bash in the Git Bash program.

Software Carpentry Installer

This installer requires an active internet connection.

After installing Python and Git Bash:

  • Download the installer.
  • If the file opens directly in the browser select File→Save Page As to download it to your computer.
  • Double click on the file to run it.

Information about the SWC Windows Installer, including the source code, can be found at https://github.com/swcarpentry/windows-installer.

Mac OS X

The default shell in all versions of Mac OS X is bash, so no need to install anything. You access bash from the Terminal (found in /Applications/Utilities). You may want to keep Terminal in your dock for this workshop.

Linux

The default shell is usually bash, but if your machine is set up differently you can run it by opening a terminal and typing bash. There is no need to install anything.

Git

Git is a version control system that lets you track who made changes to what when and has options for easily updating a shared or public version of your code on github.com. Please visit this webpage and create a GitHub user account. You should consider requesting an academic discount.

Windows

Git should be installed on your computer as part of your Bash install (described above).

The GitHub GUI app is useful for many common Git operations.

Mac OS X

For OS X 10.8 and higher, install Git for Mac by downloading and running the installer. After installing Git, there will not be anything in your /Applications folder, as Git is a command line program. For older versions of OS X (10.5-10.7) use the most recent available installer for your OS available here. Use the Leopard installer for 10.5 and the Snow Leopard installer for 10.6-10.7.

The GitHub GUI app is useful for many common Git operations.

Problems with Git on a Mac? Visit here for more resources.

Linux

If Git is not already available on your machine you can try to install it via your distro's package manager. For Debian/Ubuntu run sudo apt-get install git and for Fedora run sudo yum install git.

Python

Python is a popular language for scientific computing, and great for general-purpose programming as well. Installing all of its scientific packages individually can be a bit difficult, so we recommend an all-in-one installer.

Windows

  • Download and install Anaconda.
  • Use all of the defaults for installation except make sure to check Make Anaconda the default Python.

Mac OS X

  • Download and install Anaconda.
  • Use all of the defaults for installation except make sure to check Make Anaconda the default Python.

Linux

We recommend the all-in-one scientific Python installer Anaconda. (Installation requires using the shell and if you aren't comfortable doing the installation yourself just download the installer and we'll help you at the boot camp.)

  1. Download the installer that matches your operating system and save it in your home folder.
  2. Open a terminal window.
  3. Type
    bash Anaconda-
    and then press tab. The name of the file you just downloaded should appear.
  4. Press enter. You will follow the text-only prompts. When there is a colon at the bottom of the screen press the down arrow to move down through the text. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).

This page has instructions on testing that you have the right software installed.

Schedule

The workshop will run from 9:00 am - 4:30 pm each day. Below is a rough outline of each day's activities. Be aware that this schedule is subject to change, depending on each day's progression.

Day 1

09:00 Intro to Python
10:15 Coffee break
10:30 Building programs in Python (part 1)
12:15 Lindsay Sill, Executive Director of WestGrid: Compute Canada – A Brief Introduction
12:30 Take Control of Your Career – Networking session over lunch (provided)
14:00 Version control with Git
15:00 Break
15:15 Intro to Pandas
16:30 End of session

Day 2

09:00 Building programs in Python (part 2)
10:15 Coffee break
10:45 Building programs in Python (part 2, cont'd)
12:00 Lunch (provided)
13:00 Regular expressions
14:15 Break
14:30 Collaboration with version control
15:15 Break
15:30 Collaboration with version control (cont'd)
16:30 End of workshop

Etherpad: https://etherpad.mozilla.org/2015-03-05-ubc.
We will use this Etherpad for chatting, taking notes, and sharing URLs and bits of code.


Syllabus

This is a tentative syllabus and may be revised slighty as the workshop day draws nearer.

Programming in Python

  • Using libraries
  • Working with arrays
  • Reading and plotting data
  • Creating and using functions
  • Loops and conditionals
  • Using Python from the command line
  • Data anlaysis with Pandas
  • Regular expressions
  • Reference...

Version Control with Git

  • Creating a repository
  • Recording changes to files: add, commit, ...
  • Viewing changes: status, diff, ...
  • Ignoring files
  • Working on the web: clone, pull, push, ...
  • Resolving conflicts
  • Open licenses
  • Where to host work, and why
  • Reference...