Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Sanitize results and replace Infinity with NaN
  • Loading branch information
olas committed Jul 10, 2012
1 parent b2621b6 commit 1446778
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -1274,6 +1274,22 @@ public Map<IMolecule, List<IDescriptorResult>> doCalculation(
}

}

//Sanitize results, e.g. replace Infinity with NA
for (IMolecule mol : allResults.keySet()){
List<IDescriptorResult> lres = allResults.get(mol);
for (IDescriptorResult dr : lres){
Float[] values = dr.getValues();
for (int i=0; i< values.length; i++){
Float value = values[i];
System.out.println(value);
if (value.isInfinite()){
values[i]=Float.NaN;
dr.setValues(values);
}
}
}
}

return allResults;

Expand Down

0 comments on commit 1446778

Please sign in to comment.