OpenMDAO / OpenMDAO/OpenMDAO

Add Zero Tolerance to Check Partials for Relative Error Checks

Open
#3,164 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
782
Forks
314
Avg merge
4d 21h
Merged PRs (30d)
4

Description

Desired capability or behavior.

In some cases, derivatives are very close to 0. This can cause relative error checks to fail. It may be worth to adding a parameter zero_tol to the check_partials call that rounds the calc mag to zero if it is bellow this tolerance before comparing it to the check mag.

-------------------------------------------------------------------------------------------------------
Component: Comp 'comp'
-------------------------------------------------------------------------------------------------------
'<output>'       wrt '<variable>'        | calc mag.  | check mag. | a(cal-chk) | r(cal-chk)
--------------------------------------------------------------------------------------------

'a' wrt 'b'  | 1.4410e-17 | 0.0000e+00 | 1.4410e-17 | 1.0000e+00 >REL_TOL
Associated POEM

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python implementation of check_partials and any tests covering relative error checks. Confirm how calculated and checked magnitudes are compared, then add coverage for derivatives near zero and verify that the requested zero_tol behavior is exercised.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.