Skip to content

Commit

Permalink
Sorting list of keys, to make sure order is the same
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Oct 23, 2023
1 parent c3d36f3 commit cc638a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions snudda/neurons/neuron_prototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_parameter_key(self, parameter_id):
# f"\nNeuron path: {self.neuron_path}")

if self.parameter_info:
par_key_list = list(self.parameter_info.keys())
par_key_list = sorted(list(self.parameter_info.keys()))
par_key = par_key_list[parameter_id % len(par_key_list)]
else:
par_key = None
Expand All @@ -171,7 +171,7 @@ def get_morph_key(self, morphology_id, parameter_id=None, parameter_key=None):

if self.meta_info:
assert par_key in self.meta_info, f"Parameter key {par_key} missing in {self.meta_path}"
morph_key_list = list(self.meta_info[par_key].keys())
morph_key_list = sorted(list(self.meta_info[par_key].keys()))
assert len(morph_key_list) > 0, f"No morphologies available for parameter key {par_key} in {self.meta_path}"
morph_key = morph_key_list[morphology_id % len(morph_key_list)]
else:
Expand Down
1 change: 1 addition & 0 deletions snudda/place/region_mesh_redux.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_line_set(self, neurons):

return line_sets


class NeuronPlacer:

def __init__(self, mesh_path: str, d_min: float, random_seed=None, rng=None,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_degeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ def test_something(self):
#import pdb
#pdb.set_trace()

# self.assertEqual(orig_load.data["nSynapses"], 165)
self.assertEqual(orig_load.data["nSynapses"], 165)

# Verify that it should be 99 synapses -- now it is just a regression test
# Old version gave 99, new gives 165 --- CHECK WHY!

# TODO: CHECK WHY NOT 99 SYNAPSES NOW
# self.assertEqual(degen_load.data["nSynapses"], 155) # -- Ilaria, we need to check what the true value should be?
self.assertEqual(degen_load.data["nSynapses"], 155) # -- Ilaria, we need to check what the true value should be?


if __name__ == '__main__':
Expand Down

0 comments on commit cc638a8

Please sign in to comment.