Skip to content

Commit ae684c2

Browse files
committed
Black, black, black..
1 parent 1475945 commit ae684c2

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

pySDC/projects/PinTSimE/battery_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ def plot_voltages(description, problem, sweeper, recomputed, use_switch_estimato
247247
fig.savefig('data/{}_model_solution_{}.png'.format(problem, sweeper), dpi=300, bbox_inches='tight')
248248
plt_helper.plt.close(fig)
249249

250+
250251
def get_recomputed(stats, type, sortby):
251252
"""
252253
Function that filters statistics after a recomputation

pySDC/projects/PinTSimE/estimation_check.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def check(cwd='./'):
196196
"""
197197

198198
V_ref = 1.0
199-
dt_list = [1e-2, 1e-3, 1e-4]
199+
dt_list = [4e-2, 4e-3]
200200
use_switch_estimator = [True, False]
201201
use_adaptivity = [True, False]
202202
restarts_SE = []
@@ -220,7 +220,9 @@ def check(cwd='./'):
220220
)
221221

222222
if use_SE:
223-
assert len(get_recomputed(stats, type='switch', sortby='time')) >= 1, 'No switches found for dt={}!'.format(dt_item)
223+
assert (
224+
len(get_recomputed(stats, type='switch', sortby='time')) >= 1
225+
), 'No switches found for dt={}!'.format(dt_item)
224226

225227
fname = 'data/battery_dt{}_USE{}_USA{}_{}.dat'.format(dt_item, use_SE, use_A, sweeper.__name__)
226228
f = open(fname, 'wb')

pySDC/projects/PinTSimE/estimation_check_extended.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ def check(cwd='./'):
130130
stats, description = run(dt=dt_item, use_switch_estimator=use_SE)
131131

132132
if use_SE:
133-
assert len(get_recomputed(stats, type='switch', sortby='time')) >= 1, 'No switches found for dt={}!'.format(dt_item)
133+
assert (
134+
len(get_recomputed(stats, type='switch', sortby='time')) >= 1
135+
), 'No switches found for dt={}!'.format(dt_item)
134136

135137
fname = 'data/battery_2condensators_dt{}_USE{}.dat'.format(dt_item, use_SE)
136138
f = open(fname, 'wb')

pySDC/projects/PinTSimE/switch_estimator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ def get_new_step_size(self, controller, S):
6464
self.params.switch_detected, m_guess, vC_switch = L.prob.get_switching_info(L.u, L.time)
6565

6666
if self.params.switch_detected:
67-
t_interp = [
68-
L.time + L.dt * self.params.coll_nodes[m] for m in range(len(self.params.coll_nodes))
69-
]
67+
t_interp = [L.time + L.dt * self.params.coll_nodes[m] for m in range(len(self.params.coll_nodes))]
7068

7169
# only find root if vc_switch[0], vC_switch[-1] have opposite signs (intermediate value theorem)
7270
if vC_switch[0] * vC_switch[-1] < 0:

0 commit comments

Comments
 (0)