Skip to content

Commit

Permalink
Pass argument as tuple in call
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Apr 13, 2023
1 parent 4e5b894 commit 7b48b1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pybamm/solvers/processed_variable.py
Expand Up @@ -450,9 +450,9 @@ def __call__(self, t=None, x=None, r=None, y=None, z=None, R=None, warn=True):
if self.dimensions == 0:
out = self._interpolation_function(t)
elif self.dimensions == 1:
out = self.call_1D(t, x, r, z, R)
out = self.call_1D((t, x, r, z, R))
elif self.dimensions == 2:
out = self.call_2D(t, x, r, y, z, R)
out = self.call_2D((t, x, r, y, z, R))
if warn is True and np.isnan(out).any():
pybamm.logger.warning(
"Calling variable outside interpolation range (returns 'nan')"
Expand All @@ -462,7 +462,7 @@ def __call__(self, t=None, x=None, r=None, y=None, z=None, R=None, warn=True):
def call_1D(self, t, x, r, z, R):
"""Evaluate a 1D variable"""
spatial_var = eval_dimension_name(self.first_dimension, x, r, None, z, R)
return self._interpolation_function(t, spatial_var)
return self._interpolation_function((t, spatial_var))

def call_2D(self, t, x, r, y, z, R):
"""Evaluate a 2D variable"""
Expand Down

0 comments on commit 7b48b1e

Please sign in to comment.