Some Bits: Nelson's log

Yuba River average temperature and flow

I love swimming in the Yuba near Grass Valley. Local wisdom is it’s not safe to swim until July 4, that’s when it’s warm and slow enough to be safe. PG&E controls the flow with a dam but seems to follow a sort of schedule. My notes are that 200 CFS is “calm” flow. I was just there at 450 CFS and it was still pretty sporty. I could have swum across but it wasn’t yet a good idea.

There’s flow data at Dreamflows and USGS. Also historical data at USGS. So I fired up Claude Code and 30 minutes and $2 later I have a serviceable graph. It’s online here.

End result: yeah, July 4 is about right.

Update

For $0.50 I added a histogram of the flow on July 4. I also added a deploy script for 10 cents. Then I spent another 20 cents making sure it was treating no data differently from zero. There’s 61 years with flow under two hundred: 20 years with flow over that.

Vibe coding notes

Another project I could have done myself but didn’t want to spend the time: Claude makes it kind of fun. This went OK at first but got in the weeds.

Claude’s first instinct was to use Python and matplotlib. Yuck. I asked it to do Javascript and it chose Chart.js. Which was fine for small data but choking on more points, so it suggested switching to uPlot. That seems to get the job done. d3.js would be nice too but is overkill for a static one-off.

I am very impressed with how Claude understands high level directives like “draw a bunch of individual thin lines for each year to show distribution”. OTOH I don’t quite trust it: I’m afraid to publish this more widely for fear something about its calculations is incorrect. I tried reviewing the code but just can’t bring myself to care enough to bother. It looks right!

Claude is great when starting de novo but gets slower and buggier with iteration. For instance it mostly converted the code from Chart.js to uPlot just fine. But one thing I wanted was to clamp the Y axis at 2000 CFS. It insisted on keeping the Chart.JS code to do that and wouldn’t update to the uPlot API until I read the docs and told it myself what it needed to do. It also made a bunch of other changes that just didn’t work. I never could get it to make the graph fill the whole width. I know some folks doing agentic coding are also building test suites and telling the agent to not commit until the tests pass, that would have been really helpful here.

I sure wish I had more confidence that this visualization is actually correct and doesn’t do something stupid like averaging missing data in as if they were zeros. That’d be the same problem with a person doing the coding but I’d trust them more.