Skip to content

Commit

Permalink
Update default value for deadlock_detector in simulation.py
Browse files Browse the repository at this point in the history
I don't think it causes a problem here, but the best practice I've been told is to avoid having mutable default arguments to functions and methods.
  • Loading branch information
galenseilis authored Jun 14, 2024
1 parent 8c6bb9a commit 78ab2cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ciw/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
exact=False,
name="Simulation",
tracker=None,
deadlock_detector=deadlock.NoDetection(),
deadlock_detector=None,
node_class=None,
arrival_node_class=None,
individual_class=None,
Expand All @@ -41,7 +41,7 @@ def __init__(
getcontext().prec = exact

self.name = name
self.deadlock_detector = deadlock_detector
self.deadlock_detector = deadlock.NoDetection() if deadlock_detector is None else deadlock_detector
self.inter_arrival_times = self.find_arrival_dists()
self.service_times = self.find_service_dists()
self.batch_sizes = self.find_batching_dists()
Expand Down

0 comments on commit 78ab2cc

Please sign in to comment.