From notebook to production, without rewriting everything
Research code and production code have different obligations. The mistake is assuming that means writing it twice.
Philippe Trocellier — Founder — TP Advisory Services
This is a published outline, not a finished article. It sets out the argument and structure of a piece currently being written. The full text will replace it once complete.
A pricing model that works in a notebook and a pricing model a business can rely on differ in about four respects: where the data comes from, what happens when it is missing, whether the result is reproducible, and whether anyone other than the author can run it.
Separate the three layers early
- The numerical core — pure functions, no I/O, testable against closed-form cases.
- The data layer — retrieval, validation and the explicit handling of gaps.
- The interface — reporting, dashboard or API, which is the only part users see.
Test against something you can verify
Analytical benchmarks, degenerate parameter cases and put-call parity catch more implementation errors than any amount of code review. A Monte Carlo engine that cannot reproduce a closed-form price is not ready to price anything else.
Industrialise only what earns it
Not every prototype deserves a deployment pipeline. The decision to industrialise should follow from how often the calculation runs, who depends on it, and what it would cost to be wrong.
