Skip to content

Commit

Permalink
Resolving issue when checking if data is finite when the data object (A…
Browse files Browse the repository at this point in the history
…RM-DOE#752)

type is not a Numpy array. This will try to extract the numpy array from the
DataArray. Wrapped in a try to catch when the data is already a numpy
array or is something else.
  • Loading branch information
kenkehoe authored Nov 15, 2023
1 parent 27a6fc1 commit d324e99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions act/plotting/timeseriesdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,12 @@ def plot(
our_data = ydata

finite = np.isfinite(our_data)
# If finite is returned as DataArray or Dask array extract values.
try:
finite = finite.values
except AttributeError:
pass

if finite.any():
our_data = our_data[finite]
if invert_y_axis is False:
Expand Down

0 comments on commit d324e99

Please sign in to comment.