Skip to content

Commit

Permalink
can now change any RANGE var in syn
Browse files Browse the repository at this point in the history
  • Loading branch information
GregGlickert committed Oct 8, 2024
1 parent 2573b11 commit 920e460
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion bmtool/synapses.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,26 @@ def __init__(self, mechanisms_dir: str, templates_dir: str, conn_type_settings:
self.other_vars_to_record = other_vars_to_record

if slider_vars:
self.slider_vars = {key: value for key, value in self.synaptic_props.items() if key in slider_vars} # filters dict to have only the entries that have a key in the sliders var
# Start by filtering based on keys in slider_vars
self.slider_vars = {key: value for key, value in self.synaptic_props.items() if key in slider_vars}
# Iterate over slider_vars and check for missing keys in self.synaptic_props
for key in slider_vars:
# If the key is missing from synaptic_props, get the value using getattr
if key not in self.synaptic_props:
try:
# Get the alternative value from getattr dynamically
self.set_up_cell()
self.set_up_synapse()
value = getattr(self.syn,key)
print(value)
self.slider_vars[key] = value
except AttributeError as e:
print(f"Error accessing '{key}' in syn {self.syn}: {e}")

else:
self.slider_vars = self.synaptic_props


h.tstop = general_settings['tstart'] + general_settings['tdur']
h.dt = general_settings['dt'] # Time step (resolution) of the simulation in ms
h.steps_per_ms = 1 / h.dt
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="bmtool",
version='0.5.6.1',
version='0.5.6.2',
author="Neural Engineering Laboratory at the University of Missouri",
author_email="gregglickert@mail.missouri.edu",
description="BMTool",
Expand Down

0 comments on commit 920e460

Please sign in to comment.