Frontends

November 13, 2021

This thing isn’t going to be of much general use if people can’t interact with it.

One big advantage is that SB has a nice modular structure. Running accross a single houseold is one simple function call


function do_one_calc( 
    hh :: Household{T}, 
    sys :: TaxBenefitSystem{T},
    settings :: Settings = Settings() ) :: HouseholdResult{T} where T

(From SingleHouseholdCalculations.jl)

likewise running the whole model across an entire dataset

function do_one_run(
        settings :: Settings,
        params   :: Vector{TaxBenefitSystem{T}} ) :: NamedTuple where T # fixme simpler way of declaring this?

(From Runner.jl)

It’s easy to embed these calls in something ambitious. This could be a web application (as here), but could also be some fancier simulation, for example of incentives to work or forward projections of health and social care or child poverty. Sounds obvious until you see how the rest of the world gets the structure of these models horribly wrong.

So, for frontends: one thing I’m not going to do is build a frontend with every possible parameter. I’ve done a fair few and I’ve come to think they’re a waste of time: if you really want to mess with the 3rd housing benefit non-dependent deduction or whatever, you want something more precise and reproducable than a thrown-together web interface.

So, small, easy to use things for learning and experimentation, and some riff on old-school command-line running for more complex cases.

The ones I’m working with are:

Dash

Dash is a rapid web development framework. The first model output is built with dash and I’m really quite chuffed with it. Nice things:

Not so nice:

Pluto

Pluto is an interactive web-based tool. I’ve been blown away with the use of this in the Introduction to Computational Thinking online course. Initial experiments with this (an inevitable SIR epidemic simulation) have been very encouraging.

Pros and cons:

  1. it looks absolutely lovely;
  2. its ‘reactive’ nature, where any change in a cell is automatically propogated to other cells, is both a strength and a weakness. I worry what will happen with a relatively slow running simulation. There have been times on the MIT course when the Pluto pages seem to have locked up;
  3. In the most recent pluto updates the authors have introduced a packaging feature that downloads all required packages at each startup. I can see this being a problem when demoing, and it’s certainly annoying when developing. Perhaps there’s a way of turning it off?

Dr Watson

Dr Watson is:

a Julia package created to help people increase the consistency of their scientific projects, navigate them and share them faster and easier, manage scripts, existing simulations as well as project source code

For full blown modelling projects, this is what I intend to develop in, in conjunction with either Pluto or Julia Weave for visualisation. Plus, I’ve contributed one tiny bugfix to this, so I feel proprietal. I haven’t yet used it in anger though, but it feels right.

Category: Blog Tags: Programming
Frontends - November 13, 2021 - Graham Stark