Skip to content

Commit

Permalink
Merge pull request #280 from NeuroML/feat/nsg-netpyne
Browse files Browse the repository at this point in the history
fix(nsgr-netpyne): include model files in NSG zip also
  • Loading branch information
sanjayankur31 authored Nov 30, 2023
2 parents 43a4044 + ac54066 commit 89c4ed8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pyneuroml/nsgr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ def run_on_nsg(
generated_files = get_files_generated_after(
start_time, ignore_suffixes=["xml", "nml"]
)

# For NetPyNE, the channels are converted to NEURON mod files, but the
# network and cells are imported from the nml files.
# So we include all the model files too.
if engine == "jneuroml_netpyne":
generated_files.extend(model_file_list)

logger.debug(f"Generated files are: {generated_files}")

logger.info("Generating zip file")
Expand All @@ -199,7 +206,11 @@ def run_on_nsg(
if f.endswith("_netpyne.py"):
runner_file = f
fpath = pathlib.Path(f)
moved_path = fpath.rename(nsg_dir / fpath)
moved_path = nsg_dir / fpath
# use os.renames because pathlib.Path.rename does not move
# recursively and so cannot move files within directories
os.renames(fpath, moved_path)

archive.write(str(moved_path))

logger.debug("Printing testParam.properties")
Expand Down

0 comments on commit 89c4ed8

Please sign in to comment.