-
Notifications
You must be signed in to change notification settings - Fork 254
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
Use backward difference for check options on structured mm with slinear. #2195
Conversation
@@ -176,6 +176,11 @@ def _setup_partials(self): | |||
if self.options['method'].startswith('scipy'): | |||
self.set_check_partial_options('*', method='fd') | |||
|
|||
# Our bracketing album picks the bin behind it if you are interpolating exactly on one of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'bracketing album'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, should be algorithm
@@ -1126,10 +1126,36 @@ def test_analysis_error_warning_msg(self): | |||
p.set_val('x', 0.75) | |||
|
|||
msg = "Analysis Error: 'interp' <class MetaModelStructuredComp> " \ | |||
"Line 205 of file {}".format(inspect.getsourcefile(om.MetaModelStructuredComp)) | |||
"Line 210 of file {}".format(inspect.getsourcefile(om.MetaModelStructuredComp)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to rewrite this check so it isn't so fragile. Adding a line to MetaModelStructuredComp.py shouldn't break this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fault is the exception message actually, but to make the test more robust, I've added the capability to the assert_warning
to optionally check if the warning contains the msg rather than check equality.
Summary
Use backward difference for check options on structured mm when the method is slinear.
This is to avoid confusion when checking partials on this component. Since bracketing looks left and forward difference checks look right, check derivatives would report an erroneous derivative if you tried to interpolate on a grid point.
Related Issues
Backwards incompatibilities
None
New Dependencies
None