Skip to content

Commit

Permalink
lint/format
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Dec 3, 2024
1 parent 194a288 commit ad77627
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions region_grower/atlas_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, atlas: Atlas, region_structure_path: str):
if region_structure_path is not None and Path(region_structure_path).exists():
with open(region_structure_path, "r", encoding="utf-8") as region_file:
self.region_structure = yaml.safe_load(region_file)
self.region_structure_base_path = Path(region_structure_path).parent
else:
raise ValueError(f"region_structure file not found at {region_structure_path}.")

Expand Down
12 changes: 5 additions & 7 deletions region_grower/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
from neurots import NeuronGrower # noqa: E402 ; pylint: disable=C0413
from neurots import NeuroTSError # noqa: E402 ; pylint: disable=C0413
from neurots.utils import Y_DIRECTION # noqa: E402 ; pylint: disable=C0413
from voxcell import VoxcellError # noqa: E402 ; pylint: disable=C0413
from voxcell.cell_collection import CellCollection # noqa: E402 ; pylint: disable=C0413
from voxcell.voxel_data import OrientationField # noqa: E402 ; pylint: disable=C0413
from voxcell import VoxcellError # noqa: E402 ; pylint: disable=C0413

from region_grower import RegionGrowerError # noqa: E402 ; pylint: disable=C0413
from region_grower import SkipSynthesisError # noqa: E402 ; pylint: disable=C0413
Expand Down Expand Up @@ -106,7 +106,7 @@ class SpaceContext:
soma_position: float = None
soma_depth: float = None
boundaries: List = None
directions: Dict = None
directions: List = None
atlas_info: Dict = {} # voxel_dimensions, offset and shape from atlas for indices conversion
orientations = None
mesh = None
Expand All @@ -126,7 +126,7 @@ def positions_to_indices(self, positions):
def get_direction(self, cell):
"""Get direction data for the given mtype."""
directions = []
for direction in self.directions:
for direction in self.directions: # pylint: disable=not-an-iterable
mtypes = direction.get("mtypes", None)
if mtypes is not None and cell.mtype not in mtypes:
continue
Expand Down Expand Up @@ -451,10 +451,8 @@ def _correct_position_orientation_scaling(self, params_orig: Dict) -> Dict:
if self.context.directions is not None:
if isinstance(self.context.directions, str):
self.context.directions = json.loads(self.context.directions)
for i, direction in enumerate(self.context.directions):
self.context.directions[i]["y_direction"] = self.cell.lookup_orientation(
Y_DIRECTION
).tolist()
for direction in self.context.directions:
direction["y_direction"] = self.cell.lookup_orientation(Y_DIRECTION).tolist()

if self.context.boundaries is not None:
boundaries = json.loads(self.context.boundaries)
Expand Down
3 changes: 1 addition & 2 deletions region_grower/synthesize_morphologies.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
from region_grower.context import SpaceContext
from region_grower.context import SpaceWorker
from region_grower.context import SynthesisParameters
from region_grower.context import SynthesisResult
from region_grower.morph_io import MorphLoader
from region_grower.morph_io import MorphWriter
from region_grower.utils import assign_morphologies
Expand Down Expand Up @@ -519,7 +518,7 @@ def _close_parallel(self):
self._parallel_client.close()
self._parallel_client = None

def assign_atlas_data(self, min_depth=25, max_depth=5000):
def assign_atlas_data(self, min_depth=25, max_depth=5000): # pylint: disable=too-many-locals
"""Open an Atlas and compute depths and orientations according to the given positions."""
self.cells_data["current_depth"] = np.nan
self.cells_data["layer_depths"] = pd.Series(
Expand Down

0 comments on commit ad77627

Please sign in to comment.