Example #1
0
    def test__square_matrix(self):
        """Test fill zeros a triangular matrix"""
        # Run
        matrix = [[0.1, 0.5], [0.3]]
        result = Sampler._square_matrix(matrix)

        # Asserts
        expected = [[0.1, 0.5], [0.3, 0.0]]
        assert result == expected
Example #2
0
    def test__square_matrix(self):
        """_square_matrix transform triagular list of list into square matrix."""
        # Setup
        data_navigator = MagicMock()
        modeler = MagicMock()
        sampler = Sampler(data_navigator, modeler)

        triangular_matrix = [[1], [1, 1], [1, 1, 1]]

        expected_result = [[1, 0, 0], [1, 1, 0], [1, 1, 1]]

        # Run
        result = sampler._square_matrix(triangular_matrix)

        # Check
        assert result == expected_result