Skip to content

Commit

Permalink
Renamed the atom typer method to say ...Type*s*
Browse files Browse the repository at this point in the history
Change-Id: I52ca640e89c7a5b00728798d6619adeedf2ebd90
Signed-off-by: John May <john.wilkinsonmay@gmail.com>
  • Loading branch information
egonw authored and johnmay committed Sep 26, 2013
1 parent 5bde50a commit a9f35c6
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
Expand Up @@ -92,7 +92,7 @@ public static CDKAtomTypeMatcher getInstance(IChemObjectBuilder builder, int mod
}

@TestMethod("testFindMatchingAtomType_IAtomContainer")
public IAtomType[] findMatchingAtomType(IAtomContainer atomContainer) throws CDKException {
public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer) throws CDKException {
IAtomType[] types = new IAtomType[atomContainer.getAtomCount()];
int typeCounter = 0;
for (IAtom atom : atomContainer.atoms()) {
Expand Down
Expand Up @@ -56,7 +56,7 @@ public void setRingSet(IRingSet rs)
}

@TestMethod("testFindMatchingAtomType_IAtomContainer")
public IAtomType[] findMatchingAtomType(IAtomContainer atomContainer) throws CDKException {
public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer) throws CDKException {
IAtomType[] types = new IAtomType[atomContainer.getAtomCount()];
int typeCounter = 0;
for (IAtom atom : atomContainer.atoms()) {
Expand Down
Expand Up @@ -59,6 +59,6 @@ public interface IAtomTypeMatcher {
* @throws CDKException when something went wrong with going through
* the AtomType's
*/
public IAtomType[] findMatchingAtomType(IAtomContainer container) throws CDKException;
public IAtomType[] findMatchingAtomTypes(IAtomContainer container) throws CDKException;

}
Expand Up @@ -82,7 +82,7 @@ private String getSphericalMatcher(String type) throws CDKException {//NOPMD
}

@TestMethod("testFindMatchingAtomType_IAtomContainer")
public IAtomType[] findMatchingAtomType(IAtomContainer atomContainer) throws CDKException {
public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer) throws CDKException {
IAtomType[] types = new IAtomType[atomContainer.getAtomCount()];
int typeCounter = 0;
for (IAtom atom : atomContainer.atoms()) {
Expand Down
Expand Up @@ -86,7 +86,7 @@ private String getSphericalMatcher(String type) throws CDKException {//NOPMD
}

@TestMethod("testFindMatchingAtomType_IAtomContainer")
public IAtomType[] findMatchingAtomType(IAtomContainer atomContainer) throws CDKException {
public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer) throws CDKException {
IAtomType[] types = new IAtomType[atomContainer.getAtomCount()];
int typeCounter = 0;
for (IAtom atom : atomContainer.atoms()) {
Expand Down
Expand Up @@ -57,7 +57,7 @@ public StructGenMatcher() {
}

@TestMethod("testFindMatchingAtomType_IAtomContainer")
public IAtomType[] findMatchingAtomType(IAtomContainer atomContainer) throws CDKException {
public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer) throws CDKException {
IAtomType[] types = new IAtomType[atomContainer.getAtomCount()];
int typeCounter = 0;
for (IAtom atom : atomContainer.atoms()) {
Expand Down
Expand Up @@ -74,7 +74,7 @@ public static SybylAtomTypeMatcher getInstance(IChemObjectBuilder builder) {
}

@TestMethod("testFindMatchingAtomType_IAtomContainer")
public IAtomType[] findMatchingAtomType(IAtomContainer atomContainer) throws CDKException {
public IAtomType[] findMatchingAtomTypes(IAtomContainer atomContainer) throws CDKException {
for (IAtom atom : atomContainer.atoms()) {
IAtomType type = cdkMatcher.findMatchingAtomType(atomContainer, atom);
atom.setAtomTypeName(type == null ? null : type.getAtomTypeName());
Expand Down
Expand Up @@ -131,8 +131,8 @@ public class CDKAtomTypeMatcherFilesTest extends AbstractCDKAtomTypeTest {
IAtomContainer mol2 = ChemFileManipulator
.getAllAtomContainers(chemFile).get(0);

IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types2 = atomTypeMatcher.findMatchingAtomType(mol2);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
IAtomType[] types2 = atomTypeMatcher.findMatchingAtomTypes(mol2);
for (int i=0; i<mol1.getAtomCount(); i++) {
Assert.assertNotNull(
"Atom typing in mol1 failed for atom " + (i+1),
Expand Down
Expand Up @@ -60,8 +60,8 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
Assert.assertEquals(mol1.getAtomCount(), mol2.getAtomCount());
Assert.assertEquals(mol1.getBondCount(), mol2.getBondCount());

IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types2 = atomTypeMatcher.findMatchingAtomType(mol2);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
IAtomType[] types2 = atomTypeMatcher.findMatchingAtomTypes(mol2);
for (int i=0; i<mol1.getAtomCount(); i++) {
Assert.assertEquals(
types1[i].getAtomTypeName(),
Expand All @@ -77,7 +77,7 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {

Assert.assertEquals(9, mol1.getAtomCount());

IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
for (IAtomType type : types1) {
Assert.assertNotNull(type.getAtomTypeName());
}
Expand All @@ -90,7 +90,7 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {

Assert.assertEquals(9, mol1.getAtomCount());

IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
for (IAtomType type : types1) {
Assert.assertNotNull(type.getAtomTypeName());
}
Expand All @@ -104,7 +104,7 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
IAtomContainer mol1 = smilesParser.parseSmiles(smiles1);

Assert.assertEquals(8, mol1.getAtomCount());
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
for (IAtomType type : types1) {
Assert.assertNotNull(type.getAtomTypeName());
}
Expand All @@ -123,8 +123,8 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
Assert.assertEquals(mol1.getAtomCount(), mol2.getAtomCount());
Assert.assertEquals(mol1.getBondCount(), mol2.getBondCount());

IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types2 = atomTypeMatcher.findMatchingAtomType(mol2);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
IAtomType[] types2 = atomTypeMatcher.findMatchingAtomTypes(mol2);
for (int i=0; i<mol1.getAtomCount(); i++) {
Assert.assertEquals(
types1[i].getAtomTypeName(),
Expand All @@ -144,7 +144,7 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
"(N2C=NC=1C(N)=NC=NC=12)C([H])(O)C3([H])(O)).[Co+3]";

IAtomContainer mol1 = smilesParser.parseSmiles(smiles1);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomType(mol1);
IAtomType[] types1 = atomTypeMatcher.findMatchingAtomTypes(mol1);
for (IAtomType type : types1) {
Assert.assertNotNull(type.getAtomTypeName());
}
Expand Down Expand Up @@ -177,7 +177,7 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
String smiles = "CCCN1CC(CSC)CC2C1Cc3c[nH]c4cccc2c34";

IAtomContainer mol = smilesParser.parseSmiles(smiles);
IAtomType[] types = atomTypeMatcher.findMatchingAtomType(mol);
IAtomType[] types = atomTypeMatcher.findMatchingAtomTypes(mol);
for (IAtomType type : types) {
Assert.assertNotNull(type.getAtomTypeName());
}
Expand All @@ -187,7 +187,7 @@ public class CDKAtomTypeMatcherSMILESTest extends AbstractCDKAtomTypeTest {
String smiles = "Br.Br.CS(CCC(N)C#N)C[C@H]1OC([C@H](O)[C@@H]1O)n2cnc3c(N)ncnc23";

IAtomContainer mol = smilesParser.parseSmiles(smiles);
IAtomType[] types = atomTypeMatcher.findMatchingAtomType(mol);
IAtomType[] types = atomTypeMatcher.findMatchingAtomTypes(mol);
for (IAtomType type : types) {
Assert.assertNotNull(type.getAtomTypeName());
}
Expand Down
Expand Up @@ -100,7 +100,7 @@ public class CDKAtomTypeMatcherTest extends AbstractCDKAtomTypeTest {
// just check consistency; other methods do perception testing
CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(
DefaultChemObjectBuilder.getInstance());
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
IAtomType type = matcher.findMatchingAtomType(mol, mol.getAtom(i));
Assert.assertEquals(type.getAtomTypeName(), types[i].getAtomTypeName());
Expand Down
Expand Up @@ -87,7 +87,7 @@ private boolean testAtom(String expectedAtType, IAtom atom)
mol.addAtom(atom);

// just check consistency; other methods do perception testing
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
IAtomType type = matcher.findMatchingAtomType(mol, mol.getAtom(i));
Assert.assertEquals(type.getAtomTypeName(), types[i].getAtomTypeName());
Expand Down
Expand Up @@ -92,7 +92,7 @@ public class MM2AtomTypeMatcherTest extends AbstractAtomTypeTest {

// just check consistency; other methods do perception testing
MM2AtomTypeMatcher matcher = new MM2AtomTypeMatcher();
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
IAtomType type = matcher.findMatchingAtomType(mol, mol.getAtom(i));
Assert.assertEquals(type.getAtomTypeName(), types[i].getAtomTypeName());
Expand Down
Expand Up @@ -98,7 +98,7 @@ public class MMFF94AtomTypeMatcherTest extends AbstractAtomTypeTest {

// just check consistency; other methods do perception testing
MMFF94AtomTypeMatcher matcher = new MMFF94AtomTypeMatcher();
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
IAtomType type = matcher.findMatchingAtomType(mol, mol.getAtom(i));
Assert.assertEquals(type.getAtomTypeName(), types[i].getAtomTypeName());
Expand Down
Expand Up @@ -94,19 +94,19 @@ public class RepeatedCDKAtomTypeMatcherSMILESTest extends CDKTestCase {

private void typeAndRetype(String smiles) throws Exception {
IAtomContainer mol = smilesParser.parseSmiles(smiles);
IAtomType[] types = atomTypeMatcher.findMatchingAtomType(mol);
IAtomType[] types = atomTypeMatcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
AtomTypeManipulator.configure(mol.getAtom(i), types[i]);
}
IAtomType[] retyped = atomTypeMatcher.findMatchingAtomType(mol);
IAtomType[] retyped = atomTypeMatcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
Assert.assertEquals(
"First perception resulted in " + types[i] + " but the second perception " +
"gave " + retyped[i],
types[i], retyped[i]
);
}
retyped = atomTypeMatcher.findMatchingAtomType(mol);
retyped = atomTypeMatcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
Assert.assertEquals(
"First perception resulted in " + types[i] + " but the third perception " +
Expand Down
Expand Up @@ -80,7 +80,7 @@ public IAtomTypeMatcher getAtomTypeMatcher(IChemObjectBuilder builder) {

// just check consistency; other methods do perception testing
StructGenMatcher matcher = new StructGenMatcher();
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
IAtomType type = matcher.findMatchingAtomType(mol, mol.getAtom(i));
Assert.assertNotNull(type);
Expand Down
Expand Up @@ -95,7 +95,7 @@ public class SybylAtomTypeMatcherTest extends AbstractSybylAtomTypeTest {
// just check consistency; other methods do perception testing
SybylAtomTypeMatcher matcher = SybylAtomTypeMatcher.getInstance(
DefaultChemObjectBuilder.getInstance());
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<types.length; i++) {
IAtomType type = matcher.findMatchingAtomType(mol, mol.getAtom(i));
Assert.assertEquals(type.getAtomTypeName(), types[i].getAtomTypeName());
Expand Down Expand Up @@ -132,7 +132,7 @@ public class SybylAtomTypeMatcherTest extends AbstractSybylAtomTypeTest {

// test if the perceived atom types match that
SybylAtomTypeMatcher matcher = SybylAtomTypeMatcher.getInstance(benzene.getBuilder());
IAtomType[] types = matcher.findMatchingAtomType(benzene);
IAtomType[] types = matcher.findMatchingAtomTypes(benzene);
for (IAtomType type : types) {
Assert.assertEquals("C.ar", type.getAtomTypeName());
}
Expand All @@ -144,7 +144,7 @@ public class SybylAtomTypeMatcherTest extends AbstractSybylAtomTypeTest {
"N.ar", "N.3", "C.ar", "C.ar"
};
SybylAtomTypeMatcher matcher = SybylAtomTypeMatcher.getInstance(mol.getBuilder());
IAtomType[] types = matcher.findMatchingAtomType(mol);
IAtomType[] types = matcher.findMatchingAtomTypes(mol);
for (int i=0; i<expectedTypes.length; i++) {
assertAtomType(testedAtomTypes,
"Incorrect perception for atom " + i,
Expand All @@ -161,7 +161,7 @@ public class SybylAtomTypeMatcherTest extends AbstractSybylAtomTypeTest {

// test if the perceived atom types match that
SybylAtomTypeMatcher matcher = SybylAtomTypeMatcher.getInstance(benzene.getBuilder());
IAtomType[] types = matcher.findMatchingAtomType(benzene);
IAtomType[] types = matcher.findMatchingAtomTypes(benzene);
for (IAtomType type : types) {
Assert.assertEquals("C.ar", type.getAtomTypeName());
}
Expand Down Expand Up @@ -634,7 +634,7 @@ private void percieveAtomTypesAndConfigureAtoms(IAtomContainer container) throws

// test if the perceived atom types match that
SybylAtomTypeMatcher matcher = SybylAtomTypeMatcher.getInstance(benzene.getBuilder());
IAtomType[] types = matcher.findMatchingAtomType(benzene);
IAtomType[] types = matcher.findMatchingAtomTypes(benzene);
for (int i=0; i<6; i++) {
assertAtomType(testedAtomTypes,
"Incorrect perception for atom " + i,
Expand Down

0 comments on commit a9f35c6

Please sign in to comment.