code: def test_ajd_init_error(ajd, get_covmats):
      """Test init for ajd algos"""
      n_matrices, n_channels = 5, 3
      covmats = get_covmats(n_matrices, n_channels)
      with pytest.raises(ValueError):  # not 2D array
          ajd(covmats, init=np.ones((3, 2, 2)))
      with pytest.raises(ValueError):  # not square array
          ajd(covmats, init=np.ones((3, 2)))
      with pytest.raises(ValueError):  # shape not equal to n_channels
          ajd(covmats, init=np.ones((2, 2)))
  
file_path: pyRiemann/tests/test_utils_ajd.py
imports: from numpy.testing import assert_array_equal
  import numpy
  import pytest
  from pytest import approx
  from pyriemann.utils.ajd import rjd, ajd_pham, uwedge
label_desc: Use image node_id 2 for calling a global function with example usage: test_ajd_init_error(ajd, get_covmats) without return types