Exemplo n.º 1
0
    def test__to_array_list_values_of_list_values_dimensions_one(self):
        # setup
        instance = MagicMock()
        instance.dimensions = 1
        values = [[1], [2], [3]]

        # run
        result = BaseHyperParam._to_array(instance, values)

        # assert
        np.testing.assert_array_equal(result, np.array([[1], [2], [3]]))
Exemplo n.º 2
0
    def test__to_array_scalar_value_dimension_one(self):
        # setup
        instance = MagicMock()
        instance.dimensions = 1
        values = 1

        # run
        result = BaseHyperParam._to_array(instance, values)

        # assert
        np.testing.assert_array_equal(result, np.array([[1]]))