Disallow modifications to pybamm.Simulation object attributes after initialisation - #3267
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #3267 +/- ##
===========================================
- Coverage 99.57% 99.56% -0.02%
===========================================
Files 253 253
Lines 19571 19546 -25
===========================================
- Hits 19488 19461 -27
- Misses 83 85 +2
☔ View full report in Codecov by Sentry. |
|
@tinosulzer let me know if this needs a CHANGELOG entry (my guess is that it does) |
brosaplanella
left a comment
There was a problem hiding this comment.
Looks good, thanks! Can you improve the coverage and add a CHANGELOG line? Happy to approve then :)
|
I added a CHANGELOG entry. Could you help on improving the coverage? It passes locally for me |
Ok, then probably it is an issue with Codecov. Let's wait for a second review before merging in any case. |
Description
Removes the setter methods in the
Simulationclass, so that parameters defined in the initialisation of apybamm.Simulationinstance cannot be modified unless the instance is redefinedThis way, attributes like
sim.modelorsim.parameter_valuescannot be edited directly. A newsimobject with the modified parameters is required to incorporate changes, i.e.,Fixes #3196
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(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)$ python run-tests.py --all(or$ nox -s tests)$ python run-tests.py --doctest(or$ nox -s doctests)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick(or$ nox -s quick).Further checks: