From 94f5460184172d5bd48753cb35da3835c349dcb9 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Thu, 9 Jan 2025 13:37:27 -0500 Subject: [PATCH] Make times from remote-access be "well-behaved" by copying --- cheta/fetch.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cheta/fetch.py b/cheta/fetch.py index 1333a088..77e2820b 100644 --- a/cheta/fetch.py +++ b/cheta/fetch.py @@ -863,6 +863,12 @@ def get_time_data_from_server(h5_slice, filename): times_all_ok = np.all(times_ok) if not times_all_ok: times = times[times_ok] + elif remote_access.access_remotely: + # This is really to prevent an issue in MATLAB tools where the times + # array is not "well-behaved" and causes issues in the MATLAB interface + # layer. But since remote access is almost always done with MATLAB and + # is slow, we'll just copy the array to be safe. + times = times.copy() times_cache.update( dict(key=cache_key, val=times, ok=times_ok, all_ok=times_all_ok)