Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Dec 2, 2024
1 parent dc9efef commit fdd839c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions region_grower/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from neuroc.scale import scale_section # noqa: E402 ; pylint: disable=C0413
from neurots import NeuronGrower # noqa: E402 ; pylint: disable=C0413
from neurots import NeuroTSError # noqa: E402 ; pylint: disable=C0413
from neurots.utils import PIA_DIRECTION # noqa: E402 ; pylint: disable=C0413
from neurots.utils import Y_DIRECTION # noqa: E402 ; pylint: disable=C0413
from voxcell.cell_collection import CellCollection # noqa: E402 ; pylint: disable=C0413

from region_grower import RegionGrowerError # noqa: E402 ; pylint: disable=C0413
Expand Down Expand Up @@ -85,7 +85,7 @@ def lookup_orientation(self, vector: Optional[Point] = None) -> np.array:
If orientation is None, the direction is assumed towards the pia.
"""
return np.dot(self.orientation, vector)[0] if vector else PIA_DIRECTION
return np.dot(self.orientation, vector)[0] if vector else Y_DIRECTION


@attr.s(auto_attribs=True)
Expand Down Expand Up @@ -197,7 +197,7 @@ def _correct_position_orientation_scaling(self, params_orig: Dict) -> Dict:

for neurite_type in params["grow_types"]:
if isinstance(params[neurite_type]["orientation"], dict):
params["pia_direction"] = self.cell.lookup_orientation(PIA_DIRECTION).tolist()
params["pia_direction"] = self.cell.lookup_orientation(Y_DIRECTION).tolist()
if isinstance(params[neurite_type]["orientation"], list):
params[neurite_type]["orientation"] = [
self.cell.lookup_orientation(orient).tolist()
Expand Down Expand Up @@ -249,7 +249,7 @@ def _post_growth_rescaling(self, grower: NeuronGrower, params: Dict) -> None:

scale = modify.output_scaling(
root_section,
self.cell.orientation.dot(PIA_DIRECTION)[0],
self.cell.orientation.dot(Y_DIRECTION)[0],
target_min_length=target_min_length,
target_max_length=target_max_length,
)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import region_grower
from region_grower import RegionGrowerError
from region_grower import SkipSynthesisError
from region_grower.context import PIA_DIRECTION
from region_grower.context import Y_DIRECTION
from region_grower.context import SpaceWorker
from region_grower.context import SynthesisParameters

Expand All @@ -41,7 +41,7 @@ class TestCellState:

def test_lookup_orientation(self, cell_state):
"""Test the `lookup_orientation()` method."""
assert cell_state.lookup_orientation() == PIA_DIRECTION
assert cell_state.lookup_orientation() == Y_DIRECTION
vectors = [
[1, 0, 0],
[0, 1, 0],
Expand Down Expand Up @@ -456,7 +456,7 @@ def test_scale(self, small_context_worker, tmd_parameters):

# pylint: disable=protected-access
fixed_params = small_context_worker._correct_position_orientation_scaling(params)
assert fixed_params["pia_direction"] == PIA_DIRECTION
assert fixed_params["pia_direction"] == Y_DIRECTION

def test_debug_scales(self, small_context_worker, tmd_parameters):
"""Test debug logger."""
Expand Down

0 comments on commit fdd839c

Please sign in to comment.