Issue 158 – August 5, 2023

Run receipts in ParaView

Hey there 👋

It’s Robin from CFD Engine & it’s holiday time, so this is a short one.

Back in April I wrote about auto-generating summary cards at the end of each run & posting them to Slack/Teams/WhatsApp etc.

Since then I’ve tweaked this idea into a “run receipt” 👇 made in ParaView, rendered on the cluster & ready to be posted in the chat.

A run-summary receipt, auto-generated on the cluster at the end of each simulation using ParaView

Interested? Read on for more context & a link to a rough-&-ready Python script that you can use as a starting point for your own version.

Background

This idea first came about when I got fed up of posting Excel screenshots into Slack & Teams, to provide a summary of the latests results for clients.

I set about putting together an easy-to-read image that would act as a notification that new results are available & provide the headlines as a summary.

The previous version involved search-&-replacing text in an SVG, rendering it as a PNG & it looked like this…

A run-summary card, auto-generated on the cluster at the end of each simulation

In hindsight, it was a bit too much faff, from creating the SVG, to installing software to render it to PNG.

Too many steps, especially when I realised that you can get much the same effect with ParaView.

Easier to script (using their Python API), easy to generate (using pvbatch) & nothing new to install (you probably have ParaView installed everywhere already).

Enter the receipt

There’s nothing to explain really – the new version is just a bunch of text sources, made to look a little bit like a till receipt.

You can find it as a Python script here & you can generate the image using…

pvbatch runReceipt.py

Everything is hard coded (it’s really just a sketch of how it could work) but it could easily be extended to read its variables from a text file or perhaps grab them from environment variables, it’s up to you.

I’d recommend keeping the monospaced font though (if you like getting things to line up). The version in the image at the top uses a custom font, but the Courier font that ships with ParaView looks pretty nice too 🤓

Over to you

I said it was a short one…version two of the run summary card, this time it looks like a receipt, it’s made in ParaView & it’s ready for posting to Slack/Teams/WhatsApp as a record/notification of your latest run.

I hadn’t thought of using ParaView for this kind of thing, but it works really well.

I made this for me, but let me know if it’s useful for you (especially if you make your own version).

Until next week, stay safe,

Signed Robin K