docs: def datapoint(self, ind, field_names=None):
          """ Loads a tensor datapoint for a given global index.
  
          Parameters
          ----------
          ind : int
              global index in the tensor
          field_names : :obj:`list` of str
              field names to load
  
          Returns
          -------
          :obj:`TensorDatapoint`
              the desired tensor datapoint
          """
          # flush if necessary
          if self._has_unsaved_data:
              self.flush()
  
          # check valid input
          if ind >= self._num_datapoints:
              raise ValueError('Index %d larger than the number of datapoints in the dataset (%d)' %(ind, self._num_datapoints))
  
          # load the field names
          if field_names is None:
              field_names = self.field_names
          
          # return the datapoint
          datapoint = TensorDatapoint(field_names)
          file_num = self._index_to_file_num[ind]
          for field_name in field_names:
              tensor = self.tensor(field_name, file_num)
              tensor_index = ind % self._datapoints_per_file
              datapoint[field_name] = tensor.datapoint(tensor_index)
          return datapoint