Add Zero Tolerance to Check Partials for Relative Error Checks
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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