Skip to content

Conversation

@Rishab87
Copy link
Member

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

@codecov
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.



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
Member 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!

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
Member 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
Member Author

@rtimms, I've made the changes

@Rishab87
Copy link
Member Author

Rishab87 commented Mar 5, 2025

Anything else I need to change here?

@Rishab87
Copy link
Member Author

Rishab87 commented Apr 9, 2025

Any updates on this?

@Rishab87 Rishab87 requested a review from rtimms April 9, 2025 18:03
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