Reduce, Reuse, Recycle

Overview

This week we will look at how frequently-used code can be packaged up in functions and libraries. This is the point at which we begin to engage with code in a more abstract way because we are increasingly interested in reusability and flexibility.

Learning Objectives
  1. To develop an understanding of code re-use through functions.
  2. To develop an appreciation of the utility of packages and namespaces.

This week we also start to move beyond Code Camp, so although you should recognise many of the parts that we discuss, you’ll see that we begin to put them together in a new way. The next two weeks are a critical transition between content that you might have seen before in Code Camp (see Practical) or other introductory materials, and the ‘data science’ approach.

Preparatory Lectures

Come to class prepared to present/discuss:

Session Video Presentation
Functions Video Slides
Decorators Video Slides
Packages Video Slides

Other Preparation

Readings

Come to class prepared to discuss the following readings:

Citation Article ChatGPT Summary
Massey (1996) URL Summary
D’Ignazio and Klein (2020) Ch.3 URL Summary
Smith (2010) URL N/A

Study Guide

  1. Reading Massey’s seminal “Politicising space and place”:
  • What are the two conflicting geographical imaginations at play in contemporary society? Explain their contradictory nature.
  • In the case study of ‘high-tech’ scientists, how do the ‘power geometries’ of work and home reflect gendered power relations?
  1. Looking at D’Ignazio and Klein’s “On Rational, Scientific, Objective Viewpoints from Mythical, Imaginary, Impossible Standpoints”:
  • What does the “view from nowhere” concept mean in the context of data visualization, and why do they find it problematic?
  • How do they propose to address the limitations of data visualization? Describe their concept of “data visceralization” and its significance.
  • Why do they suggest that you shouldn’t never use the ‘god trick’?
  1. With reference to Smith’s “Valuing housing and green spaces”:
  • How is the hedonic modelling method used to understand the relationship between green spaces and house prices?
  • Does this approach respect some of the positional aspects developed in the other readings, or is just another ‘view from nowhere’?
Connections

These are two of the more challenging readings this term, but they are critical to understanding what we are trying to teach you: it’s not just about learning to code, it’s about learning how to deploy code/quantitative methods to support your argument, while maintaining a keen eye on how bias – in both the technical and the ethical senses – can creep into your thinking and, consequently, your results!

Practical

This week’s practical will be looking at how functions (and variables) can be collected into resuable packages that we can either make ourselves or draw on a worldwide bank of experts – I know who I’d rather depend on when the opportunity arises! However, if you have not yet completed Code Camp (or were not aware of it!), then you will benefit enormously from tackling the following sessions:

Connections

The practical focusses on:

  • Seeing how functions and decorators can help us to reuse code efficiently.
  • Beginning to make use of packages to access/interact with data.

To access the practical:

  1. Preview
  2. Download

References

D’Ignazio, Catherine, and Lauren F. Klein. 2020. “Data Feminism.” In. MIT Press. https://data-feminism.mitpress.mit.edu/.
Massey, Doreen. 1996. “Politicising Space and Place.” Scottish Geographical Magazine 112 (2). Routledge:117–23. https://doi.org/10.1080/14702549608554458.
Smith, D. 2010. Valuing housing and green spaces: Understanding local amenities, the built environment and house prices in London.” GLA Economics. https://www.centreforlondon.org/wp-content/uploads/2016/08/CFLJ4292-London-Inequality-04_16_WEB_V4.pdf.