Navigation Menu

Skip to content

Commit

Permalink
Use american spelling of flavour.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Aug 24, 2016
1 parent 1906a87 commit cae0258
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 109 deletions.
Expand Up @@ -94,7 +94,7 @@ final class CDKToBeam {

/** Create a isomeric and aromatic converter. */
CDKToBeam() {
this(SmiFlavour.AtomicMass | SmiFlavour.AtomAtomMap | SmiFlavour.UseAromaticSymbols);
this(SmiFlavor.AtomicMass | SmiFlavor.AtomAtomMap | SmiFlavor.UseAromaticSymbols);
}

CDKToBeam(int flavour) {
Expand Down Expand Up @@ -144,15 +144,15 @@ static Graph toBeamGraph(IAtomContainer ac, int flavour) throws CDKException {
}

// configure stereo-chemistry by encoding the stereo-elements
if (SmiFlavour.isSet(flavour, SmiFlavour.Stereo)) {
if (SmiFlavor.isSet(flavour, SmiFlavor.Stereo)) {
for (IStereoElement se : ac.stereoElements()) {
if (SmiFlavour.isSet(flavour, SmiFlavour.StereoTetrahedral) &&
if (SmiFlavor.isSet(flavour, SmiFlavor.StereoTetrahedral) &&
se instanceof ITetrahedralChirality) {
addTetrahedralConfiguration((ITetrahedralChirality) se, gb, indices);
} else if (SmiFlavour.isSet(flavour, SmiFlavour.StereoCisTrans) &&
} else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoCisTrans) &&
se instanceof IDoubleBondStereochemistry) {
addGeometricConfiguration((IDoubleBondStereochemistry) se, flavour, gb, indices);
} else if (SmiFlavour.isSet(flavour, SmiFlavour.StereoExTetrahedral) &&
} else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoExTetrahedral) &&
se instanceof ExtendedTetrahedral) {
addExtendedTetrahedralConfiguration((ExtendedTetrahedral) se, gb, indices);
}
Expand All @@ -175,7 +175,7 @@ static Graph toBeamGraph(IAtomContainer ac, int flavour) throws CDKException {
*/
static Atom toBeamAtom(final IAtom a, final int flavour) {

final boolean aromatic = SmiFlavour.isSet(flavour, SmiFlavour.UseAromaticSymbols) && a.getFlag(CDKConstants.ISAROMATIC);
final boolean aromatic = SmiFlavor.isSet(flavour, SmiFlavor.UseAromaticSymbols) && a.getFlag(CDKConstants.ISAROMATIC);
final Integer charge = a.getFormalCharge();
final String symbol = checkNotNull(a.getSymbol(), "An atom had an undefined symbol");

Expand All @@ -195,7 +195,7 @@ static Atom toBeamAtom(final IAtom a, final int flavour) {
if (charge != null) ab.charge(charge);

// use the mass number to specify isotope?
if (SmiFlavour.isSet(flavour, SmiFlavour.AtomicMass)) {
if (SmiFlavor.isSet(flavour, SmiFlavor.AtomicMass)) {
Integer massNumber = a.getMassNumber();
if (massNumber != null) {
// XXX: likely causing some overhead but okay for now
Expand All @@ -210,7 +210,7 @@ static Atom toBeamAtom(final IAtom a, final int flavour) {
}

Integer atomClass = a.getProperty(ATOM_ATOM_MAPPING);
if (SmiFlavour.isSet(flavour, SmiFlavour.AtomAtomMap) && atomClass != null) {
if (SmiFlavor.isSet(flavour, SmiFlavor.AtomAtomMap) && atomClass != null) {
ab.atomClass(atomClass);
}

Expand Down Expand Up @@ -248,7 +248,7 @@ static Edge toBeamEdge(IBond b, int flavour, Map<IAtom, Integer> indices) throws
*/
private static Bond toBeamEdgeLabel(IBond b, int flavour) throws CDKException {

if (SmiFlavour.isSet(flavour, SmiFlavour.UseAromaticSymbols) && b.getFlag(CDKConstants.ISAROMATIC)) return Bond.AROMATIC;
if (SmiFlavor.isSet(flavour, SmiFlavor.UseAromaticSymbols) && b.getFlag(CDKConstants.ISAROMATIC)) return Bond.AROMATIC;

if (b.getOrder() == null) throw new CDKException("A bond had undefined order, possible query bond?");

Expand All @@ -264,7 +264,7 @@ private static Bond toBeamEdgeLabel(IBond b, int flavour) throws CDKException {
case QUADRUPLE:
return Bond.QUADRUPLE;
default:
if (!SmiFlavour.isSet(flavour, SmiFlavour.UseAromaticSymbols) && b.getFlag(CDKConstants.ISAROMATIC))
if (!SmiFlavor.isSet(flavour, SmiFlavor.UseAromaticSymbols) && b.getFlag(CDKConstants.ISAROMATIC))
throw new CDKException("Cannot write Kekulé SMILES output due to aromatic bond with unset bond order - molecule should be Kekulized");
throw new CDKException("Unsupported bond order: " + order);
}
Expand All @@ -283,7 +283,7 @@ private static void addGeometricConfiguration(IDoubleBondStereochemistry dbs, in
IBond[] bs = dbs.getBonds();

// don't try to set a configuration on aromatic bonds
if (SmiFlavour.isSet(flavour, SmiFlavour.UseAromaticSymbols) && db.getFlag(CDKConstants.ISAROMATIC)) return;
if (SmiFlavor.isSet(flavour, SmiFlavor.UseAromaticSymbols) && db.getFlag(CDKConstants.ISAROMATIC)) return;

int u = indices.get(db.getAtom(0));
int v = indices.get(db.getAtom(1));
Expand Down
Expand Up @@ -70,7 +70,7 @@ private static int compare(Comparator<Integer> comp, List<Integer> a, List<Integ

static String generate(CxSmilesState state, int opts, int[] components, final int[] ordering) {

if (!SmiFlavour.isSet(opts, SmiFlavour.CxSmilesWithCoords))
if (!SmiFlavor.isSet(opts, SmiFlavor.CxSmilesWithCoords))
return "";

final int[] invorder = inverse(ordering);
Expand All @@ -93,7 +93,7 @@ public int compare(Integer a, Integer b) {
};

// Fragment Grouping
if (SmiFlavour.isSet(opts, SmiFlavour.CxFragmentGroup) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxFragmentGroup) &&
state.fragGroups != null && !state.fragGroups.isEmpty()) {

int maxCompId = 0;
Expand Down Expand Up @@ -141,7 +141,7 @@ public int compare(List<Integer> a, List<Integer> b) {
}

// Atom Labels
if (SmiFlavour.isSet(opts, SmiFlavour.CxAtomLabel) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxAtomLabel) &&
state.atomLabels != null && !state.atomLabels.isEmpty()) {

if (sb.length() > 2)
Expand All @@ -162,7 +162,7 @@ public int compare(List<Integer> a, List<Integer> b) {
}

// Atom Values
if (SmiFlavour.isSet(opts, SmiFlavour.CxAtomValue) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxAtomValue) &&
state.atomValues != null && !state.atomValues.isEmpty()) {

if (sb.length() > 2)
Expand All @@ -183,7 +183,7 @@ public int compare(List<Integer> a, List<Integer> b) {
}

// 2D/3D Coordinates
if (SmiFlavour.isSet(opts, SmiFlavour.CxCoordinates) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxCoordinates) &&
state.atomCoords != null && !state.atomCoords.isEmpty()) {
DecimalFormat fmt = new DecimalFormat("#.##");
if (sb.length() > 2) sb.append(',');
Expand All @@ -204,7 +204,7 @@ public int compare(List<Integer> a, List<Integer> b) {
}

// Multicenter/Positional variation bonds
if (SmiFlavour.isSet(opts, SmiFlavour.CxMulticenter) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxMulticenter) &&
state.positionVar != null && !state.positionVar.isEmpty()) {

if (sb.length() > 2) sb.append(',');
Expand Down Expand Up @@ -237,7 +237,7 @@ public int compare(Map.Entry<Integer, List<Integer>> a,


// *CCO* |$_AP1;;;;_AP2$,Sg:n:1,2,3::ht|
if (SmiFlavour.isSet(opts, SmiFlavour.CxPolymer) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxPolymer) &&
state.sgroups != null && !state.sgroups.isEmpty()) {
List<PolymerSgroup> sgroups = new ArrayList<>(state.sgroups);

Expand Down Expand Up @@ -270,7 +270,7 @@ public int compare(PolymerSgroup a, PolymerSgroup b) {
}

// [C]1[CH][CH]CCC1 |^1:1,2,^3:0|
if (SmiFlavour.isSet(opts, SmiFlavour.CxRadical) &&
if (SmiFlavor.isSet(opts, SmiFlavor.CxRadical) &&
state.atomRads != null && !state.atomRads.isEmpty()) {
Map<CxSmilesState.Radical, List<Integer>> radinv = new TreeMap<>();
for (Map.Entry<Integer, CxSmilesState.Radical> e : state.atomRads.entrySet()) {
Expand Down
Expand Up @@ -30,9 +30,9 @@
/**
* Flags for customising SMILES generation.
*/
public final class SmiFlavour {
public final class SmiFlavor {

private SmiFlavour() {
private SmiFlavor() {
}

/**
Expand Down

0 comments on commit cae0258

Please sign in to comment.