Skip to content

Commit

Permalink
Adjustments according to review comments;
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchaub committed Jun 19, 2023
1 parent cac4cdf commit 1c5b656
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1126,11 +1126,11 @@ private Double[] calculateBarSpacing(int aNumberOfDisplayedFragments, BarWidthOp
double tmpGapDeviation;
double tmpGapSpacing;
double tmpCategoryGap;
double tmpFinalHistogramHeight = 0;
double tmpFinalHistogramHeight = 0.0; //return value is initialised here with a default value

This comment has been minimized.

Copy link
@FelixBaensch

FelixBaensch Jun 19, 2023

Owner

Okay, that is fine for me.
But one could argue that the 0.0 is by default the default value, and you don't have to initialize it explicitly.

This comment has been minimized.

Copy link
@JonasSchaub

JonasSchaub Jun 19, 2023

Author Collaborator

If I don't initialise it here, the compiler complains 🤷‍♂️

double tmpFinalGapSpacing;
switch (aBarWidthOptionConstant) {
case SMALL:
if (aNumberOfDisplayedFragments <= 24) {
if (aNumberOfDisplayedFragments <= 24) { //magic number
tmpCurrentHistogramHeight = GuiDefinitions.GUI_NOT_SCROLLABLE_HEIGHT / aNumberOfDisplayedFragments;
tmpGapDeviation = tmpCurrentHistogramHeight / (GuiDefinitions.GUI_NOT_SCROLLABLE_HEIGHT / 24);
tmpGapSpacing = HistogramViewController.GUI_HISTOGRAM_SMALL_BAR_GAP_CONST * tmpGapDeviation;
Expand All @@ -1144,7 +1144,7 @@ private Double[] calculateBarSpacing(int aNumberOfDisplayedFragments, BarWidthOp
}
break;
case MEDIUM:
if (aNumberOfDisplayedFragments <= 17) {
if (aNumberOfDisplayedFragments <= 17) { //magic number
tmpCurrentHistogramHeight = GuiDefinitions.GUI_NOT_SCROLLABLE_HEIGHT / aNumberOfDisplayedFragments;
tmpGapDeviation = tmpCurrentHistogramHeight / (GuiDefinitions.GUI_NOT_SCROLLABLE_HEIGHT / 17);
tmpGapSpacing = HistogramViewController.GUI_HISTOGRAM_MEDIUM_BAR_GAP_CONST * tmpGapDeviation;
Expand All @@ -1159,7 +1159,7 @@ private Double[] calculateBarSpacing(int aNumberOfDisplayedFragments, BarWidthOp
break;
case LARGE:
default:
if (aNumberOfDisplayedFragments <= 13) {
if (aNumberOfDisplayedFragments <= 13) { //magic number
tmpCurrentHistogramHeight = GuiDefinitions.GUI_NOT_SCROLLABLE_HEIGHT / aNumberOfDisplayedFragments;
tmpGapDeviation = tmpCurrentHistogramHeight / (GuiDefinitions.GUI_NOT_SCROLLABLE_HEIGHT / 13);
tmpGapSpacing = HistogramViewController.GUI_HISTOGRAM_LARGE_BAR_GAP_CONST * tmpGapDeviation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ public IAtomContainer getAtomContainer() throws CDKException {
try{
tmpAtomContainer = ChemUtil.parseSmilesToAtomContainer(this.uniqueSmiles, true, true);
} catch (CDKException aCdkException){
//TODO: log this? It blows up the log file quite a bit
//Logger.getLogger(MoleculeDataModel.class.getName()).log(Level.WARNING, "atom container parsed from SMILES "
// + this.uniqueSmiles + " could not be kekulized or atom types assigned to it.", aCdkException);
//no logging, this happens too often, e.g. for fragments of aromatic rings
tmpAtomContainer = ChemUtil.parseSmilesToAtomContainer(this.uniqueSmiles, false, false);
}
tmpAtomContainer.addProperties(this.properties);
Expand Down

0 comments on commit 1c5b656

Please sign in to comment.