Skip to content

Commit

Permalink
introduce option to pass xyzr
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldeistler committed Dec 6, 2023
1 parent bb8f9e0 commit 68dba2e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions jaxley/modules/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,19 @@ class Cell(Module):
cell_params: Dict = {}
cell_states: Dict = {}

def __init__(self, branches: Union[Branch, List[Branch]], parents: List):
def __init__(
self,
branches: Union[Branch, List[Branch]],
parents: List,
xyzr: Optional[Union[np.ndarray, jnp.ndarray]],
):
"""Initialize a cell.
Args:
branches:
parents:
xyzr: The x, y, and z coordinates and the radius at these coordinates.
"""
super().__init__()
assert isinstance(branches, Branch) or len(parents) == len(
branches
Expand Down Expand Up @@ -249,7 +261,7 @@ def read_swc(

comp = Compartment().initialize()
branch = Branch([comp for _ in range(nseg)]).initialize()
cell = Cell([branch for _ in range(nbranches)], parents=parents)
cell = Cell([branch for _ in range(nbranches)], parents=parents, xyzr=None)

radiuses = np.flip(
np.asarray([radius_fns[b](range_) for b in range(len(parents))]), axis=1
Expand Down

0 comments on commit 68dba2e

Please sign in to comment.