Skip to content

Latest commit

 

History

History
344 lines (262 loc) · 15.9 KB

index.md

File metadata and controls

344 lines (262 loc) · 15.9 KB
layout root venue address country language latlng humandate humantime startdate enddate instructor helper contact etherpad eventbrite
workshop
.
ITM 2016 Software Carpentry Tutorials: Python, Git, and R
Innovations in Travel Modeling 2015, Denver, CO
us
en
39.74,-104.99
May, 2016
TBD
2015-12-15
2015-12-16
Billy Charlton
Josie Kressner
Brice Nichols

{% if page.eventbrite %}

<iframe src="https://www.eventbrite.com/tickets-external?eid={{page.eventbrite}}&ref=etckt" frameborder="0" width="100%" height="248px" scrolling="auto"> </iframe> {% endif %}

General Information

Hi there! Scripting Carpentry is a set of introductory workshops that can help get you up to speed on tools that will make your work day easier. This course is based on materials produced by Software Carpentry. 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 practitioners, researchers and data scientists in any technical field. You don't need to have any previous knowledge of the tools that will be presented at the workshop.
Where: {{page.address}}.
Get directions with OpenStreetMap or Google Maps
Requirements: All participants will need to set up a few specific software packages on their computer (listed below).
  • If you are PSRC staff, set up the software on your primary work desktop/laptop in advance of the workshop day.
  • If you are not currently working at PSRC, you must bring your own laptop, set up with the software below.
  • All participants are also required to abide by the Software Carpentry Code of Conduct.

Email {% if page.contact %} {{page.contact}} {% else %} {{site.contact}} {% endif %} for more information.


Syllabus

Git Version Control

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

Programming in Python

  • Using libraries
  • Working with arrays
  • Reading and plotting data
  • Creating and using functions
  • Loops and conditionals
  • Defensive programming
  • Using Python from the command line
  • Reference...

Programming in R

  • Working with vectors and data frames
  • Reading and plotting data
  • Creating and using functions
  • Loops and conditionals
  • Using R from the command line
  • Reference...

{% if page.etherpad %}

Etherpad

We will use Etherpad for chatting, taking notes, and sharing URLs and bits of code.

Etherpad: {{page.etherpad}}.

{% endif %}


Setup

To participate in a Software Carpentry workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

Be sure to set up all five software items below on your primary desktop computer ahead of time -- before the day of the course.

At the workshop, you may be using a borrowed laptop to remote control your primary work computer: that way, all the software setup can happen ahead of time. Added bonus: all the software will be at your fingertips when you return to your desk afterwards, too.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.


Windows Instructions

A. Git and the Unix 'Bash' Shell

You need the latest version of 64-bit Git. Even if you already have Git installed on your PC, replace it with this new version.

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. You will need a supported web browser (current versions of Chrome, Firefox or Safari, or Internet Explorer version 9 or above).

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

On Windows, the easiest way to get Bash is to use the copy that is included in the Git for Windows installer.

  1. Download the Git for Windows Installer.
  2. Run the installer and follow the steps below:
    1. Click on "Next".
    2. Click on "Next".
    3. Click on "Next".
    4. Click on "Next".
    5. Click on "Next".
    6. Select "Use Git from the Windows Command Prompt" and click on "Next". If you forget to do this, programs that you need for the workshop will not work properly. If this happens, rerun the installer and select the appropriate option. Click "Next"
    7. Keep "Checkout Windows-style, commit Unix-style line endings" selected. Click "Next".
    8. Select "Use Windows' default console window" and click on "Next" and "Finish".
  3. ConsoleZ is a much nicer "terminal" program that has a legible font, resizable window, and more. You'll use ConsoleZ to launch the Bash terminal window instead of using the "Git Bash" icon.
    • Download the ConsoleZ Installer and follow the default installer prompts.
    • If Chrome or Firefox warns you that the installer file is untrusted, just go along with it. I created the installer here at PSRC and it is safe to install.

B. 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 a bad choice for beginners. 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.

nano is a basic editor and the default that instructors use in the workshop.

  • To install nano, download the Software Carpentry Windows installer and double click on the file to run it. This installer requires an active internet connection.
  • Even if you choose not to use nano, we recommend you run the Software Carpentry installer because it also sets sane defaults for some other tools such as SQLite and Make.
  • Others editors that you may want to use are Notepad++ or Sublime Text. Be aware that you must add the editor's installation directory to your system path. Please ask your instructor to help you do this.

C. Python

Python is a very 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 Anaconda, an all-in-one installer.

Regardless of how you choose to install it, please make sure you install Python version 2.7. We are not ready to move to Python 3 just yet.

We will teach Python using the IPython notebook, a programming environment that runs in a web browser. For this to work, you will need an up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported. Some older browsers, including Internet Explorer version 9 and below, are not.

To install Anaconda Python:

  • Open the Continuum Ananaconda download page with your web browser.
  • Download the Python 2.7 installer for Windows.
  • Install Python 2.7 using all of the defaults for installation except make sure to check Make Anaconda the default Python.

D. SQLite

FOR DISCUSSION - SQLite is easiest way to fiddle with SQL on a desktop. But we could also set up access to our "real" MySQL databases right?

SQL is a specialized programming language used with databases. Here at PSRC, we have existing enterprise databases in MS-SQL and MySQL, but those are a bit complex to set up. For this course, we use a simple database manager called SQLite. The SQL language is essentially identical, so the skills will all transfer -- and having a simple desktop version of SQL has its own benefits.

  • The Software Carpentry Windows Installer installs SQLite for Windows. If you used the installer already to install the nano text editor, you don't need to run it again. Otherwise, run it now.

E. R-Project (Statistics Software)

R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. To interact with R, we use RStudio.

Windows

Install R by downloading and running this .exe file from CRAN.

Then install the RStudio IDE.

Mac OS X

Install R by downloading and running this .pkg file from CRAN.
Also, please install the RStudio IDE.

Linux

You can download the binary files for your distribution from CRAN. Or you can use your package manager (e.g. for Debian/Ubuntu run sudo apt-get install r-base and for Fedora run sudo yum install R).
Also, please install the RStudio IDE.

E. Check your setup

To check you have the correct version of Python:

  • Download swc-installation-test-1.py
  • Open up a Bash shell - start "Git Bash" on Windows, or "Terminal" on Mac
  • Change into the directory where you put the script by typing in the bash window:
    • cd ~/Downloads
  • Run the script:
    • python swc-installation-test-1.py

To check you have set up the other software requirements correctly:

  • Download swc-installation-test-2.py
  • Open up a Bash shell. Change into the directory where you put the script by typing in the bash window:
    • cd ~/Downloads
  • Run the script:
    • python swc-installation-test-2.py

If anything is missing, the script output will specify what needs to be corrected.


Mac OS X

  • Bash: 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.
  • Git:
    • For OS X 10.9 and higher, install Git for Mac by downloading and running the most recent "mavericks" installer from this list. 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.8), use the most recent available installer labelled "snow-leopard" available here.
  • Python: We recommend the Continuum Ananconda Python all-in-one python installer, which installs a basic Python system as well as the scientific computing modules required for this course.
    • Open http://continuum.io/downloads with your web browser.
    • Download the Python 2.7 installer for OS X. We are not using Python 3 yet.
    • Install Python 2.7 using all of the defaults for installation.
  • SQLite. SQLite comes pre-installed on Mac OS X.

Linux

Use your system's package manager to install python, sqlite, git, and nano.