Skip to content

Remove internal use of deprecated set_parameters method#4638

Merged
MarcBerliner merged 2 commits intodevelopfrom
mdb/fix-public-set_parameters
Dec 2, 2024
Merged

Remove internal use of deprecated set_parameters method#4638
MarcBerliner merged 2 commits intodevelopfrom
mdb/fix-public-set_parameters

Conversation

@MarcBerliner
Copy link
Copy Markdown
Member

Description

The set_parameters method in Simulation was deprecated, but it was still used internally, which caused warnings.

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.

  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python -m pytest (or $ nox -s tests)
  • The documentation builds: $ python -m pytest --doctest-plus src (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ nox -s quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Copy link
Copy Markdown
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks, @MarcBerliner!

@MarcBerliner MarcBerliner marked this pull request as ready for review December 2, 2024 21:04
@MarcBerliner MarcBerliner requested a review from a team as a code owner December 2, 2024 21:04
@MarcBerliner MarcBerliner enabled auto-merge (squash) December 2, 2024 21:04
@MarcBerliner MarcBerliner merged commit 7853ed5 into develop Dec 2, 2024
@MarcBerliner MarcBerliner deleted the mdb/fix-public-set_parameters branch December 2, 2024 21:07
Comment on lines +141 to +142
sim._set_parameters()
sim._set_parameters()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is one of the tricky parts of the change that did the deprecation. The private method should not really be used here since it is outside of the class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We do not have the SLF inspection turned on in PyBaMM, but it probably should be enabled

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.20%. Comparing base (72c23ea) to head (d45d388).
Report is 158 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4638      +/-   ##
===========================================
- Coverage    99.21%   99.20%   -0.02%     
===========================================
  Files          302      302              
  Lines        22858    22863       +5     
===========================================
+ Hits         22679    22681       +2     
- Misses         179      182       +3     

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

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.

3 participants