Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nsgr-netpyne): include model files in NSG zip also #280

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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