Skip to content

Commit

Permalink
garbage collect to trigger warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Jun 4, 2024
1 parent 72396da commit 5ab61af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions brian2/core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import gc
import os
import pickle as pickle
import sys
Expand Down Expand Up @@ -1102,6 +1103,8 @@ def run(
The simulation can be stopped by calling `Network.stop` or the
global `stop` function.
"""
# This will trigger warnings for objects that have not been included in a network
gc.collect()
device = get_device() # Do not use the ProxyDevice -- slightly faster

if profile is None:
Expand Down

0 comments on commit 5ab61af

Please sign in to comment.