it rained a lot recently

14:55 21/06/2024 598 words
20:53 22/06/2024 (modified)
contents

it’s rained a lot recently and now you don’t have to have been outside to know that.

of the many[1] little coding projects i’ve done, none are readily accessible to anyone else[2]. not because i have deliberately hidden then away[3]. but because i haven’t found a platform for sharing them.

i briefly danced with voila to nicely render a jupyter notebook that was running on microsoft’s planetary computer[4]. and i’ve tried to use binder. with minimal success.

more recently i looked into anaconda cloud, pyscript, and pythonanywhere. all show promise, but none of them quite offered what i was after, i.e. something really simple[5]. something that means i can avoid reading impenetrable documentation.

streamlit

enter streamlit, which seems to be very accessible. and so, at last, i was able to make a little app.

graph of precipitation anomalies over eastern scotland from  1990-2022. quite wiggly, but generally statys within ±2 standard deviations. recently peaked over 4.
Fig 1: screenshot from the app

it doesn’t do much, other than show that yes, the weather really has been anomalously pants recently. and it puts a number on just how pants it has been.

using 1981-2010 as a baseline period, the total rainfall over east scotland in the 180 days to 2nd april 2024 was just over five standard deviations above average. or, in plain english, i put on still-wet shoes every day for six months.

plotting

plotting was accomplished with the new-to-me vega-altair library, because the streamlit docs seem to encourage it, and it allows for a little bit of interactivity. its syntax is a big step away from matplotlib, which i have become very comfortable with. but, learning a new plotting library feels easier than learning web-frameworks. and besides, vega-altair has some nifty capabilities[6], like the histogram scatter plot and the various data transformations that can be done on-the-fly, so i will waste spend a bit more time playing with it.

embed

it’d be nice to be able to host the little widgets i make here. but, i can’t, for two (i think) reasons:

this is okay. especially because it means i won’t spend an inordinate amount of timing learning how to do a thing that i (presently) don’t need to know7.

now what…

many more little widgets. for things like my sun calendar; the local elevation colourmap; and a few other ideas rattling around in the back of my head.

footnotes


  1. alright, few ↩︎

  2. barring the brave few[7] willing to poke their nose into my github repositories ↩︎

  3. although, that is a bit true ↩︎

  4. which is being shutdown ↩︎

  5. simple for me ↩︎

  6. i’m sure that if you can do a thing in vega-altair you can do it in matplotlib. and vice versa. although, if i did know how to do a thing – that’d make my cv less like the weather has been recently ↩︎

  7. alright, none. ↩︎


#python #dataviz #weather