-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Made y, z optional arguments for FunctionParameters that depend on space #4883
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4883 +/- ##
========================================
Coverage 98.70% 98.71%
========================================
Files 304 304
Lines 23482 23506 +24
========================================
+ Hits 23179 23203 +24
Misses 303 303 ☔ View full report in Codecov by Sentry. |
@@ -18,7 +18,7 @@ | |||
# load parameter values and process model and geometry | |||
|
|||
|
|||
def ambient_temperature(y, z, t): | |||
def ambient_temperature(t, y=None, z=None): |
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.
Ideally this should work if the user just defines def ambient_temperature(t)
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.
yes I was about to ask that, thanks for clarifying, I'll make the changes accordingly
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.
great, thanks!
@@ -40,22 +40,20 @@ def _set_parameters(self): | |||
# Initial temperature | |||
self.T_init = pybamm.Parameter("Initial temperature [K]") | |||
|
|||
def T_amb(self, y, z, t): | |||
def T_amb(self, t, y=None, z=None): |
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.
we should raise a warning here that the order of the arguments has changed
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.
I've added that
@rtimms, I've made the changes |
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Description
Made y, z optional arguments for FunctionParameters that depend on space.This improves clarity and paves the way for supporting additional coordinate systems in thermal models.
Fixes #3631
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)
Important checks:
Please confirm the following before marking the PR as ready for review:
nox -s pre-commit
nox -s tests
nox -s doctests