docs: def save(self, filename, dataset_number=None, force=False, overwrite=True,
               extension="h5", ensure_step_table=None):
          """Save the data structure to cellpy-format.
  
          Args:
              filename: (str) the name you want to give the file
              dataset_number: (int) if you have several datasets, chose the one
                  you want (probably leave this untouched)
              force: (bool) save a file even if the summary is not made yet
                  (not recommended)
              overwrite: (bool) save the new version of the file even if old one
                  exists.
              extension: (str) filename extension.
              ensure_step_table: (bool) make step-table if missing.
  
          Returns: Nothing at all.
          """
          if ensure_step_table is None:
              ensure_step_table = self.ensure_step_table
  
          dataset_number = self._validate_dataset_number(dataset_number)
          if dataset_number is None:
              self.logger.info("Saving test failed!")
              self._report_empty_dataset()
              return
  
          test = self.get_dataset(dataset_number)
  
          dfsummary_made = test.dfsummary_made
  
          if not dfsummary_made and not force:
              self.logger.info(
                  "You should not save datasets "
                  "without making a summary first!"
              )
              self.logger.info(
                  "If you really want to do it, "
                  "use save with force=True"
              )
              return
  
          step_table_made = test.step_table_made
  
          if not step_table_made and not force and not ensure_step_table:
              self.logger.info(
                  "You should not save datasets "
                  "without making a step-table first!"
              )
              self.logger.info(
                  "If you really want to do it, "
                  "use save with force=True"
              )
              return
  
          if not os.path.splitext(filename)[-1]:
              outfile_all = filename + "." + extension
          else:
              outfile_all = filename
  
          if os.path.isfile(outfile_all):
              self.logger.debug("Outfile exists")
              if overwrite:
                  self.logger.debug("overwrite = True")
                  os.remove(outfile_all)
              else:
                  self.logger.info(
                      "save (hdf5): file exist - did not save",
                      end=' '
                  )
                  self.logger.info(outfile_all)
                  return
  
          if ensure_step_table:
              self.logger.debug("ensure_step_table is on")
              if not test.step_table_made:
                  self.logger.debug("save: creating step table")
                  self.make_step_table(dataset_number=dataset_number)
  
          # This method can probalby be updated using pandas transpose trick
          self.logger.debug("trying to make infotable")
          infotbl, fidtbl = self._create_infotable(
              dataset_number=dataset_number
          )
          root = prms._cellpyfile_root
  
          self.logger.debug("trying to save to hdf5")
          txt = "\nHDF5 file: %s" % outfile_all
          self.logger.debug(txt)
  
          warnings.simplefilter("ignore", PerformanceWarning)
          try:
              store = pd.HDFStore(
                  outfile_all,
                  complib=prms._cellpyfile_complib,
                  complevel=prms._cellpyfile_complevel,
              )
  
              self.logger.debug("trying to put dfdata")
  
              self.logger.debug(" - lets set Data_Point as index")
              hdr_data_point = self.headers_normal.data_point_txt
              test.dfdata = test.dfdata.set_index(hdr_data_point,
                                                  drop=False)
  
              store.put(root + "/dfdata", test.dfdata,
                        format=prms._cellpyfile_dfdata_format)
              self.logger.debug(" dfdata -> hdf5 OK")
  
              self.logger.debug("trying to put dfsummary")
              store.put(root + "/dfsummary", test.dfsummary,
                        format=prms._cellpyfile_dfsummary_format)
              self.logger.debug(" dfsummary -> hdf5 OK")
  
              self.logger.debug("trying to put infotbl")
              store.put(root + "/info", infotbl,
                        format=prms._cellpyfile_infotable_format)
              self.logger.debug(" infotable -> hdf5 OK")
  
              self.logger.debug("trying to put fidtable")
              store.put(root + "/fidtable", fidtbl,
                        format=prms._cellpyfile_fidtable_format)
              self.logger.debug(" fidtable -> hdf5 OK")
  
              self.logger.debug("trying to put step_table")
              try:
                  store.put(root + "/step_table", test.step_table,
                            format=prms._cellpyfile_stepdata_format)
                  self.logger.debug(" step_table -> hdf5 OK")
              except TypeError:
                  test = self._fix_dtype_step_table(test)
                  store.put(root + "/step_table", test.step_table,
                            format=prms._cellpyfile_stepdata_format)
                  self.logger.debug(" fixed step_table -> hdf5 OK")
  
              # creating indexes
              # hdr_data_point = self.headers_normal.data_point_txt
              # hdr_cycle_steptable = self.headers_step_table.cycle
              # hdr_cycle_normal = self.headers_normal.cycle_index_txt
  
              # store.create_table_index(root + "/dfdata", columns=[hdr_data_point],
              #                          optlevel=9, kind='full')
          finally:
              store.close()
          self.logger.debug(" all -> hdf5 OK")
          warnings.simplefilter("default", PerformanceWarning)