Skip to content

Commit a6a2131

Browse files
committed
Some pep8 improvements
1 parent 65cd30b commit a6a2131

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

ciw/arrival_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def find_next_event_date(self):
5555
"""
5656
Finds the time of the next arrival.
5757
"""
58-
times = [[self.event_dates_dict[nd+1][clss]
58+
times = [[self.event_dates_dict[nd + 1][clss]
5959
for clss in range(len(self.event_dates_dict[1]))]
6060
for nd in range(len(self.event_dates_dict))]
6161

ciw/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def change_shift(self):
201201
Add servers and deletes or indicates which servers
202202
should go off duty.
203203
"""
204-
shift = self.next_event_date%self.cyclelength
204+
shift = self.next_event_date % self.cyclelength
205205

206206
try: indx = self.schedule.index(shift)
207207
except:

ciw/simulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def find_times_dict(self, kind):
183183
Create the dictionary of service and arrival
184184
time functions for each node for each class
185185
"""
186-
return {node+1: {
186+
return {node + 1: {
187187
clss: self.find_distributions(node, clss, kind)
188188
for clss in range(self.network.number_of_classes)}
189189
for node in range(self.network.number_of_nodes)}
@@ -193,7 +193,7 @@ def find_batches_dict(self):
193193
Create the dictionary of batch size
194194
functions for each node for each class
195195
"""
196-
return {node+1: {
196+
return {node + 1: {
197197
clss: self.find_distributions(node, clss, 'Bch')
198198
for clss in range(self.network.number_of_classes)}
199199
for node in range(self.network.number_of_nodes)}
@@ -283,7 +283,7 @@ def simulate_until_max_time(self, max_simulation_time, progress_bar=False):
283283
next_active_node = self.find_next_active_node()
284284
current_time = next_active_node.next_event_date
285285

286-
if progress_bar is not False:
286+
if progress_bar:
287287
self.progress_bar = tqdm.tqdm(total=max_simulation_time)
288288

289289
while current_time < max_simulation_time:
@@ -318,7 +318,7 @@ def simulate_until_max_customers(self, max_customers,
318318
next_active_node = self.find_next_active_node()
319319
current_time = next_active_node.next_event_date
320320

321-
if progress_bar is not False:
321+
if progress_bar:
322322
self.progress_bar = tqdm.tqdm(total=max_customers)
323323

324324
if method == 'Finish':

0 commit comments

Comments
 (0)