On Wed, Oct 28, 2009 at 5:42 PM, Egon Willighagen
<
egon.willighagen@...> wrote:
> On Wed, Oct 28, 2009 at 5:55 PM, Rajarshi Guha <
rajarshi.guha@...> wrote:
>>
>>
>> On Wed, Oct 28, 2009 at 11:41 AM, Stefan Kuhn <
stefan.kuhn@...> wrote:
>>>
>>> Hi all,
>>> I just had a look at descriptors and saw that those which need 3d throw an
>>> excpetion if no 3d exists. Only PetitjeanShapeIndexDescriptor return NaN
>>> in
>>> that case. Is that intended? I would think it should be uniform.
>>
>> I agreeĀ - rather than throwing an exception, NaN should be returned
>
> NaN was agreed upon in the past. The NaN is there to always get a
> matrix returned and relieving the user from manually correcting for
> NaNs in creating the matrix... there are various reasons why the NaN
> occurs, and the Exception may have to be extended to multiple NaNs in
> the matrix... the user would have to manually do that...
>
> Did we not add a mechanism for passing the reason of the NaN? If not,
> perhaps we should do that...
This mechanism already exists. This is code from the XLogP descriptor,
and the DescriptorValue (optionally) takes an Exception:
return new DescriptorValue(getSpecification(), getParameterNames(),
getParameters(), new DoubleResult(Double.NaN),
getDescriptorNames(), exception
);
You can wrap any error message with:
exception = new CDKException("Reason");
Summary:
IDescriptors must return NaN and are encouraged to give the reason of
failure as part of the DescriptorValue for the using code to digest.
Egon
--
Post-doc @ Uppsala University
Homepage:
http://egonw.github.com/Blog:
http://chem-bla-ics.blogspot.com/PubList:
http://www.citeulike.org/user/egonw/tag/papers------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference_______________________________________________
Cdk-devel mailing list
Cdk-devel@...
https://lists.sourceforge.net/lists/listinfo/cdk-devel