test_class.file: descriptor/qsaratomic/src/test/java/org/openscience/cdk/qsar/descriptors/atomic/EffectiveAtomPolarizabilityDescriptorTest.java
test_class.identifier: EffectiveAtomPolarizabilityDescriptorTest
test_class.superclass: extends AtomicDescriptorTest
test_case.body: @Test
      public void testPolarizabilityDescriptor_Ethanolamine() throws Exception {
          double[] testResult = {4.2552, 5.1945, 4.883, 3.595}; /*
                                                                 * from Petra
                                                                 * online:
                                                                 * http://www2
                                                                 * .chemie
                                                                 * .uni-erlangen
                                                                 * .de
                                                                 * /services/petra
                                                                 * /smiles.phtml
                                                                 */
          EffectiveAtomPolarizabilityDescriptor descriptor = new EffectiveAtomPolarizabilityDescriptor();
  
          SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
          IAtomContainer mol = sp.parseSmiles("NCCO");
          addExplicitHydrogens(mol);
          for (int i = 0; i < 4; i++) {
              double result = ((DoubleResult) descriptor.calculate(mol.getAtom(i), mol).getValue()).doubleValue();
              Assert.assertEquals(testResult[i], result, 0.01);
          }
      }
test_case.class_method_signature: EffectiveAtomPolarizabilityDescriptorTest.testPolarizabilityDescriptor_Ethanolamine()
test_case.full_signature: @Test public void testPolarizabilityDescriptor_Ethanolamine()
test_case.identifier: testPolarizabilityDescriptor_Ethanolamine
test_case.invocations: getInstance parseSmiles addExplicitHydrogens doubleValue getValue calculate getAtom assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPolarizabilityDescriptor_Ethanolamine()
focal_class.declarator: pol
focal_class.modifier: private
focal_class.original_string: private Polarizability pol;
focal_class.type: Polarizability
focal_class.var_name: pol
focal_class.file: descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/EffectiveAtomPolarizabilityDescriptor.java
focal_class.identifier: EffectiveAtomPolarizabilityDescriptor
focal_class.interfaces: implements IAtomicDescriptor
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.EffectiveAtomPolarizabilityDescriptor()
focal_class.full_signature: public  EffectiveAtomPolarizabilityDescriptor()
focal_class.identifier: EffectiveAtomPolarizabilityDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  EffectiveAtomPolarizabilityDescriptor()
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.getSpecification()
focal_class.full_signature: @Override public DescriptorSpecification getSpecification()
focal_class.identifier: getSpecification
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: DescriptorSpecification
focal_class.signature: DescriptorSpecification getSpecification()
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.setParameters(Object[] params)
focal_class.full_signature: @Override public void setParameters(Object[] params)
focal_class.identifier: setParameters
focal_class.modifiers: @Override public
focal_class.parameters: (Object[] params)
focal_class.return: void
focal_class.signature: void setParameters(Object[] params)
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.getParameters()
focal_class.full_signature: @Override public Object[] getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Object[]
focal_class.signature: Object[] getParameters()
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.getDescriptorNames()
focal_class.full_signature: @Override public String[] getDescriptorNames()
focal_class.identifier: getDescriptorNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getDescriptorNames()
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.calculate(IAtom atom, IAtomContainer ac)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtom atom, IAtomContainer ac)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.getParameterNames()
focal_class.full_signature: @Override public String[] getParameterNames()
focal_class.identifier: getParameterNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getParameterNames()
focal_class.class_method_signature: EffectiveAtomPolarizabilityDescriptor.getParameterType(String name)
focal_class.full_signature: @Override public Object getParameterType(String name)
focal_class.identifier: getParameterType
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object getParameterType(String name)
focal_class.superclass: extends AbstractAtomicDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
          double polarizability;
          try {
              // FIXME: for now I'll cache a few modified atomic properties, and restore them at the end of this method
              String originalAtomtypeName = atom.getAtomTypeName();
              Integer originalNeighborCount = atom.getFormalNeighbourCount();
              Integer originalHCount = atom.getImplicitHydrogenCount();
              Integer originalValency = atom.getValency();
              IAtomType.Hybridization originalHybridization = atom.getHybridization();
              boolean originalFlag = atom.getFlag(CDKConstants.VISITED);
              Double originalBondOrderSum = atom.getBondOrderSum();
              Order originalMaxBondOrder = atom.getMaxBondOrder();
              polarizability = pol.calculateGHEffectiveAtomPolarizability(ac, atom, 100, true);
              // restore original props
              atom.setAtomTypeName(originalAtomtypeName);
              atom.setFormalNeighbourCount(originalNeighborCount);
              atom.setValency(originalValency);
              atom.setImplicitHydrogenCount(originalHCount);
              atom.setFlag(CDKConstants.VISITED, originalFlag);
              atom.setHybridization(originalHybridization);
              atom.setMaxBondOrder(originalMaxBondOrder);
              atom.setBondOrderSum(originalBondOrderSum);
              return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                      polarizability), getDescriptorNames());
          } catch (Exception ex1) {
              return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                      Double.NaN), getDescriptorNames(), ex1);
          }
      }
focal_method.class_method_signature: EffectiveAtomPolarizabilityDescriptor.calculate(IAtom atom, IAtomContainer ac)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtom atom, IAtomContainer ac)
focal_method.identifier: calculate
focal_method.invocations: getAtomTypeName getFormalNeighbourCount getImplicitHydrogenCount getValency getHybridization getFlag getBondOrderSum getMaxBondOrder calculateGHEffectiveAtomPolarizability setAtomTypeName setFormalNeighbourCount setValency setImplicitHydrogenCount setFlag setHybridization setMaxBondOrder setBondOrderSum getSpecification getParameterNames getParameters getDescriptorNames getSpecification getParameterNames getParameters getDescriptorNames
focal_method.modifiers: @Override public
focal_method.parameters: (IAtom atom, IAtomContainer ac)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtom atom, IAtomContainer ac)