code: def optimise_xy(xy, *args):
      
      z, elements, coordinates = args
      window_com = np.array([xy[0], xy[1], z])
      return -pore_diameter(elements, coordinates, com=window_com)[0]
docs: Return negative pore diameter for x and y coordinates optimisation.