ReSC : SCENARIO-DTP Training Courses : UoR, Dept Of Meteorology

SCENARIO-DTP Training Courses

Software Development for Environmental Scientists

Level 1 Instructions

Course contents (0930 - 1700 daily)

  • Day1: Commands & Shell; IDEs; Control Flow; Version Control
  • Day2: Simple Data Types; Requirements; NetCDF; Diagrams
  • Day3: Design; Modularity; Complex Data Types; Debugging
  • Day4: Standards & Reviews; Testing; Error Handling; Q&A session

Pre-course quiz

There's a short quiz for you to try which will give us an idea of what you already know and where the gaps are: please send your answers to me.

Setting up your laptop for the course: You have a choice of either installing the tools directly or using a VM. If you are likely to continue to use Python to write software after the course, then you may wish to consider direct installation. If you choose to use the VM, please make sure that you have sufficient space and that it's working properly before you join the course: it may require some tweaking depending upon your hardware.

Option 1: Direct installation

You will need the following:

PyCharm
Python 2.7
Python modules: nose, configparser, netCDF4, matplotlib, & numpy
git (may already by present: check by typing 'git' at the command line), should also have GitGUI
cygwin for the unix command exercises if using Windows OS
ncview & ncdump : these should come as part of the cygwin distribution but you must ensure you select netcdf support installation from cygwin's setup. Otherwise look up the best netcdf viewer for your platform: possibly NASA Panoply
wget: you need to make sure you select it in the cygwin setup (see link)
optionally: kdiff3

Installing additional Python modules/libraries once you have PyCharm is relatively straightforward: start PyCharm (dismiss creating a project), select File -> Default Settings, then Project Interpreter. In the dialogue, use the green '+' (top right) to find the modules and install them. If you encounter errors then it may be that you don't have 'pip'. Please check online resources for assistance in installing the additional Python libraries directly.

Option 2: Virtual Machine (VM)

Please ensure you have downloaded and installed the virtual machine *before* the start of the course. Also make sure that its network connection is working.

  1. Download and install Virtual Box : the VM manager may be downloaded from https://www.virtualbox.org/wiki/Downloads : select the version appropriate to your host OS.
  2. Copy the VM to your machine : the VM itself is here : save the 2.5Gb file to your machine. It is a 32-bit version and you will need at least 4Gb of RAM of which the VM will take 2Gb.
  3. Launch Virtual Box, then choose File->Import Appliance and point to the VM copy you've just made, leave all the default settings. This will take a while to load.
  4. Click on the green arrow 'Start'.
  5. The virtual machine will launch in full-screen mode, use "right_ctrl+F" to make it a window.
  6. If the screen locks, the password is 'cadet'.
  7. Generally you will want to 'save the machine state' when you exit the VM.

Items included in the VM are:

PyCharm
Python 2.7 with nose, configparser, netCDF4, matplotlib, numpy & scipy modules
GitGUI

Data

We will be making use of various data files during the exercises, if you are able to download them in advance, that would speed things up. Download the list of data files here using 'SaveLinkAs' from the right-click menu, this will usually save the file to your 'Downloads' folder. From the command line, navigate to the folder where you have saved the file and run:

wget -i data_file_list.txt

This will get all the files in the list and save them to the same folder. Note where this is so that you can move the files to a more suitable location during the exercises. If you are doing this outside the VM, you will need to use cygwin to execute the 'wget' command.

Project work

Our final day will consist primarily of a project to put all the learning points into practice. We will provide data and a typical problem scenario. If you wish to bring your own data and/or amend the scenario to better reflect your particular situation, then we will support you as much as possible.

Reading material

If you're not familiar with Python then we'd suggest doing some background reading and the following may be of use:

A Byte of Python, available online here and in section 1.6 there are links to download it.

TutorialsPoint is a good starting point too.

If you'd like to use an alternative language to do the course exercises, you are at liberty to do so but we may not be able to support you fully and some features may not be available to you.