-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Raise error for unknown parameter_values #3132
Conversation
added else to inform user of an invalid parameter set
Ran unit tests, FAILED (failures=1, skipped=62) Traceback (most recent call last): |
Doc test result: |
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.
values = pybamm.parameter_sets[values] | ||
values.pop("chemistry", None) | ||
self.update(values, check_already_exists=False) | ||
else: | ||
print("Invalid Parameter Set Value") |
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.
could you raise a ValueError
here? E.g.
else:
raise ValueError("helpful message")
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.
Done
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.
thanks @tommaull looks good!
@all-contributors please add @tommaull for code and tests |
I've put up a pull request to add @tommaull! 🎉 |
changelog updated - sorry about that! |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #3132 +/- ##
========================================
Coverage 99.71% 99.71%
========================================
Files 248 248
Lines 18747 18748 +1
========================================
+ Hits 18693 18694 +1
Misses 54 54
☔ View full report in Codecov by Sentry. |
added else statement to inform user of an invalid parameter set
Description
Added else statement to inform user of an invalid parameter set in parameter_values.py
In response to #3063 - Raise error for unknown parameter sets
Fixes # (3063)
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
(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
$ python run-tests.py --doctest
You can run unit and doctests together at once, using
$ python run-tests.py --quick
.Further checks: