-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
#1886 added fix within processed variable #1894
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1894 +/- ##
========================================
Coverage 99.28% 99.28%
========================================
Files 345 345
Lines 19116 19119 +3
========================================
+ Hits 18980 18983 +3
Misses 136 136
Continue to review full report at Codecov.
|
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 @Scottmar93 . I checked changing the order in this test and indeed it fails, so it only used to work because p,q,r,s is already sorted. Could you change the order of the sensitivities in the test to make sure it still works with your fix?
@tinosulzer ah nice!! Yeah will do! |
Okay, the original fix passed for some variables but not all so I have just changed it so that the inputs dictionary is sorted straight away upon being passed to the solver. This now passes the test with the dictionary keys in a different order. |
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 @Scottmar93 , this looks good, getting some strange errors in python 3.8 and 3.9 on ubuntu. I was unable to replicate this on my machine (ubuntu, python 3.8).
I think the test error is unrelated, so happy to merge this |
I've tried merging from develop so hopefully that solves the testing issue. It looked like something that was failing on other branches as well though. |
Description
During the solver setup, the list of inputs/sensitivities is sorted by string and then used to assign elements of the y-array to each sensitivity. This applies the same sorting of the list before extracting the sensitivities during the process variables stage.
I haven't added a test because I couldn't think of a good way without having a full integration test (passing a full model through the pipeline and then checking that the sensitivities are independent of the order of the inputs dictionary). However, I can add it if you think this is worth it for this.
Fixes #1886
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: