Repository navigation
Issue 1221 convert to casadi - #1316
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1316 +/- ##
========================================
Coverage 98.10% 98.10%
========================================
Files 272 272
Lines 15277 15290 +13
========================================
+ Hits 14988 15001 +13
Misses 289 289
Continue to review full report at Codecov.
|
brosaplanella
approved these changes
Dec 31, 2020
brosaplanella
left a comment
Member
There was a problem hiding this comment.
Looks good to me, happy to merge once the test passes. Thanks Tino!
| solution = solver.solve(model, t_eval) | ||
| np.testing.assert_array_less(solution.y[0], 1.5) | ||
| np.testing.assert_array_less(solution.y[-1], 2.5 + 1e-10) | ||
| np.testing.assert_array_less(solution.y.full()[0], 1.5) |
Member
There was a problem hiding this comment.
This test fails but I can't understand why it doesn't take the .full().
Member
Author
There was a problem hiding this comment.
get_termination_reason had changed in #1300 and was returning a numpy array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Convert variables to casadi for faster post-processing.
The conversion is done the first time the variable is called, and the casadi function is then stored in the model (in
model._variables_casadi. Therefore, when doing repeated solutions of the same model (e.g. for parameter sweeps) the conversion is only performed the first time.Fixes #1221
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 docsand then$ make clean; make htmlYou can run all three at once, using
$ python run-tests.py --quick.Further checks: