Skip to content

Commit fa7d0a6

Browse files
Fix Hang in Python 3.14 GH Actions (westpa#544)
* prevent inplace resize of arrays due to future numpy deprecation since 2.4.0 * use numpy.pad instead to ensure value is added in one step
1 parent 96a0573 commit fa7d0a6

File tree

1 file changed

+3
-9
lines changed
  • src/westpa/work_managers/zeromq

1 file changed

+3
-9
lines changed

src/westpa/work_managers/zeromq/core.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,10 @@ def add_timer(self, identifier, duration):
211211

212212
new_idx = len(self._identifiers)
213213

214-
# Necessary due to coverage.py's use of a tracer triggering an error on resize
215-
refcheck = True if sys.gettrace() is None else False
214+
self._durations = np.pad(self._durations, (0, 1), mode='constant', constant_values=duration)
215+
self._started = np.pad(self._started, (0, 1), mode='constant', constant_values=time.time())
216+
self._identifiers = np.pad(self._identifiers, (0, 1), mode='constant', constant_values=identifier)
216217

217-
self._durations.resize((new_idx + 1,), refcheck=refcheck)
218-
self._started.resize((new_idx + 1,), refcheck=refcheck)
219-
self._identifiers.resize((new_idx + 1,), refcheck=refcheck)
220-
221-
self._durations[new_idx] = duration
222-
self._started[new_idx] = time.time()
223-
self._identifiers[new_idx] = identifier
224218
self._indices[identifier] = new_idx
225219

226220
def remove_timer(self, identifier):

0 commit comments

Comments
 (0)