Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit a76041a

Browse files
Merge pull request #440 from AurelienJaquier/nml-smallfixes
neuroml small improvements
2 parents 3527f55 + 40b0f5c commit a76041a

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

bluepyopt/neuroml/biophys.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ def add_nml_channel_to_nml_cell_file(
192192
channel_nml2_file = f"{channel_name}.channel.nml"
193193

194194
if channel_nml2_file not in included_channels:
195-
nml_mech_dir = get_nml_mech_dir()
196195
channel_new_path = Path(channel_dir) / channel_nml2_file
197196
cell_doc.includes.append(neuroml.IncludeType(href=channel_new_path))
198197

199198
# for some reason, pynml cannot accept absolute paths in IncludeType,
200199
# so copy paste files in current directory for the simulation to work
201200
if not skip_channels_copy:
202201
Path(channel_dir).mkdir(exist_ok=True)
203-
channel_path = Path(nml_mech_dir) / channel_nml2_file
202+
nml_mech_dir = Path(get_nml_mech_dir())
203+
channel_path = nml_mech_dir / channel_nml2_file
204204
if channel_path.is_file():
205205
shutil.copy(channel_path, channel_new_path)
206206

@@ -336,7 +336,7 @@ def get_density(
336336
337337
Arguments:
338338
cell_doc (NeuroMLDocument): nml document of the cell model
339-
cell (ephys.CellModel)
339+
cell (ephys.CellModel): bluepyopt cell
340340
parameter (ephys.parameters)
341341
section_list (str): location
342342
included_channels (list): list of channels already included
@@ -417,10 +417,10 @@ def get_biophys(
417417
"""Get biophys in neuroml format.
418418
419419
Arguments:
420-
cell (ephys.CellModel)
420+
cell (ephys.CellModel): bluepyopt cell
421421
cell_doc (NeuroMLDocument): nml document of the cell model
422-
skip_non_uniform (bool): True to skip non uniform distributions
423422
release_params (dict): optimized parameters
423+
skip_non_uniform (bool): True to skip non uniform distributions
424424
skip_channels_copy (bool): True to skip the copy pasting
425425
of the neuroml channel files
426426
"""

bluepyopt/neuroml/cell.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ def create_neuroml_cell(bpo_cell, release_params, skip_channels_copy=False):
3131
"""Create the cell.
3232
3333
Arguments:
34-
nml_mech_files (list): paths to the nml files
35-
containing the mechanisms
36-
bpo_cell
34+
bpo_cell (ephys.CellModel): bluepyopt cell
3735
release_params (dict): the optimized parameters
3836
skip_channels_copy (bool): True to skip the copy pasting
3937
of the neuroml channel files

bluepyopt/neuroml/morphology.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@
2828
def create_loadcell_hoc(
2929
loadcell_hoc_filename, hoc_filename, morphology_path, v_init, cell_name
3030
):
31-
"""Create a hoc file able to load the cell."""
31+
"""Create a hoc file able to load the cell.
32+
33+
Arguments:
34+
loadcell_hoc_filename (str): path to the loadcell hoc file to output
35+
hoc_filename (str): file name of the cell hoc file
36+
morphology_path (str): path to the morphology file
37+
v_init (float): inital voltage in mV
38+
cell_name (str): cell name
39+
"""
3240
morph_path = Path(morphology_path)
3341
morph_dir = morph_path.parent
3442
morph_file = morph_path.name
@@ -56,7 +64,13 @@ def create_loadcell_hoc(
5664

5765

5866
def create_morph_nml(bpo_cell, network_filename, release_params):
59-
"""Create cell hoc file, then cell nml file."""
67+
"""Create cell hoc file, then cell nml file.
68+
69+
Arguments:
70+
bpo_cell (ephys.CellModel): bluepyopt cell
71+
network_filename (str): name of the neuroml network file
72+
release_params (dict): name and values of optimised parameters
73+
"""
6074
import pebble
6175

6276
hoc_filename = f"{bpo_cell.name}.hoc"

examples/neuroml/neuroml.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@
2929
]
3030
},
3131
{
32+
"attachments": {},
3233
"cell_type": "markdown",
3334
"id": "63d69fd0-dd92-424b-b38a-be50f03e3dd7",
3435
"metadata": {},
3536
"source": [
3637
"Note that the bluepyopt neuroml module cannot yet handle:\n",
3738
"- non uniform parameter\n",
38-
"- axon replacement"
39+
"- axon replacement\n",
40+
"- stochasticity"
3941
]
4042
},
4143
{

0 commit comments

Comments
 (0)