def test_addnonlinear_call_positional(): #================================================================ "Check that calling the model with parameters returns the correct response" model = Model(gauss) model.addnonlinear('trivial1') model.addnonlinear('trivial2') response = model(3, 0.2, 1, 1) reference = gauss(3, 0.2) assert np.allclose(response, reference)
def test_addnonlinear_call_keywords(): #================================================================ "Check that calling the model with parameters returns the correct response" model = Model(gauss) model.addnonlinear('trivial1') model.addnonlinear('trivial2') response = model(mean=3, width=0.2, trivial1=1, trivial2=1) reference = gauss(mean=3, width=0.2) assert np.allclose(response, reference)