code: def write_sampler_metadata(self, sampler):
          
          super(MultiTemperedMetadataIO, self).write_sampler_metadata(sampler)
          self[self.sampler_group].attrs["ntemps"] = sampler.ntemps
docs: Adds writing ntemps to file.