code: def calculate_pore_diameter_opt(self, **kwargs):
          
          (self.pore_diameter_opt, self.pore_opt_closest_atom,
           self.pore_opt_COM) = opt_pore_diameter(self.elements,
                                                  self.coordinates, **kwargs)
          self.properties['pore_diameter_opt'] = {
              'diameter': self.pore_diameter_opt,
              'atom_1': int(self.pore_opt_closest_atom),
              'centre_of_mass': self.pore_opt_COM,
          }
          return self.pore_diameter_opt
docs: Return the intrinsic pore diameter (for the optimised pore centre).
  
          Similarly to :func:`calculate_pore_diameter` this method returns the
          the intrinsic pore diameter, however, first a better approximation
          of the pore centre is found with optimisation.
  
          Returns
          -------
          :class:`float`
              The intrinsic pore diameter.