@@ -185,7 +185,7 @@ def jacobian_sparsity():
185
185
# Turn offsets into a single tuple instead of a tuple of tuples.
186
186
offsets = sum (offsets , ())
187
187
# Check that we have as many offsets as diagonals:
188
- try :
188
+ try :
189
189
assert len (offsets ) == diagonals .shape [0 ]
190
190
except AssertionError as e :
191
191
print ('Setup of diagonals incorrect.' )
@@ -226,22 +226,19 @@ def __post_init__(self):
226
226
'''
227
227
Filter out solver settings that are mutually incompatible.
228
228
'''
229
- if self . solver != "scipy" :
230
- try :
229
+ try :
230
+ if self . solver != "scipy" :
231
231
del self .__dataclass_fields__ ["method" ]
232
232
del self .__dataclass_fields__ ["lband" ]
233
233
del self .__dataclass_fields__ ["uband" ]
234
- except KeyError :
235
- pass
236
- else :
237
- try :
234
+ else :
238
235
del self .__dataclass_fields__ ["scheme" ]
239
236
del self .__dataclass_fields__ ["adaptive" ]
240
237
if self .method != "LSODA" :
241
238
del self .__dataclass_fields__ ["lband" ]
242
239
del self .__dataclass_fields__ ["uband" ]
243
- except KeyError :
244
- pass
240
+ except KeyError :
241
+ pass
245
242
246
243
247
244
@dataclass
@@ -250,7 +247,7 @@ class Tracker:
250
247
Initialises all the tracking parameters, such as tracker interval.
251
248
Also indicates the quantities to be tracked, as boolean values.
252
249
'''
253
- progress_tracker_interval : float = Solver ().t_range / 1_000
250
+ progress_tracker_interval : float = Solver ().t_range / 1_000
254
251
live_plotting : bool = False
255
252
plotting_interval : str = '0:05'
256
253
data_tracker_interval : float = 0.01
0 commit comments