bmtool 0.7.3__py3-none-any.whl → 0.7.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bmtool/bmplot/connections.py +20 -15
- bmtool/bmplot/lfp.py +1 -2
- bmtool/synapses.py +149 -71
- {bmtool-0.7.3.dist-info → bmtool-0.7.4.dist-info}/METADATA +2 -1
- {bmtool-0.7.3.dist-info → bmtool-0.7.4.dist-info}/RECORD +9 -9
- {bmtool-0.7.3.dist-info → bmtool-0.7.4.dist-info}/WHEEL +0 -0
- {bmtool-0.7.3.dist-info → bmtool-0.7.4.dist-info}/entry_points.txt +0 -0
- {bmtool-0.7.3.dist-info → bmtool-0.7.4.dist-info}/licenses/LICENSE +0 -0
- {bmtool-0.7.3.dist-info → bmtool-0.7.4.dist-info}/top_level.txt +0 -0
bmtool/bmplot/connections.py
CHANGED
@@ -13,6 +13,8 @@ import numpy as np
|
|
13
13
|
import pandas as pd
|
14
14
|
from IPython import get_ipython
|
15
15
|
|
16
|
+
from neuron import h
|
17
|
+
|
16
18
|
from ..util import util
|
17
19
|
|
18
20
|
use_description = """
|
@@ -981,7 +983,7 @@ def distance_delay_plot(
|
|
981
983
|
plt.show()
|
982
984
|
|
983
985
|
|
984
|
-
def plot_synapse_location(config: str, source: str, target: str, sids: str, tids: str) -> tuple:
|
986
|
+
def plot_synapse_location(config: str, source: str, target: str, sids: str, tids: str, syn_feature: str = 'afferent_section_id') -> tuple:
|
985
987
|
"""
|
986
988
|
Generates a connectivity matrix showing synaptic distribution across different cell sections.
|
987
989
|
Note does exclude gap junctions since they dont have an afferent id stored in the h5 file!
|
@@ -998,6 +1000,8 @@ def plot_synapse_location(config: str, source: str, target: str, sids: str, tids
|
|
998
1000
|
Column name in nodes file containing source population identifiers
|
999
1001
|
tids : str
|
1000
1002
|
Column name in nodes file containing target population identifiers
|
1003
|
+
syn_feature : str, default 'afferent_section_id'
|
1004
|
+
Synaptic feature to analyze ('afferent_section_id' or 'afferent_section_pos')
|
1001
1005
|
|
1002
1006
|
Returns
|
1003
1007
|
-------
|
@@ -1011,22 +1015,22 @@ def plot_synapse_location(config: str, source: str, target: str, sids: str, tids
|
|
1011
1015
|
RuntimeError
|
1012
1016
|
If template loading or cell instantiation fails
|
1013
1017
|
"""
|
1014
|
-
import matplotlib.pyplot as plt
|
1015
|
-
import numpy as np
|
1016
|
-
from neuron import h
|
1017
|
-
|
1018
1018
|
# Validate inputs
|
1019
1019
|
if not all([config, source, target, sids, tids]):
|
1020
1020
|
raise ValueError(
|
1021
1021
|
"Missing required parameters: config, source, target, sids, and tids must be provided"
|
1022
1022
|
)
|
1023
1023
|
|
1024
|
+
# Fix the validation logic - it was using 'or' instead of 'and'
|
1025
|
+
if syn_feature not in ["afferent_section_id", "afferent_section_pos"]:
|
1026
|
+
raise ValueError("Currently only syn features supported are afferent_section_id or afferent_section_pos")
|
1027
|
+
|
1024
1028
|
try:
|
1025
1029
|
# Load mechanisms and template
|
1026
1030
|
util.load_templates_from_config(config)
|
1027
1031
|
except Exception as e:
|
1028
1032
|
raise RuntimeError(f"Failed to load templates from config: {str(e)}")
|
1029
|
-
|
1033
|
+
|
1030
1034
|
try:
|
1031
1035
|
# Load node and edge data
|
1032
1036
|
nodes, edges = util.load_nodes_edges_from_config(config)
|
@@ -1036,17 +1040,17 @@ def plot_synapse_location(config: str, source: str, target: str, sids: str, tids
|
|
1036
1040
|
target_nodes = nodes[target]
|
1037
1041
|
source_nodes = nodes[source]
|
1038
1042
|
edges = edges[f"{source}_to_{target}"]
|
1039
|
-
|
1040
|
-
|
1043
|
+
|
1044
|
+
# Find edges with NaN values in the specified feature
|
1045
|
+
nan_edges = edges[edges[syn_feature].isna()]
|
1041
1046
|
# Print information about removed edges
|
1042
1047
|
if not nan_edges.empty:
|
1043
1048
|
unique_indices = sorted(list(set(nan_edges.index.tolist())))
|
1044
|
-
print(f"Removing {len(nan_edges)} edges with missing
|
1049
|
+
print(f"Removing {len(nan_edges)} edges with missing {syn_feature}")
|
1045
1050
|
print(f"Unique indices removed: {unique_indices}")
|
1046
1051
|
|
1047
|
-
# Filter out edges with NaN
|
1048
|
-
edges = edges[edges[
|
1049
|
-
|
1052
|
+
# Filter out edges with NaN values in the specified feature
|
1053
|
+
edges = edges[edges[syn_feature].notna()]
|
1050
1054
|
|
1051
1055
|
except Exception as e:
|
1052
1056
|
raise RuntimeError(f"Failed to load nodes and edges: {str(e)}")
|
@@ -1116,7 +1120,7 @@ def plot_synapse_location(config: str, source: str, target: str, sids: str, tids
|
|
1116
1120
|
section_mapping = section_mappings[target_model_template]
|
1117
1121
|
|
1118
1122
|
# Calculate section distribution
|
1119
|
-
section_counts = filtered_edges[
|
1123
|
+
section_counts = filtered_edges[syn_feature].value_counts()
|
1120
1124
|
section_percentages = (section_counts / total_connections * 100).round(1)
|
1121
1125
|
|
1122
1126
|
# Format section distribution text - show all sections
|
@@ -1125,16 +1129,17 @@ def plot_synapse_location(config: str, source: str, target: str, sids: str, tids
|
|
1125
1129
|
section_name = section_mapping.get(section_id, f"sec_{section_id}")
|
1126
1130
|
section_display.append(f"{section_name}:{percentage}%")
|
1127
1131
|
|
1132
|
+
|
1128
1133
|
num_connections[source_idx, target_idx] = total_connections
|
1129
1134
|
text_data[source_idx, target_idx] = "\n".join(section_display)
|
1130
1135
|
|
1131
1136
|
except Exception as e:
|
1132
1137
|
print(f"Warning: Error processing {target_model_template}: {str(e)}")
|
1133
1138
|
num_connections[source_idx, target_idx] = total_connections
|
1134
|
-
text_data[source_idx, target_idx] = "
|
1139
|
+
text_data[source_idx, target_idx] = "Feature info N/A"
|
1135
1140
|
|
1136
1141
|
# Create the plot
|
1137
|
-
title = f"Synaptic Distribution by
|
1142
|
+
title = f"Synaptic Distribution by {syn_feature.replace('_', ' ').title()}: {source} to {target}"
|
1138
1143
|
fig, ax = plot_connection_info(
|
1139
1144
|
text=text_data,
|
1140
1145
|
num=num_connections,
|
bmtool/bmplot/lfp.py
CHANGED
bmtool/synapses.py
CHANGED
@@ -20,68 +20,104 @@ from tqdm.notebook import tqdm
|
|
20
20
|
|
21
21
|
from bmtool.util.util import load_templates_from_config
|
22
22
|
|
23
|
+
DEFAULT_GENERAL_SETTINGS = {
|
24
|
+
"vclamp": True,
|
25
|
+
"rise_interval": (0.1, 0.9),
|
26
|
+
"tstart": 500.0,
|
27
|
+
"tdur": 100.0,
|
28
|
+
"threshold": -15.0,
|
29
|
+
"delay": 1.3,
|
30
|
+
"weight": 1.0,
|
31
|
+
"dt": 0.025,
|
32
|
+
"celsius": 20,
|
33
|
+
}
|
34
|
+
|
35
|
+
DEFAULT_GAP_JUNCTION_GENERAL_SETTINGS = {
|
36
|
+
"tstart": 500.0,
|
37
|
+
"tdur": 500.0,
|
38
|
+
"dt": 0.025,
|
39
|
+
"celsius": 20,
|
40
|
+
}
|
41
|
+
|
23
42
|
|
24
43
|
class SynapseTuner:
|
25
44
|
def __init__(
|
26
45
|
self,
|
27
|
-
mechanisms_dir: str = None,
|
28
|
-
templates_dir: str = None,
|
29
|
-
config: str = None,
|
30
|
-
conn_type_settings: dict = None,
|
31
|
-
connection: str = None,
|
32
|
-
general_settings: dict = None,
|
33
|
-
json_folder_path: str = None,
|
46
|
+
mechanisms_dir: Optional[str] = None,
|
47
|
+
templates_dir: Optional[str] = None,
|
48
|
+
config: Optional[str] = None,
|
49
|
+
conn_type_settings: Optional[dict] = None,
|
50
|
+
connection: Optional[str] = None,
|
51
|
+
general_settings: Optional[dict] = None,
|
52
|
+
json_folder_path: Optional[str] = None,
|
34
53
|
current_name: str = "i",
|
35
|
-
other_vars_to_record: list = None,
|
36
|
-
slider_vars: list = None,
|
54
|
+
other_vars_to_record: Optional[list] = None,
|
55
|
+
slider_vars: Optional[list] = None,
|
56
|
+
hoc_cell: Optional[object] = None,
|
37
57
|
) -> None:
|
38
58
|
"""
|
39
|
-
Initialize the
|
59
|
+
Initialize the SynapseTuner class with connection type settings, mechanisms, and template directories.
|
40
60
|
|
41
61
|
Parameters:
|
42
62
|
-----------
|
43
|
-
mechanisms_dir : str
|
63
|
+
mechanisms_dir : Optional[str]
|
44
64
|
Directory path containing the compiled mod files needed for NEURON mechanisms.
|
45
|
-
templates_dir : str
|
65
|
+
templates_dir : Optional[str]
|
46
66
|
Directory path containing cell template files (.hoc or .py) loaded into NEURON.
|
47
|
-
conn_type_settings : dict
|
67
|
+
conn_type_settings : Optional[dict]
|
48
68
|
A dictionary containing connection-specific settings, such as synaptic properties and details.
|
49
|
-
connection : str
|
69
|
+
connection : Optional[str]
|
50
70
|
Name of the connection type to be used from the conn_type_settings dictionary.
|
51
|
-
general_settings : dict
|
71
|
+
general_settings : Optional[dict]
|
52
72
|
General settings dictionary including parameters like simulation time step, duration, and temperature.
|
53
|
-
json_folder_path : str
|
73
|
+
json_folder_path : Optional[str]
|
54
74
|
Path to folder containing JSON files with additional synaptic properties to update settings.
|
55
75
|
current_name : str, optional
|
56
76
|
Name of the synaptic current variable to be recorded (default is 'i').
|
57
|
-
other_vars_to_record : list
|
77
|
+
other_vars_to_record : Optional[list]
|
58
78
|
List of additional synaptic variables to record during the simulation (e.g., 'Pr', 'Use').
|
59
|
-
slider_vars : list
|
79
|
+
slider_vars : Optional[list]
|
60
80
|
List of synaptic variables you would like sliders set up for the STP sliders method by default will use all parameters in spec_syn_param.
|
61
|
-
|
81
|
+
hoc_cell : Optional[object]
|
82
|
+
An already loaded NEURON cell object. If provided, template loading and cell setup will be skipped.
|
62
83
|
"""
|
63
|
-
|
64
|
-
raise ValueError(
|
65
|
-
"Either a config file or both mechanisms_dir and templates_dir must be provided."
|
66
|
-
)
|
84
|
+
self.hoc_cell = hoc_cell
|
67
85
|
|
68
|
-
if
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
load_templates_from_config(config)
|
86
|
+
if hoc_cell is None:
|
87
|
+
if config is None and (mechanisms_dir is None or templates_dir is None):
|
88
|
+
raise ValueError(
|
89
|
+
"Either a config file, both mechanisms_dir and templates_dir, or a hoc_cell must be provided."
|
90
|
+
)
|
74
91
|
|
75
|
-
|
92
|
+
if config is None:
|
93
|
+
neuron.load_mechanisms(mechanisms_dir)
|
94
|
+
h.load_file(templates_dir)
|
95
|
+
else:
|
96
|
+
# loads both mech and templates
|
97
|
+
load_templates_from_config(config)
|
98
|
+
|
99
|
+
if conn_type_settings is None:
|
100
|
+
raise ValueError("conn_type_settings must be provided.")
|
101
|
+
if connection is None:
|
102
|
+
raise ValueError("connection must be provided.")
|
103
|
+
if connection not in conn_type_settings:
|
104
|
+
raise ValueError(f"connection '{connection}' not found in conn_type_settings.")
|
105
|
+
|
106
|
+
self.conn_type_settings: dict = conn_type_settings
|
76
107
|
if json_folder_path:
|
77
108
|
print(f"updating settings from json path {json_folder_path}")
|
78
109
|
self._update_spec_syn_param(json_folder_path)
|
79
|
-
|
110
|
+
# Use default general settings if not provided
|
111
|
+
if general_settings is None:
|
112
|
+
self.general_settings: dict = DEFAULT_GENERAL_SETTINGS.copy()
|
113
|
+
else:
|
114
|
+
# Merge defaults with user-provided
|
115
|
+
self.general_settings = {**DEFAULT_GENERAL_SETTINGS, **general_settings}
|
80
116
|
self.conn = self.conn_type_settings[connection]
|
81
117
|
self.synaptic_props = self.conn["spec_syn_param"]
|
82
|
-
self.vclamp = general_settings["vclamp"]
|
118
|
+
self.vclamp = self.general_settings["vclamp"]
|
83
119
|
self.current_name = current_name
|
84
|
-
self.other_vars_to_record = other_vars_to_record
|
120
|
+
self.other_vars_to_record = other_vars_to_record or []
|
85
121
|
self.ispk = None
|
86
122
|
|
87
123
|
if slider_vars:
|
@@ -94,25 +130,26 @@ class SynapseTuner:
|
|
94
130
|
# If the key is missing from synaptic_props, get the value using getattr
|
95
131
|
if key not in self.synaptic_props:
|
96
132
|
try:
|
97
|
-
# Get the alternative value from getattr dynamically
|
98
133
|
self._set_up_cell()
|
99
134
|
self._set_up_synapse()
|
100
135
|
value = getattr(self.syn, key)
|
101
|
-
# print(value)
|
102
136
|
self.slider_vars[key] = value
|
103
137
|
except AttributeError as e:
|
104
138
|
print(f"Error accessing '{key}' in syn {self.syn}: {e}")
|
105
|
-
|
106
139
|
else:
|
107
140
|
self.slider_vars = self.synaptic_props
|
108
141
|
|
109
|
-
h.tstop = general_settings["tstart"] + general_settings["tdur"]
|
110
|
-
h.dt = general_settings["dt"] # Time step (resolution) of the simulation in ms
|
142
|
+
h.tstop = self.general_settings["tstart"] + self.general_settings["tdur"]
|
143
|
+
h.dt = self.general_settings["dt"] # Time step (resolution) of the simulation in ms
|
111
144
|
h.steps_per_ms = 1 / h.dt
|
112
|
-
h.celsius = general_settings["celsius"]
|
145
|
+
h.celsius = self.general_settings["celsius"]
|
113
146
|
|
114
147
|
# get some stuff set up we need for both SingleEvent and Interactive Tuner
|
115
|
-
|
148
|
+
# Only set up cell if hoc_cell was not provided
|
149
|
+
if self.hoc_cell is None:
|
150
|
+
self._set_up_cell()
|
151
|
+
else:
|
152
|
+
self.cell = self.hoc_cell
|
116
153
|
self._set_up_synapse()
|
117
154
|
|
118
155
|
self.nstim = h.NetStim()
|
@@ -137,7 +174,7 @@ class SynapseTuner:
|
|
137
174
|
|
138
175
|
self._set_up_recorders()
|
139
176
|
|
140
|
-
def _update_spec_syn_param(self, json_folder_path):
|
177
|
+
def _update_spec_syn_param(self, json_folder_path: str) -> None:
|
141
178
|
"""
|
142
179
|
Update specific synaptic parameters using JSON files located in the specified folder.
|
143
180
|
|
@@ -146,6 +183,8 @@ class SynapseTuner:
|
|
146
183
|
json_folder_path : str
|
147
184
|
Path to folder containing JSON files, where each JSON file corresponds to a connection type.
|
148
185
|
"""
|
186
|
+
if not self.conn_type_settings:
|
187
|
+
return
|
149
188
|
for conn_type, settings in self.conn_type_settings.items():
|
150
189
|
json_file_path = os.path.join(json_folder_path, f"{conn_type}.json")
|
151
190
|
if os.path.exists(json_file_path):
|
@@ -155,13 +194,17 @@ class SynapseTuner:
|
|
155
194
|
else:
|
156
195
|
print(f"JSON file for {conn_type} not found.")
|
157
196
|
|
158
|
-
def _set_up_cell(self):
|
197
|
+
def _set_up_cell(self) -> None:
|
159
198
|
"""
|
160
199
|
Set up the neuron cell based on the specified connection settings.
|
200
|
+
This method is only called when hoc_cell is not provided.
|
161
201
|
"""
|
162
|
-
self.
|
202
|
+
if self.hoc_cell is None:
|
203
|
+
self.cell = getattr(h, self.conn["spec_settings"]["post_cell"])()
|
204
|
+
else:
|
205
|
+
self.cell = self.hoc_cell
|
163
206
|
|
164
|
-
def _set_up_synapse(self):
|
207
|
+
def _set_up_synapse(self) -> None:
|
165
208
|
"""
|
166
209
|
Set up the synapse on the target cell according to the synaptic parameters in `conn_type_settings`.
|
167
210
|
|
@@ -176,7 +219,7 @@ class SynapseTuner:
|
|
176
219
|
)
|
177
220
|
)
|
178
221
|
for key, value in self.conn["spec_syn_param"].items():
|
179
|
-
if isinstance(value, (int, float)):
|
222
|
+
if isinstance(value, (int, float)):
|
180
223
|
if hasattr(self.syn, key):
|
181
224
|
setattr(self.syn, key, value)
|
182
225
|
else:
|
@@ -184,7 +227,7 @@ class SynapseTuner:
|
|
184
227
|
f"Warning: {key} cannot be assigned as it does not exist in the synapse. Check your mod file or spec_syn_param."
|
185
228
|
)
|
186
229
|
|
187
|
-
def _set_up_recorders(self):
|
230
|
+
def _set_up_recorders(self) -> None:
|
188
231
|
"""
|
189
232
|
Set up recording vectors to capture simulation data.
|
190
233
|
|
@@ -952,11 +995,12 @@ class SynapseTuner:
|
|
952
995
|
class GapJunctionTuner:
|
953
996
|
def __init__(
|
954
997
|
self,
|
955
|
-
mechanisms_dir: str = None,
|
956
|
-
templates_dir: str = None,
|
957
|
-
config: str = None,
|
958
|
-
general_settings: dict = None,
|
959
|
-
conn_type_settings: dict = None,
|
998
|
+
mechanisms_dir: Optional[str] = None,
|
999
|
+
templates_dir: Optional[str] = None,
|
1000
|
+
config: Optional[str] = None,
|
1001
|
+
general_settings: Optional[dict] = None,
|
1002
|
+
conn_type_settings: Optional[dict] = None,
|
1003
|
+
hoc_cell: Optional[object] = None,
|
960
1004
|
):
|
961
1005
|
"""
|
962
1006
|
Initialize the GapJunctionTuner class.
|
@@ -973,34 +1017,49 @@ class GapJunctionTuner:
|
|
973
1017
|
General settings dictionary including parameters like simulation time step, duration, and temperature.
|
974
1018
|
conn_type_settings : dict
|
975
1019
|
A dictionary containing connection-specific settings for gap junctions.
|
1020
|
+
hoc_cell : object, optional
|
1021
|
+
An already loaded NEURON cell object. If provided, template loading and cell creation will be skipped.
|
976
1022
|
"""
|
977
|
-
|
978
|
-
raise ValueError(
|
979
|
-
"Either a config file or both mechanisms_dir and templates_dir must be provided."
|
980
|
-
)
|
1023
|
+
self.hoc_cell = hoc_cell
|
981
1024
|
|
982
|
-
if
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
1025
|
+
if hoc_cell is None:
|
1026
|
+
if config is None and (mechanisms_dir is None or templates_dir is None):
|
1027
|
+
raise ValueError(
|
1028
|
+
"Either a config file, both mechanisms_dir and templates_dir, or a hoc_cell must be provided."
|
1029
|
+
)
|
1030
|
+
|
1031
|
+
if config is None:
|
1032
|
+
neuron.load_mechanisms(mechanisms_dir)
|
1033
|
+
h.load_file(templates_dir)
|
1034
|
+
else:
|
1035
|
+
# this will load both mechs and templates
|
1036
|
+
load_templates_from_config(config)
|
988
1037
|
|
989
|
-
|
1038
|
+
# Use default general settings if not provided, merge with user-provided
|
1039
|
+
if general_settings is None:
|
1040
|
+
self.general_settings: dict = DEFAULT_GAP_JUNCTION_GENERAL_SETTINGS.copy()
|
1041
|
+
else:
|
1042
|
+
self.general_settings = {**DEFAULT_GAP_JUNCTION_GENERAL_SETTINGS, **general_settings}
|
990
1043
|
self.conn_type_settings = conn_type_settings
|
991
1044
|
|
992
|
-
h.tstop = general_settings["tstart"] + general_settings["tdur"] + 100.0
|
993
|
-
h.dt = general_settings["dt"] # Time step (resolution) of the simulation in ms
|
1045
|
+
h.tstop = self.general_settings["tstart"] + self.general_settings["tdur"] + 100.0
|
1046
|
+
h.dt = self.general_settings["dt"] # Time step (resolution) of the simulation in ms
|
994
1047
|
h.steps_per_ms = 1 / h.dt
|
995
|
-
h.celsius = general_settings["celsius"]
|
996
|
-
|
997
|
-
self.cell_name = conn_type_settings["cell"]
|
1048
|
+
h.celsius = self.general_settings["celsius"]
|
998
1049
|
|
999
1050
|
# set up gap junctions
|
1000
1051
|
pc = h.ParallelContext()
|
1001
1052
|
|
1002
|
-
|
1003
|
-
self.
|
1053
|
+
# Use provided hoc_cell or create new cells
|
1054
|
+
if self.hoc_cell is not None:
|
1055
|
+
self.cell1 = self.hoc_cell
|
1056
|
+
# For gap junctions, we need two cells, so create a second one if using hoc_cell
|
1057
|
+
self.cell_name = conn_type_settings["cell"]
|
1058
|
+
self.cell2 = getattr(h, self.cell_name)()
|
1059
|
+
else:
|
1060
|
+
self.cell_name = conn_type_settings["cell"]
|
1061
|
+
self.cell1 = getattr(h, self.cell_name)()
|
1062
|
+
self.cell2 = getattr(h, self.cell_name)()
|
1004
1063
|
|
1005
1064
|
self.icl = h.IClamp(self.cell1.soma[0](0.5))
|
1006
1065
|
self.icl.delay = self.general_settings["tstart"]
|
@@ -1247,6 +1306,10 @@ class SynapseOptimizer:
|
|
1247
1306
|
- max_amplitude: maximum synaptic response amplitude
|
1248
1307
|
- rise_time: time for synaptic response to rise from 20% to 80% of peak
|
1249
1308
|
- decay_time: time constant of synaptic response decay
|
1309
|
+
- latency: synaptic response latency
|
1310
|
+
- half_width: synaptic response half-width
|
1311
|
+
- baseline: baseline current
|
1312
|
+
- amp: peak amplitude from syn_props
|
1250
1313
|
"""
|
1251
1314
|
# Set these to 0 for when we return the dict
|
1252
1315
|
induction = 0
|
@@ -1255,11 +1318,22 @@ class SynapseOptimizer:
|
|
1255
1318
|
amp = 0
|
1256
1319
|
rise_time = 0
|
1257
1320
|
decay_time = 0
|
1321
|
+
latency = 0
|
1322
|
+
half_width = 0
|
1323
|
+
baseline = 0
|
1324
|
+
syn_amp = 0
|
1258
1325
|
|
1259
1326
|
if self.run_single_event:
|
1260
1327
|
self.tuner.SingleEvent(plot_and_print=False)
|
1261
|
-
|
1262
|
-
|
1328
|
+
# Use the attributes set by SingleEvent method
|
1329
|
+
rise_time = getattr(self.tuner, "rise_time", 0)
|
1330
|
+
decay_time = getattr(self.tuner, "decay_time", 0)
|
1331
|
+
# Get additional syn_props directly
|
1332
|
+
syn_props = self.tuner._get_syn_prop()
|
1333
|
+
latency = syn_props.get("latency", 0)
|
1334
|
+
half_width = syn_props.get("half_width", 0)
|
1335
|
+
baseline = syn_props.get("baseline", 0)
|
1336
|
+
syn_amp = syn_props.get("amp", 0)
|
1263
1337
|
|
1264
1338
|
if self.run_train_input:
|
1265
1339
|
self.tuner._simulate_model(self.train_frequency, self.train_delay)
|
@@ -1276,6 +1350,10 @@ class SynapseOptimizer:
|
|
1276
1350
|
"max_amplitude": float(amp),
|
1277
1351
|
"rise_time": float(rise_time),
|
1278
1352
|
"decay_time": float(decay_time),
|
1353
|
+
"latency": float(latency),
|
1354
|
+
"half_width": float(half_width),
|
1355
|
+
"baseline": float(baseline),
|
1356
|
+
"amp": float(syn_amp),
|
1279
1357
|
}
|
1280
1358
|
|
1281
1359
|
def _default_cost_function(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bmtool
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.4
|
4
4
|
Summary: BMTool
|
5
5
|
Home-page: https://github.com/cyneuro/bmtool
|
6
6
|
Download-URL:
|
@@ -36,6 +36,7 @@ Requires-Dist: requests
|
|
36
36
|
Requires-Dist: pyyaml
|
37
37
|
Requires-Dist: PyWavelets
|
38
38
|
Requires-Dist: numba
|
39
|
+
Requires-Dist: tqdm
|
39
40
|
Provides-Extra: dev
|
40
41
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
41
42
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
@@ -6,16 +6,16 @@ bmtool/graphs.py,sha256=gBTzI6c2BBK49dWGcfWh9c56TAooyn-KaiEy0Im1HcI,6717
|
|
6
6
|
bmtool/manage.py,sha256=lsgRejp02P-x6QpA7SXcyXdalPhRmypoviIA2uAitQs,608
|
7
7
|
bmtool/plot_commands.py,sha256=Dxm_RaT4CtHnfsltTtUopJ4KVbfhxtktEB_b7bFEXII,12716
|
8
8
|
bmtool/singlecell.py,sha256=I2yolbAnNC8qpnRkNdnDCLidNW7CktmBuRrcowMZJ3A,45041
|
9
|
-
bmtool/synapses.py,sha256
|
9
|
+
bmtool/synapses.py,sha256=-kg_TJoqXStIgE5iHpJWpXU6VRKT0YyIVpTw8frNbxA,69653
|
10
10
|
bmtool/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
bmtool/analysis/entrainment.py,sha256=NQloQtVpEWjDzmkZwMWVcm3hSjErHBZfQl1mrBVoIE8,25321
|
12
12
|
bmtool/analysis/lfp.py,sha256=S2JvxkjcK3-EH93wCrhqNSFY6cX7fOq74pz64ibHKrc,26556
|
13
13
|
bmtool/analysis/netcon_reports.py,sha256=VnPZNKPaQA7oh1q9cIatsqQudm4cOtzNtbGPXoiDCD0,2909
|
14
14
|
bmtool/analysis/spikes.py,sha256=3n-xmyEZ7w6CKEND7-aKOAvdDg0lwDuPI5sMdOuPwa0,24637
|
15
15
|
bmtool/bmplot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
bmtool/bmplot/connections.py,sha256=
|
16
|
+
bmtool/bmplot/connections.py,sha256=DwnnMp5cUwZC3OqsJqvgTPr4lBzc0sNWYRPmwij0WRk,59337
|
17
17
|
bmtool/bmplot/entrainment.py,sha256=BrBMerqyiG2YWAO_OEFv7OJf3yeFz3l9jUt4NamluLc,32837
|
18
|
-
bmtool/bmplot/lfp.py,sha256=
|
18
|
+
bmtool/bmplot/lfp.py,sha256=7JLozQQJ19ty0ZNyfhkuJAr_K8_pVP9C0flVJd_YXaY,2027
|
19
19
|
bmtool/bmplot/netcon_reports.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
20
|
bmtool/bmplot/spikes.py,sha256=odzCSMbFRHp9qthSGQ0WzMWUwNQ7R1Z6gLT6VPF_o5Q,15326
|
21
21
|
bmtool/debug/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -26,9 +26,9 @@ bmtool/util/commands.py,sha256=Nn-R-4e9g8ZhSPZvTkr38xeKRPfEMANB9Lugppj82UI,68564
|
|
26
26
|
bmtool/util/util.py,sha256=TAWdGd0tDuouS-JiusMs8WwP7kQpWHPr1nu0XG01TBQ,75056
|
27
27
|
bmtool/util/neuron/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
28
|
bmtool/util/neuron/celltuner.py,sha256=lokRLUM1rsdSYBYrNbLBBo39j14mm8TBNVNRnSlhHCk,94868
|
29
|
-
bmtool-0.7.
|
30
|
-
bmtool-0.7.
|
31
|
-
bmtool-0.7.
|
32
|
-
bmtool-0.7.
|
33
|
-
bmtool-0.7.
|
34
|
-
bmtool-0.7.
|
29
|
+
bmtool-0.7.4.dist-info/licenses/LICENSE,sha256=qrXg2jj6kz5d0EnN11hllcQt2fcWVNumx0xNbV05nyM,1068
|
30
|
+
bmtool-0.7.4.dist-info/METADATA,sha256=126Cn17YBt6twoBgMXYXK10kOWUXRhnLnGmPr7z7k_4,3595
|
31
|
+
bmtool-0.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
32
|
+
bmtool-0.7.4.dist-info/entry_points.txt,sha256=0-BHZ6nUnh0twWw9SXNTiRmKjDnb1VO2DfG_-oprhAc,45
|
33
|
+
bmtool-0.7.4.dist-info/top_level.txt,sha256=gpd2Sj-L9tWbuJEd5E8C8S8XkNm5yUE76klUYcM-eWM,7
|
34
|
+
bmtool-0.7.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|