code: def compute_acl(cls, filename, start_index=None, end_index=None,
                      min_nsamples=10):
          
          acls = {}
          with cls._io(filename, 'r') as fp:
              if end_index is None:
                  end_index = fp.niterations
              tidx = numpy.arange(fp.ntemps)
              for param in fp.variable_params:
                  these_acls = numpy.zeros(fp.ntemps)
                  for tk in tidx:
                      samples = fp.read_raw_samples(
                          param, thin_start=start_index, thin_interval=1,
                          thin_end=end_index, temps=tk, flatten=False)[param]
                      # contract the walker dimension using the mean, and flatten
                      # the (length 1) temp dimension
                      samples = samples.mean(axis=1)[0, :]
                      if samples.size < min_nsamples:
                          acl = numpy.inf
                      else:
                          acl = autocorrelation.calculate_acl(samples)
                      if acl <= 0:
                          acl = numpy.inf
                      these_acls[tk] = acl
                  acls[param] = these_acls
          return acls
docs: Computes the autocorrleation length for all model params and
          temperatures in the given file.
  
          Parameter values are averaged over all walkers at each iteration and
          temperature.  The ACL is then calculated over the averaged chain.
  
          Parameters
          -----------
          filename : str
              Name of a samples file to compute ACLs for.
          start_index : {None, int}
              The start index to compute the acl from. If None, will try to use
              the number of burn-in iterations in the file; otherwise, will start
              at the first sample.
          end_index : {None, int}
              The end index to compute the acl to. If None, will go to the end
              of the current iteration.
          min_nsamples : int, optional
              Require a minimum number of samples to compute an ACL. If the
              number of samples per walker is less than this, will just set to
              ``inf``. Default is 10.
  
          Returns
          -------
          dict
              A dictionary of ntemps-long arrays of the ACLs of each parameter.