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

DVConstraints evalFunctions inconsistent passing of references + values #48

Open
bbrelje opened this issue Oct 25, 2020 · 1 comment
Open

Comments

@bbrelje
Copy link
Collaborator

bbrelje commented Oct 25, 2020

Description

When evalFunctions and evalFunctionsSens is called for each type of constraint, one of two things happens. Either a fresh set of values is returned back to the dict() with all the constraints in it, or a reference to an existing array (which may have been present at previous iterations).

For example, the ThicknessConstraint always passes a reference to a FRESH array of values, whereas the CircularityConstraint passes a reference to the same array each time. If the dict() is manipulated outside, it can affect the internal values. Alternatively, a user may inadvertently save a result from a previous iteration without realizing it's a live reference which can be changed later on. I discovered this will writing reg tests for the circularity constraint.

Should probably be made consistent but this may produce breaking behavior in very few edge cases where people are relying on the current reference behavior.

Code versions

List versions only if relevant

  • Python
@ewu63
Copy link
Collaborator

ewu63 commented Oct 26, 2020

I think this is probably worthwhile bringing up for discussion, and if everyone is on board we should absolutely make this consistent and documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants