Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up loop using mask
Browse files Browse the repository at this point in the history
lisawim committed Apr 18, 2024
1 parent e00236c commit e8bf17e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pySDC/projects/PinTSimE/estimation_check.py
Original file line number Diff line number Diff line change
@@ -244,8 +244,8 @@ def plotStateFunctionAroundEvent(u_num, prob_cls_name, M_fix): # pragma: no cov
t_switches = [u_num[dt][M_fix][use_SE][use_A]['t_switches'] for dt in dt_list]
for t_switch_item in t_switches:
for m in range(1, len(t_switch_item)):
if np.isclose(t_switch_item[m - 1], t_switch_item[m], atol=1e-10):
t_switch_item.pop(m - 1)
mask = np.append([True], np.abs(t_switch_item[1:] - t_switch_item[:-1]) > 1e-10)
t_switch_item = t_switch_item[mask]

t_switch = [t_event[i] for t_event in t_switches]
ax[0, ind].plot(

0 comments on commit e8bf17e

Please sign in to comment.