Good Practices for Research with Python

SURF Utrecht, Utrecht (NL)

Oct 1-2, 2019

9:00 am - 5:00 pm

Instructors: Johan Hidding, Faruk Diblen

Helpers: Johan Hidding, Faruk Diblen


Registration price for all participants (2 days): 125 Euros

General Information

The simplicity and programmability features of Python have turned this programming language into a very handy tool for everyday research. Therefore, this workshop has a main focus on providing an all-in-one starter package to develop you own research project from scratch using Python.

During these two days you will get an overview of the use of Python from the basics, which will be coupled with hands-on exercises to get you to started with its use. At the same time, you will learn good practices that will help you to start your Open Source Software project.

Moreover, you will get some specific insight on how to use Jupyter notebooks for research. The use of these tools will be illustrated using the example of 3D data visualization, for which you will use a remote connection to the facilities at SURFsara.

Who: The course is aimed at graduate students and other researchers, as well as anybody who would like to learn the basics for the development of open-source software and cloud-based services.

Where: SURF Utrecht. Kantoren Hoog Overborch (Hoog Catharijne), Moreelsepark 48, 3511 EP Utrecht. Room 3.5. Get directions with OpenStreetMap or Google Maps.

When: Oct 1-2, 2019. 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). You don't need to have any previous knowledge of the tools that will be presented at the workshop.

Contact: Please email carlos.teijeiro@surfsara or c.martinez@esciencecenter.nl for more information.



Contents of the course

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...

Best practices in eScience

  • Recommendations for Open source software
  • Making packages in Python ( with cookie cutter)
  • Unit testing in python using pytest
  • Continous integration with Travis CI
  • Contenerization with Docker

Schedule

Day 1

09:00 - 10:30 Introduction to Python
10:30 - 10:45 Morning break
10:45 - 12:00 Introduction to Python
12:00 - 13:00 Lunch break
13:00 - 14:30 More Python
14:30 - 14:45 Afternoon break
14:45 - 17:00 Python and Jupyter

Day 2

09:00 - 10:30 Using OSS for research
10:30 - 10:45 Morning break
10:45 - 12:00 Packaging software
12:00 - 13:00 Lunch break
13:00 - 14:30 Unit testing and continuous integration
14:30 - 14:45 Afternoon break
14:45 - 17:00 Containers

The catering for the lunch and morning/evening breaks will be provided by the organization.

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


Setup

To participate in this SURF/eScience workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

Python

Python is a popular language for research computing, and great for general-purpose programming as well. Installing all of its research 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 3.x (e.g., 3.6 is fine).

We will teach Python using the Jupyter notebook, a programming environment that runs in a web browser. 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).

  1. Open https://www.anaconda.com/download/#linux with your web browser.
  2. Download the Python 3 installer for Linux.
    (The installation requires using the shell. If you aren't comfortable doing the installation yourself stop here and request help at the workshop.)
  3. Open a terminal window.
  4. Type
    bash Anaconda3-
    and then press Tab. The name of the file you just downloaded should appear. If it does not, navigate to the folder where you downloaded the file, for example with:
    cd Downloads
    Then, try again.
  5. Press Return. You will follow the text-only prompts. To move through the text, press Spacebar. 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).
  6. Close the terminal window.