code: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
          IAtomContainer cloneContainer = AtomContainerManipulator.removeHydrogens(atomContainer);
          double petitjeanNumber; //weinerPath
          int diameter = PathTools.getMolecularGraphDiameter(cloneContainer);
          int radius = PathTools.getMolecularGraphRadius(cloneContainer);
  
          if (diameter == 0)
              petitjeanNumber = 0;
          else
              petitjeanNumber = (diameter - radius) / (double) diameter;
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                  petitjeanNumber), getDescriptorNames());
      }
docs: Evaluate the descriptor for the molecule.
  
  @param  atomContainer                AtomContainer
  @return                   petitjean number