code: def close_data(self):
          
          # save the total number of cells to make re-loading convient
          if self.datafile is not None:
              if self.datafile.filemode != 'r':
                  self.datafile.set_metadata('', {'total cells': self.current_cellid})
              self.datafile.close()
              self.datafile = None
docs: Closes the current data file