Skip to content

I4545-remove-explicit-sens - #4975

Merged
MarcBerliner merged 11 commits into
developfrom
i4545-remove-explicit-sens
Apr 24, 2025
Merged

MarcBerliner merged 11 commits into
developfrom
i4545-remove-explicit-sens

Conversation

@martinjrobins

Copy link
Copy Markdown
Contributor

Description

Fixes #4545

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@martinjrobins
martinjrobins requested a review from a team as a code owner April 16, 2025 10:52
@codecov

codecov Bot commented Apr 16, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (b4c9df8) to head (36ed705).
Report is 103 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4975      +/-   ##
===========================================
- Coverage    98.60%   98.57%   -0.04%     
===========================================
  Files          304      304              
  Lines        23809    23641     -168     
===========================================
- Hits         23478    23305     -173     
- Misses         331      336       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MarcBerliner MarcBerliner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @martinjrobins! It makes the code so much cleaner :)

Just a few minor comments

Comment thread src/pybamm/models/base_model.py Resolved
Comment thread src/pybamm/solvers/solution.py Resolved
Comment on lines 328 to 335
sens_idaklu = np.interp(
solutions[1].t[:-2],
solutions[3].t,
solutions[3]["Voltage [V]"]
t,
solutions[1].t,
solutions[1]["Voltage [V]"]
.sensitivities[input_param_name]
.full()
.flatten(),
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to a higher order interpolator

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this but it doesn't work very well due to the discontinuities in the experiment, linear interp behaves better

@MarcBerliner MarcBerliner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Martin! Looks great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove explicit sensitivity calculation (casadi solver)

2 participants