pycnic / pysimkernel

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

Testcase with input / parameter #17

Open andsor opened 8 years ago

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

# define simulation
def sim(x):
    return x

# define experiment
xp = Experiment(sim, inputgen=range)

# execute experiment
res = xp(input=3)

np.testing.assert_array_equal(res, [0, 1, 2])
andsor commented 8 years ago

Parameters here are sort of Meta-Input

andsor commented 8 years ago

Same functionality as #16 but now input generation is part of the experiment definition (structure), and only the parameter of input generation is part of the execution, which allows for hierarchical experiments.