docstr: This tests the construction of a 1-modality, 2-hidden state factor, 2 control factor pandas MultiIndex dataframe using 
  the `model_labels` dictionary, which contains the hidden-state-factor- and control-factor-specific levels, labeled with string
  identifiers
docstr_tok: ["This","tests","the","construction","of","a","1-modality",",","2-hidden","state","factor",",","2","control","factor","pandas","MultiIndex","dataframe","using","the","`","model_labels","`","dictionary",",","which","contains","the","hidden-state-factor-","and","control-factor-specific","levels",",","labeled","with","string","identifiers"]
code: def test_B_matrix_stub(self):
      """
      This tests the construction of a 1-modality, 2-hidden state factor, 2 control factor pandas MultiIndex dataframe using
      the `model_labels` dictionary, which contains the hidden-state-factor- and control-factor-specific levels, labeled with string
      identifiers
      """
  
      model_labels = {
          "observations": {"reward outcome": ["win", "loss"]},
          "states": {
              "location": ["start", "arm1", "arm2"],
              "bandit_state": ["high_rew", "low_rew"],
          },
          "actions": {
              "arm_play": ["play_arm1", "play_arm2"],
              "bandit_state_control": ["null"],
          },
      }
  
      B_stubs = create_B_matrix_stubs(model_labels)
  
      xls_path = (tmp_path / "B_matrix_stubs.xlsx").resolve()
  
      with pd.ExcelWriter(xls_path) as writer:
          for factor_name, B_stub_f in B_stubs.items():
              B_stub_f.to_excel(writer, "%s" % factor_name)
  
      read_in_B_stubs = read_B_matrices(xls_path)
  
      os.remove(xls_path)
  
      all_stub_compares = [
          assert_frame_equal(stub_og, stub_read_in)
          for stub_og, stub_read_in in zip(
              *[B_stubs.values(), read_in_B_stubs.values()]
          )
      ]
      self.assertTrue(
          all(
              stub_compare is None for stub_compare in all_stub_compares
          )
      )
  
file_path: pymdp/test/test_wrappers.py
imports: import os
  import unittest
  from pathlib import Path
  import shutil
  import tempfile
  import numpy
  import itertools
  import pandas
  from pandas.testing import assert_frame_equal
  from pymdp.utils import create_A_matrix_stub, read_A_matrix, create_B_matrix_stubs, read_B_matrices
label_desc: Use image node_id 2 for calling the TestWrappers obj's underlying member method code with example usage: obj.test_B_matrix_stub() without return types