@unittest.skipIf((not scipy_gte_019), 'only run if scipy>=0.19.')
def test_xor(self):
    import numpy as np
    import openmdao.api as om
    xor_interp = om.MetaModelStructuredComp(method='scipy_slinear')
    xor_interp.add_input('x', 0.0, training_data=np.array([0.0, 1.0]), units=None)
    xor_interp.add_input('y', 1.0, training_data=np.array([0.0, 1.0]), units=None)
    xor_interp.add_output('xor', 1.0, training_data=np.array([[0.0, 1.0], [1.0, 0.0]]), units=None)
    model = om.Group()
    model.add_subsystem('comp', xor_interp, promotes=['*'])
    prob = om.Problem(model)
    prob.setup()
    prob.set_val('x', 0)
    prob.set_val('x', 0.9)
    prob.set_val('y', 0.001242)
    prob.run_model()
    computed = prob.get_val('xor')
    actual = 0.8990064
    assert_almost_equal(computed, actual)
    prob.check_partials(compact_print=True)
@unittest.skipIf((not scipy_gte_019), 'only run if scipy>=0.19.')
def test_xor(self):
    import numpy as np
    import openmdao.api as om
    xor_interp = om.MetaModelStructuredComp(method='scipy_slinear')
    xor_interp.add_input('x', 0.0, training_data=np.array([0.0, 1.0]), units=None)
    xor_interp.add_input('y', 1.0, training_data=np.array([0.0, 1.0]), units=None)
    xor_interp.add_output('xor', 1.0, training_data=np.array([[0.0, 1.0], [1.0, 0.0]]), units=None)
    model = om.Group()
    model.add_subsystem('comp', xor_interp, promotes=['*'])
    prob = om.Problem(model)
    prob.setup()
    prob.set_val('x', 0)
    prob.set_val('x', 0.9)
    prob.set_val('y', 0.001242)
    prob.run_model()
    computed = prob.get_val('xor')
    actual = 0.8990064
    assert_almost_equal(computed, actual)
    prob.check_partials(compact_print=True)