






import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

a 			=							[[12, 10], [3, 9]]
a 			=							[[3, 4], [7, 4]]
a 			=							[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
a 			=							[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
a 			=							[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
a 			=							[1]
a 			=							[2]

a 			=							logging.getLogger()
a 			=							logging.DEBUG
a 			=							logging.StreamHandler(sys.stdout)
logger.addHandler(stream_handler)
@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ("""mat1""", """mat2""")		,					[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]       )
def    a__    (	A		,					A       ):
   if (np.array(A       )).shape < (2, 2) or (np.array(A       )).shape < (2, 2):
      with pytest.raises(A       ):
         logger.info(F'''\n\t{test_addition.__name__} returned integer'''       )
         matop.add(A		,					A       )
   elif (np.array(A       )).shape == (np.array(A       )).shape:
      logger.info(F'''\n\t{test_addition.__name__} with same matrix dims'''       )
      lowercase__    :						Union[str, Any]       =			(np.array(A       ) + np.array(A       )).tolist()
      lowercase__    :						str       =			matop.add(A		,					A       )
      assert theo == act
   else:
      with pytest.raises(A       ):
         logger.info(F'''\n\t{test_addition.__name__} with different matrix dims'''       )
         matop.add(A		,					A       )
@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ("""mat1""", """mat2""")		,					[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]       )
def    a__    (	A		,					A       ):
   if (np.array(A       )).shape < (2, 2) or (np.array(A       )).shape < (2, 2):
      with pytest.raises(A       ):
         logger.info(F'''\n\t{test_subtraction.__name__} returned integer'''       )
         matop.subtract(A		,					A       )
   elif (np.array(A       )).shape == (np.array(A       )).shape:
      logger.info(F'''\n\t{test_subtraction.__name__} with same matrix dims'''       )
      lowercase__    :						List[str]       =			(np.array(A       ) - np.array(A       )).tolist()
      lowercase__    :						Union[str, Any]       =			matop.subtract(A		,					A       )
      assert theo == act
   else:
      with pytest.raises(A       ):
         logger.info(F'''\n\t{test_subtraction.__name__} with different matrix dims'''       )
         assert matop.subtract(A		,					A       )
@pytest.mark.mat_ops
@pytest.mark.parametrize(
    ("""mat1""", """mat2""")		,					[(mat_a, mat_b), (mat_c, mat_d), (mat_d, mat_e), (mat_f, mat_h)]       )
def    a__    (	A		,					A       ):
   if (np.array(A       )).shape < (2, 2) or (np.array(A       )).shape < (2, 2):
      logger.info(F'''\n\t{test_multiplication.__name__} returned integer'''       )
      with pytest.raises(A       ):
         matop.add(A		,					A       )
   elif (np.array(A       )).shape == (np.array(A       )).shape:
      logger.info(F'''\n\t{test_multiplication.__name__} meets dim requirements'''       )
      lowercase__    :						Optional[Any]       =			(np.matmul(A		,					A       )).tolist()
      lowercase__    :						Optional[int]       =			matop.multiply(A		,					A       )
      assert theo == act
   else:
      with pytest.raises(A       ):
         logger.info(
             F'''\n\t{test_multiplication.__name__} does not meet dim requirements'''       )
         assert matop.subtract(A		,					A       )
@pytest.mark.mat_ops
def    a__    (	):
   lowercase__    :						Any       =			(3.5 * np.array(A       )).tolist()
   lowercase__    :						str       =			matop.scalar_multiply(A		,					3.5       )
   assert theo == act
@pytest.mark.mat_ops
def    a__    (	):
   lowercase__    :						List[str]       =			(np.identity(5       )).tolist()
   lowercase__    :						List[Any]       =			matop.identity(5       )
   assert theo == act






@pytest.mark.mat_ops
@pytest.mark.parametrize("""mat"""		,					[mat_a, mat_b, mat_c, mat_d, mat_e, mat_f]       )
def    a__    (	A       ):
   if (np.array(A       )).shape < (2, 2):
      with pytest.raises(A       ):
         logger.info(F'''\n\t{test_transpose.__name__} returned integer'''       )
         matop.transpose(A       )
   else:
      lowercase__    :						Union[str, Any]       =			(np.transpose(A       )).tolist()
      lowercase__    :						str       =			matop.transpose(A		,					return_map=A       )
      assert theo == act










def    a__    (	A       ):
   return " ".join([word[::-1] for word in input_str.split()]       )


if __name__ == "__main__":
 import doctest

 doctest.testmod()


