Skip to content
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

Better error on unrecognised parameter set #4120

Closed
rtimms opened this issue May 31, 2024 · 0 comments · Fixed by #4208
Closed

Better error on unrecognised parameter set #4120

rtimms opened this issue May 31, 2024 · 0 comments · Fixed by #4208
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours

Comments

@rtimms
Copy link
Contributor

rtimms commented May 31, 2024

Doing pybamm.ParameterValues("bad") gives ValueError: Invalid Parameter Value. It would be better to say something like ValueError: 'bad' is not a recognised parameter set and possibly list the valid options (including custom parameter sets that have been registered as entry points).

@agriyakhetarpal agriyakhetarpal added the difficulty: easy A good issue for someone new. Can be done in a few hours label May 31, 2024
Ubham16 pushed a commit to Ubham16/PyBaMM that referenced this issue Jun 24, 2024
rtimms added a commit that referenced this issue Jun 25, 2024
* #4120 improved error message

* style: pre-commit fixes

* updated test

* Update tests/unit/test_parameters/test_parameter_values.py

Co-authored-by: Eric G. Kratz <[email protected]>

* Update pybamm/parameters/parameter_values.py

Co-authored-by: Robert Timms <[email protected]>

* Update pybamm/parameters/parameter_values.py

Co-authored-by: Eric G. Kratz <[email protected]>

---------

Co-authored-by: Ubham16 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Arjun Verma <[email protected]>
Co-authored-by: Eric G. Kratz <[email protected]>
Co-authored-by: Robert Timms <[email protected]>
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this issue Aug 12, 2024
* pybamm-team#4120 improved error message

* style: pre-commit fixes

* updated test

* Update tests/unit/test_parameters/test_parameter_values.py

Co-authored-by: Eric G. Kratz <[email protected]>

* Update pybamm/parameters/parameter_values.py

Co-authored-by: Robert Timms <[email protected]>

* Update pybamm/parameters/parameter_values.py

Co-authored-by: Eric G. Kratz <[email protected]>

---------

Co-authored-by: Ubham16 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Arjun Verma <[email protected]>
Co-authored-by: Eric G. Kratz <[email protected]>
Co-authored-by: Robert Timms <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants