docs: def _load_ini_based_io(path, recursive=False, ini=None,
                         subini={}, include_core=True,
                         only_coefficients=False):
      """ DEPRECATED: For convert a previous version to the new json format
  
      Loads a IOSystem or Extension from a ini files
  
      This function can be used to load a IOSystem or Extension specified in a
      ini file. DataFrames (tables) are loaded from text or binary pickle files.
      For the latter, the extension .pkl or .pickle is assumed, in all other case
      the tables are assumed to be in .txt format.
  
      Parameters
      ----------
  
      path : string
          path or ini file name for the data to load
  
      recursive : boolean, optional
          If True, load also the data in the subfolders and add them as
          extensions to the IOSystem (in that case path must point to the root).
          Only first order subfolders are considered (no subfolders in
          subfolders) and if a folder does not contain a ini file it's skipped.
          Use the subini parameter in case of multiple ini files in a subfolder.
          Attribute name of the extension in the IOSystem are based on the
          subfolder name.  Default is False
  
      ini : string, optional
          If there are several ini files in the root folder, take this one for
          loading the data If None (default) take the ini found in the folder,
          error if several are found
  
      subini : dict, optional
          If there are multiple ini in the subfolder, use the ini given in the
          dict.  Format: 'subfoldername':'ininame' If a key for a subfolder is
          not found or None (default), the ini found in the folder will be taken,
          error if several are found
  
      include_core : boolean, optional
          If False the load method does not include A, L and Z matrix. This
          significantly reduces the required memory if the purpose is only
          to analyse the results calculated beforehand.
  
      Returns
      -------
  
          IOSystem or Extension class depending on systemtype in the ini file
          None in case of errors
  
      """
  
      # check path and given parameter
      ini_file_name = None
  
      path = os.path.abspath(os.path.normpath(path))
  
      if os.path.splitext(path)[1] == '.ini':
          (path, ini_file_name) = os.path.split(path)
  
      if ini:
          ini_file_name = ini
  
      if not os.path.exists(path):
          raise ReadError('Given path does not exist')
          return None
  
      if not ini_file_name:
          _inifound = False
          for file in os.listdir(path):
              if os.path.splitext(file)[1] == '.ini':
                  if _inifound:
                      raise ReadError(
                              'Found multiple ini files in folder - specify one')
                      return None
                  ini_file_name = file
                  _inifound = True
  
      # read the ini
      io_ini = configparser.RawConfigParser()
      io_ini.optionxform = lambda option: option
  
      io_ini.read(os.path.join(path, ini_file_name))
  
      systemtype = io_ini.get('systemtype', 'systemtype', fallback=None)
      name = io_ini.get('meta', 'name',
                        fallback=os.path.splitext(ini_file_name)[0])
  
      if systemtype == 'IOSystem':
          ret_system = IOSystem(name=name)
      elif systemtype == 'Extension':
          ret_system = Extension(name=name)
      else:
          raise ReadError('System not defined in ini')
          return None
  
      for key in io_ini['meta']:
          setattr(ret_system, key, io_ini.get('meta', key, fallback=None))
  
      for key in io_ini['files']:
          if '_nr_index_col' in key:
              continue
          if '_nr_header' in key:
              continue
  
          if not include_core:
              not_to_load = ['A', 'L', 'Z']
              if key in not_to_load:
                  continue
  
          if only_coefficients:
              _io = IOSystem()
              if key not in _io.__coefficients__ + ['unit']:
                  continue
  
          file_name = io_ini.get('files', key)
          nr_index_col = io_ini.get(
              'files', key + '_nr_index_col', fallback=None)
          nr_header = io_ini.get('files', key + '_nr_header', fallback=None)
  
          if (nr_index_col is None) or (nr_header is None):
              raise ReadError(
                      'Index or column specification missing for {}'.
                      format(str(file_name)))
              return None
  
          _index_col = list(range(int(nr_index_col)))
          _header = list(range(int(nr_header)))
  
          if _index_col == [0]:
              _index_col = 0
          if _header == [0]:
              _header = 0
          file = os.path.join(path, file_name)
          logging.info('Load data from {}'.format(file))
  
          if (os.path.splitext(file)[1] == '.pkl' or
                  os.path.splitext(file)[1] == '.pickle'):
              setattr(ret_system, key,
                      pd.read_pickle(file))
          else:
              setattr(ret_system, key,
                      pd.read_table(file,
                                    index_col=_index_col,
                                    header=_header))
  
      if recursive:
          # look for subfolder in the given path
          subfolder_list = os.walk(path).__next__()[1]
  
          # loop all subfolder and append extension based on
          # ini file in subfolder
          for subfolder in subfolder_list:
              subini_file_name = subini.get(subfolder)
              subpath = os.path.abspath(os.path.join(path, subfolder))
  
              if not subini_file_name:
                  _inifound = False
                  for file in os.listdir(subpath):
                      if os.path.splitext(file)[1] == '.ini':
                          if _inifound:
                              raise ReadError(
                                  'Found multiple ini files in subfolder '
                                  '{} - specify one'.format(subpath))
                              return None
                          subini_file_name = file
                          _inifound = True
              if not _inifound:
                  continue
  
              # read the ini
              subio_ini = configparser.RawConfigParser()
              subio_ini.optionxform = lambda option: option
  
              subio_ini.read(os.path.join(subpath, subini_file_name))
  
              systemtype = subio_ini.get('systemtype', 'systemtype',
                                         fallback=None)
              name = subio_ini.get('meta', 'name',
                                   fallback=os.path.splitext(
                                       subini_file_name)[0])
  
              if systemtype == 'IOSystem':
                  raise ReadError('IOSystem found in subfolder {} - '
                                  'only extensions expected'.format(subpath))
                  return None
              elif systemtype == 'Extension':
                  sub_system = Extension(name=name)
              else:
                  raise ReadError('System not defined in ini')
                  return None
  
              for key in subio_ini['meta']:
                  setattr(sub_system, key, subio_ini.get('meta', key,
                                                         fallback=None))
  
              for key in subio_ini['files']:
                  if '_nr_index_col' in key:
                      continue
                  if '_nr_header' in key:
                      continue
  
                  if only_coefficients:
                      _ext = Extension('temp')
                      if key not in _ext.__coefficients__ + ['unit']:
                          continue
  
                  file_name = subio_ini.get('files', key)
                  nr_index_col = subio_ini.get('files', key + '_nr_index_col',
                                               fallback=None)
                  nr_header = subio_ini.get('files', key + '_nr_header',
                                            fallback=None)
  
                  if (nr_index_col is None) or (nr_header is None):
                      raise ReadError('Index or column specification missing '
                                      'for {}'.format(str(file_name)))
                      return None
  
                  _index_col = list(range(int(nr_index_col)))
                  _header = list(range(int(nr_header)))
  
                  if _index_col == [0]:
                      _index_col = 0
                  if _header == [0]:
                      _header = 0
                  file = os.path.join(subpath, file_name)
                  logging.info('Load data from {}'.format(file))
                  if (os.path.splitext(file)[1] == '.pkl' or
                          os.path.splitext(file)[1] == '.pickle'):
                      setattr(sub_system, key,
                              pd.read_pickle(file))
                  else:
                      setattr(sub_system, key,
                              pd.read_table(file,
                                            index_col=_index_col,
                                            header=_header))
  
                  # get valid python name from folder
                  def clean(varStr):
                      return re.sub('\W|^(?=\d)', '_', str(varStr))
  
                  setattr(ret_system, clean(subfolder), sub_system)
  
      return ret_system