pycnic / pysimkernel

A Python package to control parameter scans and iterations for computational experiments
ISC License
1 stars 2 forks source link

Minimal testcase with multiple runs #12

Open andsor opened 8 years ago

andsor commented 8 years ago
import numpy as np
from simkernel import Experiment

def sim():
    return True

xp = Experiment(sim)
res = xp(repeat=3)

np.testing.assert_array_equal(res, [True, True, True])
andsor commented 8 years ago

This is trivial (and dumb) for deterministic functions, but is useful for experiments that measure computation time (cf. timeit) or for simple stochastic experiments (without the need for Common Random Numbers).