Daniel Temesgen

Python Utils Module

Often when writing code it makes sense to abstract some functionality into a helper function. This is usually stored at the top of your file and saves having to write code multiple times.

Further still, if this functionality can be made use of by multiple files then abstracting it into a module can also be useful.

We can then import this module like any package with the usual syntax.

import py_utils

I’ve written out some functions I find helpful and pushed them to a repo you can find here.

It features helpful code on model saving and loading, as well as sensitivity tests.

Rather than writing a guide here, I’ve included a notebook file in the repo which explains the functions and runs through some examples.

You can run this code yourself using myBinder, a tool which turns notebooks into remote executable environments. Click the link below to get started.

Binder

This project is maintained by danieltemesgen