Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
raj1701 committed Mar 9, 2023
1 parent 2e64179 commit 894d386
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/howto/plot_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
# directly.
def get_network(probability=1.0):
net = jones_2009_model(add_drives_from_params=True)
net.connectivity = list()
net.clear_connectivity()
net.clear_drives()

# Pyramidal cell connections
location, receptor = 'distal', 'ampa'
Expand Down
9 changes: 4 additions & 5 deletions hnn_core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,11 @@ def clear_connectivity(self, src_types=None):
"""
if src_types is None:
src_types = list()
# Storing all external drives
src_types_external_drives = self.external_drives.keys()
for conn in self.connectivity:
src_type = conn['src_type']
if src_type not in src_types_external_drives:
src_types.append(src_type) # Storing drives to be deleted
# src_type should not be a external drive in this case
if src_type not in self.drive_names:
src_types.append(src_type) # Store src_types to be deleted
src_types = list(set(src_types)) # Removing duplicate entries
connectivity = list() # Initialize empty list
for conn in self.connectivity:
Expand All @@ -1286,7 +1285,7 @@ def clear_drives(self, drive_names='all'):
The drive_names to remove
"""
if drive_names == 'all':
drive_names = list(self.external_drives.keys())
drive_names = self.drive_names
_validate_type(drive_names, (list,))
for drive_name in drive_names:
del self.external_drives[drive_name]
Expand Down

0 comments on commit 894d386

Please sign in to comment.