

def test_two_dim_bi_fidelity_training(self):
    mm = MultiFiMetaModel(nfi=2)
    mm.add_param('x1', 0.0)
    mm.add_param('x2', 0.0)
    surr_y1 = MockSurrogate()
    surr_y2 = MockSurrogate()
    mm.add_output('y1', 0.0, surrogate=surr_y1)
    mm.add_output('y2', 0.0, surrogate=surr_y2)
    prob = Problem(Group())
    prob.root.add('mm', mm)
    prob.setup(check=False)
    prob['mm.train:x1'] = [1.0, 2.0, 3.0]
    prob['mm.train:x1_fi2'] = [1.1, 2.1, 3.1, 1.0, 2.0, 3.0]
    prob['mm.train:x2'] = [1.0, 2.0, 3.0]
    prob['mm.train:x2_fi2'] = [2.1, 2.2, 2.3, 1.0, 2.0, 3.0]
    prob['mm.train:y1'] = [0.0, 0.1, 0.2]
    prob['mm.train:y1_fi2'] = [3.0, 3.1, 3.3, 3.4, 3.5, 3.6]
    prob['mm.train:y2'] = [4.0, 4.0, 4.0]
    prob['mm.train:y2_fi2'] = [4.0, 4.1, 4.3, 4.4, 4.5, 4.6]
    prob.run()
    expected_xtrain = [np.array([[1.0, 1.0], [2.0, 2.0], [3.0, 3.0]]), np.array([[1.1, 2.1], [2.1, 2.2], [3.1, 2.3], [1.0, 1.0], [2.0, 2.0], [3.0, 3.0]])]
    expected_y1train = [np.array([[0.0], [0.1], [0.2]]), np.array([[3.0], [3.1], [3.3], [3.4], [3.5], [3.6]])]
    expected_y2train = [np.array([[4.0], [4.0], [4.0]]), np.array([[4.0], [4.1], [4.3], [4.4], [4.5], [4.6]])]
    np.testing.assert_array_equal(surr_y1.ytrain[0], self[0])
    np.testing.assert_array_equal(surr_y1.ytrain[1], expected_y1train[1])
    np.testing.assert_array_equal(surr_y2.ytrain[0], expected_y2train[0])
    np.testing.assert_array_equal(surr_y2.ytrain[1], expected_y2train[1])
    np.testing.assert_array_equal(surr_y1.ytrain[0], expected_y1train[0])
    np.testing.assert_array_equal(surr_y1.ytrain[1], expected_y1train[1])
    np.testing.assert_array_equal(surr_y2.ytrain[0], expected_y2train[0])
    np.testing.assert_array_equal(surr_y2.ytrain[1], expected_y2train[1])

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/components/test/test_multifi_meta_model.py MultiFiMetaModelTestCase.test_two_dim_bi_fidelity_training/VarMisuse@431/588 `expected_y1train`->`self`