Skip to content

Commit 51e73af

Browse files
#570 update changelog and get it actually working
1 parent ba0537b commit 51e73af

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
## Bug fixes
1818

19+
- Add warning if `ProcessedVariable` is called outisde its interpolation range ([#681](https://github.com/pybamm-team/PyBaMM/pull/681))
1920
- Improve the way `ProcessedVariable` objects are created in higher dimensions ([#581](https://github.com/pybamm-team/PyBaMM/pull/581))
2021

2122
# [v0.1.0](https://github.com/pybamm-team/PyBaMM/tree/v0.1.0) - 2019-10-08

pybamm/processed_variable.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ def __call__(self, t=None, x=None, r=None, y=None, z=None, warn=True):
404404
out = self.call_2D(t, x, r, z)
405405
elif self.dimensions == 3:
406406
out = self.call_3D(t, x, r, y, z)
407-
if warn is True and out is None:
407+
if warn is True and np.isnan(out).any():
408408
pybamm.logger.warning(
409-
"Calling variable outside interpolation range (returns 'None')"
409+
"Calling variable outside interpolation range (returns 'nan')"
410410
)
411411
return out
412412

0 commit comments

Comments
 (0)