Computational Skills for Researchers

University of Arizona

Mar 22-23, 2025

9:00 am - 5:00 pm

Instructors: Salena Ashton, Michele Cosi, Megh Krishnaswamy, Xue Pan, Sarah Roberts, Sarah Stueve

Helpers: Devin Bayly, Priom Mahmud, Deepsana Shahi, Kamaljeet Singh, Rajitha Tiruthani, Yuwei Wang

Apply for the workshop at https://bit.ly/4kaYFDG.

General Information

The Carpentries project comprises the Software Carpentry, Data Carpentry, and Library Carpentry communities of Instructors, Trainers, Maintainers, helpers, and supporters who share a mission to teach foundational computational and data science skills to researchers.

Want to learn more and stay engaged with The Carpentries? Carpentries Clippings is The Carpentries' biweekly newsletter, where we share community news, community job postings, and more. Sign up to receive future editions and read our full archive: https://carpentries.org/newsletter/

Software Carpentry aims to help researchers get their work done in less time and with less pain by teaching them basic research computing skills. 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.

For more information on what we teach and why, please see our paper "Best Practices for Scientific Computing".

Who: The course is aimed at novices - participants don't need to have any previous knowledge of the tools that will be presented at the workshop. The workshop targets researchers, including graduate students, postdocs, research staff, PIs, etc. Undergraduate students can be admitted by special request.

Where: Tucson, AZ. The specific workshop location and directions will be provided to accepted and confirmed workshop participants.

When: Mar 22-23, 2025; 9:00 am - 5:00 pm Add to your Google Calendar.

Requirements: Participants must bring a laptop with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.) that they have administrative privileges on. They should have a few specific software packages installed (listed below).

Accessibility: We are committed to making this workshop accessible to everybody. The workshop organizers have checked that:

We are dedicated to providing a positive and accessible learning environment for all. Please notify the instructors in advance of the workshop if you require any accommodations or if there is anything we can do to make this workshop more accessible to you.

Glosario is a multilingual glossary for computing and data science terms. The glossary helps learners attend workshops and use our lessons to make sense of computational and programming jargon written in English by offering it in their native language. Translating data science terms also provides a teaching tool for Carpentries Instructors to reduce barriers for their learners.

Contact: Please email cosi@arizona.edu for more information.

Roles: To learn more about the roles at the workshop (who will be doing what), refer to our Workshop FAQ.


Code of Conduct

Everyone who participates in Carpentries activities is required to conform to the Code of Conduct. This document also outlines how to report an incident if needed.


Collaborative Notes

We will use this collaborative document for chatting, taking notes, and sharing URLs and bits of code.


Surveys

Please be sure to complete these surveys before and after the workshop.

Pre-workshop Survey

Post-workshop Survey


Schedule

Saturday, March 22, 2025

Before Pre-workshop survey
09:00 Navigate The Unix Shell
10:30 Morning break
10:45 Automate Tasks With The Unix Shell
12:00 Lunch break
13:00 Version Control With Git & GitHub
14:30 Afternoon break
14:45 Version Control with Git & GitHub (Continued)
16:30 Wrap-up
17:00 END

Sunday, March 23, 2025

09:00 Understand Programming With Python
10:30 Morning break
10:45 Build Programs With Python
12:00 Lunch break
13:00 Visualize Data
14:30 Afternoon break
14:45 Bringing it Together
16:30 Wrap-up
16:50 Post-workshop Survey
17:00 END

Syllabus & Learning Objectives

Take control with the Bash Shell (Command Line/Shell/Unix)

  • Work in vs. work below the GUI
  • Navigate the shell
  • Find, create, copy, move and delete folders and files
  • Shell over GUI: Command history and tab completion
  • Connect commands into workflows: pipes and redirection
  • Automate repetitive tasks: loops
  • Save and run workflows in scripts
Resources:

Collaborate with git/GitHub

  • Access a repository and pull files
  • Create a repository
  • Record changes: add, commit, ...
  • View changes: status, diff, ...
  • Ignore files
  • Work on the web: clone, pull, push, ...
  • Resolve conflicts
Resources:

Analyse scientific data with Python

  • Use libraries
  • Work with arrays
  • Read and plot data
  • Create and use functions
  • Use loops and conditionals
  • Use Python from the command line
  • Defensive programming
Resources:

Syllabus subject to change if necessary.


Setup

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

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.

The Bash Shell

Bash is a commonly-used command line program (shell) that gives you the power to work on the command line and master repetitive tasks quickly.

    Note: You need to have administrative rights on your laptop for this installation to work!
  1. On your laptop, open the Windows PowerShell.
  2. Type "wsl --install" (without quotes), this will download the WSL installer.
  3. Once the download ends, reboot your machine. (Depending on the processor and internet speed, the download should be done in less than 1 minute.)
  4. After restarting, search your PC for "WSL" using the search bar, and open it.
    • If WSL just opens a window and quickly closes it again, open up PowerShell and execute "wsl --install" again.
  5. Search your PC again for WSL and pin it to your Taskbar (optional).
  6. Open WSL and finish setting up by choosing a user name/account and password.
  7. To find out what your WSL installation recognizes as "Home" on your PC, type "explorer.exe .". The GUI window that's then opening will be the "Home" location for your WSL installation.

The default shell in Mac OS X Ventura and newer versions is Zsh, but Bash is available in all versions, so no need to install anything. You access Bash from the Terminal (found in /Applications/Utilities). See the Git installation video tutorial for an example on how to open the Terminal. You may want to keep Terminal in your dock for this workshop.

To see if your default shell is Bash type echo $SHELL in Terminal and press the Return key. If the message printed does not end with '/bash' then your default is something else. You can change your current shell to Bash by typing bash and then pressing Return. To check your current shell type echo $0 and press Return.

To change your default shell to Bash type chsh -s /bin/bash and press the Return key, then reboot for the change to take effect. To change your default back to Zsh, type chsh -s /bin/zsh, press the Return key and reboot. To check available shells, type cat /etc/shells.

The default shell is usually Bash and there is usually no need to install anything.

To see if your default shell is Bash type echo $SHELL in Terminal and press the Return key. If the message printed does not end with '/bash' then your default is something else, you can change your current shell to Bash by typing bash and then pressing Return. To check your current shell type echo $0 and press Return.

To change your default shell to Bash type chsh -s /bin/bash and press the Return key, then reboot for the change to take effect. To change your default back to Zsh, type chsh -s /bin/zsh, press the Return key and reboot. To check available shells, type cat /etc/shells.

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. You will need a supported web browser.

You will need an account at github.com for the Git lesson. Basic GitHub accounts are free. Please create a GitHub account if you don't have one already.

GitHub requires two-factor authentication (2 FA), please make sure that you will remember your GitHub username and password during the workshop, and that you have access to whatever device you selected to establish 2 FA. For additonal detail read https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication.

Finally, please consider what personal information you'd like to reveal. For example, you may want to review these instructions for keeping your email address private provided at GitHub.

Please open the Terminal app, type git --version and press Enter/Return. If it's not installed already, follow the instructions to Install the "command line developer tools". Do not click "Get Xcode", because that will take too long and is not necessary for our Git lesson. After installing these tools, there won't be anything in your /Applications folder, as they and Git are command line programs. For older versions of OS X (10.5-10.8) use the most recent available installer labelled "snow-leopard" available here. (Note: this project is no longer maintained.) Because this installer is not signed by the developer, you may have to right click (control click) on the .pkg file, click Open, and click Open in the pop-up dialog. You can watch a video tutorial about this case.

Video Tutorial

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 dnf install git.

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 used in this workshop is 'nano'.

Often, the default text editor is set to Vim, especially in macOS and Linux. Vim is not famous for being intuitive. If you accidentally open 'Vim' and find yourself stuck in it, hit the Esc key, followed by :+Q+! (colon, lower-case 'q', exclamation mark), then hitting Return to return to the shell.

The default used in this workshop is 'nano', a basic editor that should be pre-installed. (It was installed along with WSL.)

The default used in this workshop is 'nano', a basic editor that should be pre-installed..

The default editor used in this workshop is 'nano', a basic editor that should be pre-installed.

Python

Python is a popular language for research computing, and great for general-purpose programming as well. During the workshop we will use an online Python and Jupyter Notebook installation provided by Google Colab (https://colab.research.google.com). There is therefre no need to install anything at this point.

For this to work you will need a reasonably 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).

Should you wish to install Python locally on your computer for purposes beyond the workshop, we recommend Anaconda, an all-in-one installer. (Windows users: please note that your WSL shell installation comes with Python as well.)