cf-units get (La)TeX unit repr... and a UDUNITS-2 parser to boot

2019

February

15

I recently worked on a feature to allow cf-units to produce a TeX representation of a unit so that it can be quickly copy-and-pasted into a LaTeX document, or simply visualised nicely with matplotlib's LaTeX writer. It turns out that "doing it right" was quite involved, and has ultimately led …

Read on...

Investigating containment testing on LFRic's cubedsphere

2018

May

29

UGRID and LFRic: Polygon mesh intersections¶I'm aiming to investigate whether it is possible to use the existing python tools to compute intersections of cells definied on the Met Office's LFRic cubesphere. A (possibly out of date but still enlightening) presentation about the LFRic datamodel can also be found here …

Read on...

Analysing walks on the South West Coast Path

2018

May

26

I'm fortunate to live near to one of the best continuous coastal walking/hiking routes in the world. The UK's South West Coast Path is a scenic, cultural and culinary delight spanning 630 miles from Minehead to Poole. It is steeped with history, and apparently was originally created by the …

Read on...

Recursive search and replace

2018

May

21

I had a need to recursively search and replace for a particular string within a git repository. A combination of find and sed is all that is needed, but one must be careful to avoid modifying the contents of the ".git" directory (I accidentally did this, and effectively destroyed my …

Read on...

Creating an application for a website on OSX

2017

September

20

I wanted to get a desktop application for a website that doesn't provide one, and had success with https://github.com/eladnava/applicationize. This worked a treat for my local Home Assistant instance, so now I don't need to open a tab in my web-browser.

Read on...

Creating a continuous integration service to check CLAs on GitHub

2017

August

13

Contributor license agreements are a thing. As much as I dislike the bureaucracy of them, they do provide some additional cover to the owners of an open source project, and some companies insist on having them. I find myself in such a situation in the SciTools organisation, for which I …

Read on...

Playing with Randall Munroe's XKCD handwriting

2017

March

16

The XKCD font (as used by matplotlib et al.) recently got an update to include lower-case characters. For some time now I have been aware of a handwriting sample produced by Randall Munroe (XKCD's creator) that I was interested in exploring. The ultimate aim is to automatically produce a font-file …

Read on...

Mounting a FUSE filesystem in Heroku

2017

February

6

This evening I'm going to take a different approach to how I would normally blog. Rather than reporting the results of a technical investigation or highlighting a new/shiny package, I wanted to paint a realistic picture of the technical exploration process. As it happens, this particular investigation consumed a …

Read on...

Building a matrix of conda distributions with conda-build-all

2015

December

9
Thumbnail for conda_build_all

Introducing conda-build-all, a tool which extends conda-build to provide powerful build matrix capabilities. Repositories such as conda-forge/stages-recipes, SciTools/conda-recipes-scitools and ioos/conda-recipes exist to provide a set of conda recipes, and ultimately, channels from which users can access the product of conda-build-ing those recipes. The build phase of …

Read on...

Vim search and replace across many files

2015

December

3

A powerful combination of commands for search and replace across multiple files with Vim. http://vim.wikia.com/wiki/Opening_multiple_files_from_a_single_command-line http://vim.wikia.com/wiki/Search_and_replace_in_multiple_buffers :arg **/*.cpp :argdo %s/pattern/replace/ge | update

Read on...

Running scripts in temporary conda environments with conda execute

2015

October

3

Conda is awesome - it is a simple package manager which allows me to create isolated software environments much like virtualenv. Unlike virtualenv though it can handle any package type, not just python ones. The more I use it, the more I want to make use of conda's dependency tracking for …

Read on...

Interactive matplotlib figures in the IPython notebook - they've landed!

2014

June

3
Thumbnail for nbagg_backend

After what feels like years chipping away at the problem, not least from some awesome developers including the whole of the IPython development team, Michael Droetboom and Jason Grout, I recently closed the development loop and added a new matplotlib backend providing interactive figures in the IPython notebook environment. The …

Read on...

Working with colours in matplotlib

2013

June

3
Thumbnail for working_with_colors_in_matplotlib

When dealing with colours in scientific visualisations some people like to have a colourmap which can be indexed into to pick specific colours. Whilst this isn't necessarily the best way of handling colours in matplotlib, it certainly adds a degree of familiarity to users who have come over from other …

Read on...