Posts
2021
Jupyter notebooks are great for experimentation, reporting and sharing. In a project there are often times when you need to transition from this activity to production ready code. The easiest first step is to convert your notebook to a script. In order to do this you will need jupyter and nbconvert packages installed.
2020
Earlier in the year I wrote about using systemd in the context of setting up a service for temperature logging and visualisation on a Raspberry Pi. Whilst the project has been stable for a long time, I’m now releasing it publically. Here it is. Key features include:
Latin hypercube sampling aims to bring the best of both worlds: the unbiased random sampling of monte carlo simulation; and the even coverage of a grid search over the decision space. It does this by ensuring values for all variables are as uncorrelated and widely varying as possible (over the range of permitted values).
I almost didn’t write this post because the topic of file organisation is incredibly boring for most people (including me). What did drive me to write was a few horrendous projects where the end result was a soup of files where much time was wasted deciphering what file was in use and where it came from. Especially for long-running projects with multiple authors, what generally results is what my previous geologist coworkers used to call “stratigraphic filing”: a time-based layering of work, within files, across versions and across a folder structure that seemed a good idea at the time.
Let’s use a built-in example within R: location of earthquakes off the island of Fiji.
Rmarkdown was a revelation to me when I was first introduced to it in SEAMS (now Arcadis Gen). I’d used Jupyter notebooks before for Python and loved the live lab notebook feel of them. Rmarkdown for R is like this but more polished, more final, more suited to a corporate or public end user. It also has a few tricks up its sleeve.
Ever since a week before lockdown in mid-March, I’ve been holed up in my conservatory working from home. The wild swings in temperature have provided ample motivation to build a temperature probe and live dashboard to track patterns, open windows in good time or cope with the lead time that my pitiful electric heater requires.