diff --git a/neurots/generate/orientations.py b/neurots/generate/orientations.py index 3d469cf0..458a7392 100644 --- a/neurots/generate/orientations.py +++ b/neurots/generate/orientations.py @@ -235,7 +235,10 @@ def _mode_normal_pia_constraint(self, values_dict, tree_type): Pia direction can be overwritten by the parameter 'pia_direction' value. """ n_orientations = sample.n_neurites(self._distributions[tree_type]["num_trees"], self._rng) - if len(values_dict["direction"]["mean"]) == n_orientations: + if ( + isinstance(values_dict["direction"]["mean"], list) + and len(values_dict["direction"]["mean"]) == n_orientations + ): # to force the direction of possibly 2 apicals, otherwise it is for basals n_orientations = 1