Skip to content

Commit

Permalink
Fixing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Oct 23, 2023
1 parent 65c7c6c commit d869031
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions snudda/detect/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,10 @@ def connect_projection_helper(self, pre_neuron_type, post_neuron_type, connectio
target_name = [post_name_list[x] for x in d_idx]
axon_dist = d[d_idx]

n_synapses = self.rng.normal(number_of_synapses[0],
number_of_synapses[1],
len(target_id)).astype(int)
n_synapses = np.maximum(0, self.rng.normal(number_of_synapses[0],
number_of_synapses[1],
len(target_id))).astype(int)


for t_id, t_name, n_syn, ax_dist in zip(target_id, target_name, n_synapses, axon_dist):

Expand All @@ -272,8 +273,8 @@ def connect_projection_helper(self, pre_neuron_type, post_neuron_type, connectio

# We are not guaranteed to get n_syn positions, so use len(sec_x) to get how many after
# TODO: Fix so dendrite_input_locations always returns n_syn synapses
xyz, sec_id, sec_x, dist_to_soma = morph.dendrite_input_locations(dendrite_synapse_density,
self.rng,
xyz, sec_id, sec_x, dist_to_soma = morph.dendrite_input_locations(synapse_density_str=dendrite_synapse_density,
rng=self.rng,
num_locations=n_syn)

# We need to convert xyz into voxel coordinates to match data format of synapse matrix
Expand Down

0 comments on commit d869031

Please sign in to comment.