-
Notifications
You must be signed in to change notification settings - Fork 20
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
Modernize the tests #40
Modernize the tests #40
Conversation
Thanks for working on this! |
updated missing intents in fcn_lmstr interface
…est-refactoring
added save attribute to TEMP: Fixes fortran-lang#7
see fortran-lang#39 still need to do the others
replaced the files with modules see fortran-lang#39
Note: this refactor is coming along slowly but surely. I've now also got a script that pulls down and compiles the original minpack code with the original test cases. I'm going to use that as an initial cut to address #32 (i.e., just make sure we get the same answers as before...although due to bug fixes maybe some will be different). |
Summarytest_hybrjAll results identical except for the following (which fail in both original and new version): Original:
New:
note: these differences are all due to the slightly different values of dpmpar from the intrinsics, compared to the old hard-coded values, which were not full double precision test_hybrdVery small differences in almost all the cases. The only appreciable difference (in a failed case) is: Old:
New:
note: these differences are all due to the slightly different values of test_lmderAll cases identical. test_lmstrAll cases identical, except for one where the original case results in an NaN: Old:
New:
TODO: look into this one... this one does not appear to be caused by dpmpar test_lmdifMostly identical, with some very small differences in some cases. note: these differences are all due to the slightly different values of dpmpar from the intrinsics, compared to the old hard-coded values, which were not full double precision test_chkderAll cases identical, except for two with very small differences. note: these differences are all due to the slightly different values of dpmpar from the intrinsics, compared to the old hard-coded values, which were not full double precision |
OK, except for that one NaN issues in |
Next step is adding the "truth" values to the tests so they are checked in the CI. Probably with some tolerance? |
eliminated all lines numbers in tests.
test tol=1e-4
…est-refactoring
I think this is ready to merge. This is just an initial version of some checks. What this is doing is checking that the results are the same as the original minpack (to within some tolerance). The code does seem to be somewhat sensitive to different compilers and settings. The There is more that can be done here, but I think this is a good start, just to get something in master than is checking the results. We can add to it over time. |
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 vecfcn
, vecjac
, initpt
functions are duplicated for each test, it would be better to define them in a single module and use them for all tests, this way further refactoring doesn't need to change test files again.
Yes, agree. There are other duplications (e.g., the constants). We can move them all into a separate module. I basically wanted to get it working with the "minimal" number of changes first, then we can do this type of stuff. So, we can add it to the MR or just do it later in a subsequent one. |
Yes, we can just fix up the most obvious things that were added in this PR. If things were not ideal already in the original code, I think it's better to fix it up in subsequent PRs. What is the logic behind |
See #57 |
changed the tests to nested ifs, so the inner ones aren't computed if the outer ones fail.
Codecov Report
@@ Coverage Diff @@
## main #40 +/- ##
==========================================
+ Coverage 88.11% 88.77% +0.66%
==========================================
Files 2 2
Lines 1220 1221 +1
Branches 459 456 -3
==========================================
+ Hits 1075 1084 +9
Misses 40 40
+ Partials 105 97 -8
Continue to review full report at Codecov.
|
OK to merge? [Will address the code duplication issues in #61] |
…est-refactoring
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.
Thanks, looks good to me. Also fixes the runtime error with NAG.
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.
I think it's fine to merge.
work in progress..
Closes #39
Closes #32
Closes #21
Closes #7
Closes #6