Demo of Price Reporting

This plot demonstrates a way to visualise the time at which prices are gathered (here based on synthetic data). Every stock each day has a single circle, made of 4 quadrants, one for each provider. These are coloured according to whether prices were early (green) or late(red). Missing data is shown as gray. It is designed to allow someone to get an overall feel for the quality of data gathered, and identify any trends in the data. The plot is interactive: You can scroll, zoom and mouseover different points to get information on a single day.

Read More

Visualising pressure swing adsorption using Bokeh

Recently I’ve been creating interactive tools for exploring data we create on the simulation of pressure swing adsorption columns to remove CO2. These simulations were performed using CySim, which is a adsorption cycle simulator created at The University of Edinburgh.

Read More

Using mock to write unit tests for random functions

Writing unit tests is important, but this becomes difficult for functions which use random elements. One possible approach would be to use known seeds for the random number generation, allowing you to have a deterministic sequence of random numbers, so that regression tests could be written. Recently I’ve been writing unit tests for a function which uses a sequence of random.random() calls to determine what is returned (this is for mutating individuals within a genetic algorithm). Because of this, I want full control over what is returned by random.random() so that I can test all possible permutations of what happens inside the function.

Read More