jpfairbanks / SemanticModels.jl

A julia package for representing and manipulating model semantics
MIT License
77 stars 17 forks source link

Using Cassette to overdub a scientific code #11

Closed jpfairbanks closed 5 years ago

jpfairbanks commented 5 years ago

When a scientist wants to build on the research of another, they start by asking hypothetical questions. These questions often involve making modifications to existing models. The simplest are changing parameters and that is easy, but a harder problem is changing functions or structure.

For example,

what if I ran this model, but instead of measuring 2-norm, I measured 1-norm?

or

what if I ran this SIR model, but the disease was 5% more infectious?

These questions can be hard to answer without modifying the source code for the model because the author of the model did not anticipate these questions. Because the questions represent novel ideas, the relevant components are not exposed as parameters of the model.

The Open Science approach to this, which requires sharing source code, is to have the new scientist modify that code in order to support the new features. But, that requires the second scientist to understand the (often poorly written) source code of the first scientist well enough to enhance it.

We want to support these modifications of executed behavior without requiring users to modify the original source. I think this can be done with Cassette and implementing Contexts that offer a simple API to changing code behaviors.

It might be the case that in order to specify the new behavior that you want, then you must have the same level of understanding of the original code that the old fashioned, fork and modify approach requires. Hopefully we can find some examples where this approach is better.

jpfairbanks commented 5 years ago

This issue is addressed by PR #6