




'''simple docstring'''





import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

lowercase__								=						[[1_2, 1_0], [3, 9]]
lowercase__								=						[[3, 4], [7, 4]]
lowercase__								=						[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
lowercase__								=						[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
lowercase__								=						[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
lowercase__								=						[1]
lowercase__								=						[2]

lowercase__								=						logging.getLogger()
lowercase__								=						logging.DEBUG
lowercase__								=						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 					UpperCamelCase						(	snake_case						,  snake_case ):




   '''simple docstring'''

   if (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2) or (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2):
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         logger.info(f"""\n\t{test_addition.__name__} returned integer""" )
         matop.add(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )
   elif (np.array(_SCREAMING_SNAKE_CASE )).shape == (np.array(_SCREAMING_SNAKE_CASE )).shape:
      logger.info(f"""\n\t{test_addition.__name__} with same matrix dims""" )
      SCREAMING_SNAKE_CASE__      :					Any							    =			(np.array(_SCREAMING_SNAKE_CASE ) + np.array(_SCREAMING_SNAKE_CASE )).tolist()
      SCREAMING_SNAKE_CASE__      :					str							    =			matop.add(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )
      assert theo == act
   else:
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         logger.info(f"""\n\t{test_addition.__name__} with different matrix dims""" )
         matop.add(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )


@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 					UpperCamelCase						(	snake_case						,  snake_case ):




   '''simple docstring'''

   if (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2) or (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2):
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         logger.info(f"""\n\t{test_subtraction.__name__} returned integer""" )
         matop.subtract(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )
   elif (np.array(_SCREAMING_SNAKE_CASE )).shape == (np.array(_SCREAMING_SNAKE_CASE )).shape:
      logger.info(f"""\n\t{test_subtraction.__name__} with same matrix dims""" )
      SCREAMING_SNAKE_CASE__      :					List[str]							    =			(np.array(_SCREAMING_SNAKE_CASE ) - np.array(_SCREAMING_SNAKE_CASE )).tolist()
      SCREAMING_SNAKE_CASE__      :					Any							    =			matop.subtract(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )
      assert theo == act
   else:
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         logger.info(f"""\n\t{test_subtraction.__name__} with different matrix dims""" )
         assert matop.subtract(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )


@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 					UpperCamelCase						(	snake_case						,  snake_case ):




   '''simple docstring'''

   if (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2) or (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2):
      logger.info(f"""\n\t{test_multiplication.__name__} returned integer""" )
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         matop.add(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )
   elif (np.array(_SCREAMING_SNAKE_CASE )).shape == (np.array(_SCREAMING_SNAKE_CASE )).shape:
      logger.info(f"""\n\t{test_multiplication.__name__} meets dim requirements""" )
      SCREAMING_SNAKE_CASE__      :					Tuple							    =			(np.matmul(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )).tolist()
      SCREAMING_SNAKE_CASE__      :					Union[str, Any]							    =			matop.multiply(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )
      assert theo == act
   else:
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         logger.info(
             f"""\n\t{test_multiplication.__name__} does not meet dim requirements""" )
         assert matop.subtract(_SCREAMING_SNAKE_CASE						,  _SCREAMING_SNAKE_CASE )


@pytest.mark.mat_ops
def 					UpperCamelCase						(	):




   '''simple docstring'''

   SCREAMING_SNAKE_CASE__      :					Union[str, Any]							    =			(3.5 * np.array(_SCREAMING_SNAKE_CASE )).tolist()
   SCREAMING_SNAKE_CASE__      :					int							    =			matop.scalar_multiply(_SCREAMING_SNAKE_CASE						,  3.5 )
   assert theo == act


@pytest.mark.mat_ops
def 					UpperCamelCase						(	):




   '''simple docstring'''

   SCREAMING_SNAKE_CASE__      :					Any							    =			(np.identity(5 )).tolist()
   SCREAMING_SNAKE_CASE__      :					str							    =			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 					UpperCamelCase						(	snake_case ):




   '''simple docstring'''

   if (np.array(_SCREAMING_SNAKE_CASE )).shape < (2, 2):
      with pytest.raises(_SCREAMING_SNAKE_CASE ):
         logger.info(f"""\n\t{test_transpose.__name__} returned integer""" )
         matop.transpose(_SCREAMING_SNAKE_CASE )
   else:
      SCREAMING_SNAKE_CASE__      :					Any							    =			(np.transpose(_SCREAMING_SNAKE_CASE )).tolist()
      SCREAMING_SNAKE_CASE__      :					List[Any]							    =			matop.transpose(_SCREAMING_SNAKE_CASE						,  return_map=_SCREAMING_SNAKE_CASE )
      assert theo == act



'''simple docstring'''







import logging

# standard libraries
import sys

import numpy as np
import pytest  # type: ignore

# Custom/local libraries
from matrix import matrix_operation as matop

_snake_case					: List[str]     			=					[[12, 10], [3, 9]]
_snake_case					: Any     			=					[[3, 4], [7, 4]]
_snake_case					: List[str]     			=					[[3, 0, 2], [2, 0, -2], [0, 1, 1]]
_snake_case					: Any     			=					[[3, 0, -2], [2, 0, 2], [0, 1, 1]]
_snake_case					: Any     			=					[[3, 0, 2], [2, 0, -2], [0, 1, 1], [2, 0, -2]]
_snake_case					: Optional[Any]     			=					[1]
_snake_case					: str     			=					[2]

_snake_case					: Optional[int]     			=					logging.getLogger()
_snake_case					: Optional[Any]     			=					logging.DEBUG
_snake_case					: Tuple     			=					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		(						_SCREAMING_SNAKE_CASE		: List[Any]						,      _SCREAMING_SNAKE_CASE		: Tuple	):
						if (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2) or (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2):
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		logger.info(F'\n\t{test_addition.__name__} returned integer'	)
																		matop.add(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
						elif (np.array(_SCREAMING_SNAKE_CASE	)).shape == (np.array(_SCREAMING_SNAKE_CASE	)).shape:
												logger.info(F'\n\t{test_addition.__name__} with same matrix dims'	)
												_SCREAMING_SNAKE_CASE					=			(np.array(_SCREAMING_SNAKE_CASE	) + np.array(_SCREAMING_SNAKE_CASE	)).tolist()
												_SCREAMING_SNAKE_CASE					=			matop.add(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
												assert theo == act
						else:
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		logger.info(F'\n\t{test_addition.__name__} with different matrix dims'	)
																		matop.add(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)



@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		(						_SCREAMING_SNAKE_CASE		: Optional[Any]						,      _SCREAMING_SNAKE_CASE		: List[str]	):
						if (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2) or (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2):
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		logger.info(F'\n\t{test_subtraction.__name__} returned integer'	)
																		matop.subtract(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
						elif (np.array(_SCREAMING_SNAKE_CASE	)).shape == (np.array(_SCREAMING_SNAKE_CASE	)).shape:
												logger.info(F'\n\t{test_subtraction.__name__} with same matrix dims'	)
												_SCREAMING_SNAKE_CASE					=			(np.array(_SCREAMING_SNAKE_CASE	) - np.array(_SCREAMING_SNAKE_CASE	)).tolist()
												_SCREAMING_SNAKE_CASE					=			matop.subtract(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
												assert theo == act
						else:
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		logger.info(F'\n\t{test_subtraction.__name__} with different matrix dims'	)
																		assert matop.subtract(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)



@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		(						_SCREAMING_SNAKE_CASE		: Any						,      _SCREAMING_SNAKE_CASE		: List[str]	):
						if (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2) or (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2):
												logger.info(F'\n\t{test_multiplication.__name__} returned integer'	)
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		matop.add(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
						elif (np.array(_SCREAMING_SNAKE_CASE	)).shape == (np.array(_SCREAMING_SNAKE_CASE	)).shape:
												logger.info(F'\n\t{test_multiplication.__name__} meets dim requirements'	)
												_SCREAMING_SNAKE_CASE					=			(np.matmul(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)).tolist()
												_SCREAMING_SNAKE_CASE					=			matop.multiply(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
												assert theo == act
						else:
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		logger.info(
																		    F'\n\t{test_multiplication.__name__} does not meet dim requirements'	)
																		assert matop.subtract(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)



@pytest.mark.mat_ops
def       _a		(						):
						_SCREAMING_SNAKE_CASE					=			(3.5 * np.array(_SCREAMING_SNAKE_CASE	)).tolist()
						_SCREAMING_SNAKE_CASE					=			matop.scalar_multiply(_SCREAMING_SNAKE_CASE						,      3.5	)
						assert theo == act



@pytest.mark.mat_ops
def       _a		(						):
						_SCREAMING_SNAKE_CASE					=			(np.identity(5	)).tolist()
						_SCREAMING_SNAKE_CASE					=			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		(						_SCREAMING_SNAKE_CASE		: Tuple	):
						if (np.array(_SCREAMING_SNAKE_CASE	)).shape < (2, 2):
												with pytest.raises(_SCREAMING_SNAKE_CASE	):
																		logger.info(F'\n\t{test_transpose.__name__} returned integer'	)
																		matop.transpose(_SCREAMING_SNAKE_CASE	)
						else:
												_SCREAMING_SNAKE_CASE					=			(np.transpose(_SCREAMING_SNAKE_CASE	)).tolist()
												_SCREAMING_SNAKE_CASE					=			matop.transpose(_SCREAMING_SNAKE_CASE						,      return_map=_SCREAMING_SNAKE_CASE	)
												assert theo == act