Calmcode - gin: intro to gin

Intro to Gin

1 2 3 4 5

Gin is a system for configuring python code that is still very much in early phases, but very powerful. In this series of videos we'll show examples how you can use it to configure general python scripts. You can install gin via pip install gin-config. Once that is taken care of you should be able to repeat the steps in this videos with these two files..


simulate.n_samples = 100

import gin
import random

def simulate(n_samples):
    return sum(random.random() for i in range(n_samples))

if __name__ == "__main__":

Notice how simulate() is able to run without any parameters being passed to it.