Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong documentation for exceptions in StatUtils and add missing #207

Closed
wants to merge 1 commit into from
Closed

Fix wrong documentation for exceptions in StatUtils and add missing #207

wants to merge 1 commit into from

Conversation

dvmarcilio
Copy link

Hello! I found that a couple of methods in StatUtils were wrongly documenting in javadoc to throw MathIllegalArgumentException for null arrays, instead of NullArgumentException.
I took the opportunity to add documentation and tests for NotPositiveException for mode(double[], int, int).

As I mentioned in #206, I'm happy to submit more pull requests with similar fixes/additions to the documentation if it's something welcomed by the project.


On another note, I found a few methods on Variance (called by StatUtils) that will throw NullPointerException (null dereference), instead of NullArgumentException. I'm also happy to submit a pull request fixing those. The fix is very easy but will entail other documentation modifications, and likely some test changes/additions.

public double evaluate(final double[] values, final double[] weights)
throws MathIllegalArgumentException {
return evaluate(values, weights, 0, values.length);
}

public double evaluate(final double[] values, final double mean) throws MathIllegalArgumentException {
return evaluate(values, mean, 0, values.length);
}

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant