PyBaMM: Raise error if updating a parameter that already exists with `check_already_exists=False`
This will force people to use check_already_exists=False sparingly, and help to catch bugs related to misnaming parameters (this is caught if check_already_exists=True, but not if it’s False
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18 (13 by maintainers)
I added a portion of this change in #3382. Although that PR only logs a warning. I did a partial change due to the number of tests and examples that would need to be updated by the change.
For making it an error to update parameters with check_already_exists=False, I think one of the following two options could be good:
Of those two options, I would lean towards (2) since each function would have a single purpose and there would be no ambiguity from the name of the variable.