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

Colinearity and PlanarityConstraint derivatives incorrect for exactly zero input values #50

Open
bbrelje opened this issue Oct 25, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@bbrelje
Copy link
Collaborator

bbrelje commented Oct 25, 2020

Description

The way the Colinearity and PlanarityConstraints compute derivatives causes incorrect / spurious nonzero derivative values to appear if inputs (e.g. points, axes) contain true zero values.

The problem is this line which appears in two places in DVConstraints
/(2.0*numpy.sqrt(tmpX[i]))

Steps to reproduce issue

Turn derivative checking back on in test_DVConstraints tests 9 and 13b. It is currently turned off in the baseline case because the derivatives will contain different values depending on whether pyspline is compiled using Intel or GCC (produces near-zero floats in different places which causes the derivatives to be different)

Proposed fix

Instead of checking whether tmpX is exactly zero, check if it is nearly zero to within some tol
Or deprecate these constraints if nobody is using them.

@bbrelje
Copy link
Collaborator Author

bbrelje commented Oct 27, 2020

Tests 9 and 13b currently fail finite difference checks

@ewu63 ewu63 added the bug Something isn't working label May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants