docs: def add_data(self, data, metadata=None):
          """Add data to the parameter set
  
          Parameters
          ----------
          data: numpy.ndarray
              one or more parameter sets. It must either be 1D or 2D, with the
              first dimension the number of parameter sets (K), and the second
              the number of elements (N): K x N
          metadata: object, optional
              the provided object will be stored in in the metadata dict and can
              be received with the ID that is returned. If multiple (K) datasets
              are added at ones, provide a list of objects with len K.
  
          Returns
          -------
          int, ID
              ID which can be used to access the parameter set
  
          Examples
          --------
  
          >>> # suppose that grid is a fully initialized grid oject with 100
              # elements
              parman = ParMan(grid)
              #
              one_data_set = np.ones(100)
              cid = parman.add_data(one_data_set)
              print(parman.parsets[cid])
              two_data_sets = np.ones((2, 100))
              cids = parman.add_data(two_data_sets)
              print(cids)
          [0, ]
          [1, 2]
  
          """
          subdata = np.atleast_2d(data)
  
          # we try to accommodate transposed input
          if subdata.shape[1] != self.grid.nr_of_elements:
              if subdata.shape[0] == self.grid.nr_of_elements:
                  subdata = subdata.T
              else:
                  raise Exception(
                      'Number of values does not match the number of ' +
                      'elements in the grid'
                  )
  
          # now make sure that metadata can be zipped with the subdata
          K = subdata.shape[0]
          if metadata is not None:
              if K > 1:
                  if(not isinstance(metadata, (list, tuple)) or
                     len(metadata) != K):
                      raise Exception('metadata does not fit the provided data')
              else:
                  # K == 1
                  metadata = [metadata, ]
  
          if metadata is None:
              metadata = [None for i in range(0, K)]
  
          return_ids = []
          for dataset, meta in zip(subdata, metadata):
              cid = self._get_next_index()
              self.parsets[cid] = dataset
              self.metadata[cid] = meta
              return_ids.append(cid)
  
          if len(return_ids) == 1:
              return return_ids[0]
          else:
              return return_ids