-
-
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
Disallow modifications to pybamm.Simulation
object attributes after initialisation
#3267
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) |
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.
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. |
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.
Looks good, thanks!
Description
Removes the setter methods in the
Simulation
class, so that parameters defined in the initialisation of apybamm.Simulation
instance cannot be modified unless the instance is redefinedThis way, attributes like
sim.model
orsim.parameter_values
cannot be edited directly. A newsim
object 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: