RFC= request for comments

Hi all,

what is the hydrogen count when I type:

IAtom atom = new IAtom("C");

or, what happens when I have an atom container with 5 atoms, and I set the 
H-count for only one of them. Are the values zero for the other four then?

The JavaDoc is not helpful here, though non-native fields simply default to 
null. I tended to say that if a property is not explicitly set, it is 
undefined, which matches the 'null' nicely. Native fields (int, double, etc) 
do not have a null concept, and some work by Rajarshi yesterday addressed 
this by explicitly stating a field was UNSET, by using Integer.MIN_VALUE and 
Double.NaN.

This broke about 300 JUnit tests.

However, too many algorithms (atom typing, canonical labeler, to name some) 
*do* expect a 0 default. For example, expect the above carbon to have zero 
formal charge, and zero implicit hydrogens. But I am sure that other 
algorithms expect something else.

I made a brief attempt to fix some code here and there to deal with unset 
values, but I never had any chance... and I had to revert the changes and 
make formalCharge and hydrogenCount now explicitly default to zero. 

So, very importantly: what *are* the default values for all non-native fields 
in the interfaces?! This needs to be defined *and* clearly stated in the API.
And if we go the UNSET route, this will require a whole lot of implementation 
fixing!

Egon

-- 
CUBIC
blog: http://chem-bla-ics.blogspot.com/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to