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

Made y, z optional arguments for FunctionParameters that depend on space #4883

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Rishab87
Copy link
Contributor

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:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.71%. Comparing base (f171572) to head (e9a1ef1).
Report is 2 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

@@ -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):
Copy link
Contributor

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)

Copy link
Contributor Author

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

Copy link
Contributor

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):
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added that

@Rishab87 Rishab87 marked this pull request as ready for review February 28, 2025 10:48
@Rishab87 Rishab87 requested a review from a team as a code owner February 28, 2025 10:48
@Rishab87
Copy link
Contributor Author

@rtimms, I've made the changes

Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make y, z optional arguments forFunctionParameters that depend on space
3 participants