-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Idaklu solver can be given a list of variables to calculate during the solve #3217
Conversation
…cture ready for separate vars and state-vector implementations
…ts to include output_variables where relevant
Interface is as suggested in #2796 , namely: solver = pybamm.IDAKLUSolver()
sol = solver.solve(model, t_eval, output_variables=['Voltage [V]'])
print(sol['Voltage [V]'].entries) Note that only variables listed in |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3217 +/- ##
===========================================
+ Coverage 99.56% 99.58% +0.01%
===========================================
Files 253 254 +1
Lines 19559 19811 +252
===========================================
+ Hits 19474 19728 +254
+ Misses 85 83 -2
☔ View full report in Codecov by Sentry. |
…l sensitivity tests when output_variables are specified
Thanks @jsbrittain. The doctests and notebooks, and the example scripts don't seem anything to do with this PR, but there are a few issues to fix in the Cadacy Static Code Analysis |
@martinjrobins yes, I believe the doctest and notebooks are due to matplotlib deprecating a feature over the weekend - there are other PRs in progress to resolve this. As for codacy, I was looking at the report and the (big!) jump in codacy issues appears to be due to the macro function that was introduced in CasadiSolverOpenMP_solvers.hpp to help automate creation of classes for the various solvers. Codacy doesn't appear to expand the expressions when evaluating them and so believes that there are now many dangling properties. The only way I can think of adequately resolving this would be to revert the change and remove the macro. Do you have a strong preference here? |
The fixes are now merged in the develop branch |
I would be in favor of keeping the macro, can you turn off the error in some way? |
Seems like Codacy got stuck. Is it an issue at their end or at our end? |
@brosaplanella Not sure why codacy stalled. I've been making some changes and commited again so will keep an eye on it. |
f544b1c
to
50f8258
Compare
@martinjrobins Two main changes since the last review:
|
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.
fantastic, thanks @jsbrittain. All looks good to merge
Description
Provides a mode for the (Idaklu) solver so that only a user given list of variables are calculated and stored as part of the solution. This functionality extends to sensitivity calculations. The PR also includes a restructuring of the idaklu c++ codebase to support further extensions and abstractions in the future.
Fixes #2796
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:
$ pre-commit run
(see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
$ python run-tests.py --doctest
You can run unit and doctests together at once, using
$ python run-tests.py --quick
.Further checks: