docs: def calculate_chunks(self):
          """
          Work out the number of chunks the data is in, for cases
          where the meta data doesn't change at all so there is no
          lead in.
  
          Also increments the number of values for objects in this
          segment, based on the number of chunks.
          """
  
          if self.toc['kTocDAQmxRawData']:
              # chunks defined differently for DAQmxRawData format
              try:
                  data_size = next(
                      o.number_values * o.raw_data_width
                      for o in self.ordered_objects
                      if o.has_data and o.number_values * o.raw_data_width > 0)
              except StopIteration:
                  data_size = 0
          else:
              data_size = sum([
                  o.data_size
                  for o in self.ordered_objects if o.has_data])
  
          total_data_size = self.next_segment_offset - self.raw_data_offset
          if data_size < 0 or total_data_size < 0:
              raise ValueError("Negative data size")
          elif data_size == 0:
              # Sometimes kTocRawData is set, but there isn't actually any data
              if total_data_size != data_size:
                  raise ValueError(
                      "Zero channel data size but data length based on "
                      "segment offset is %d." % total_data_size)
              self.num_chunks = 0
              return
          chunk_remainder = total_data_size % data_size
          if chunk_remainder == 0:
              self.num_chunks = int(total_data_size // data_size)
  
              # Update data count for the overall tdms object
              # using the data count for this segment.
              for obj in self.ordered_objects:
                  if obj.has_data:
                      obj.tdms_object.number_values += (
                          obj.number_values * self.num_chunks)
  
          else:
              log.warning(
                  "Data size %d is not a multiple of the "
                  "chunk size %d. Will attempt to read last chunk" %
                  (total_data_size, data_size))
              self.num_chunks = 1 + int(total_data_size // data_size)
  
              self.final_chunk_proportion = (
                  float(chunk_remainder) / float(data_size))
  
              for obj in self.ordered_objects:
                  if obj.has_data:
                      obj.tdms_object.number_values += (
                          obj.number_values * (self.num_chunks - 1) + int(
                              obj.number_values * self.final_chunk_proportion))