Skip to content

Fix pynml archive #434

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

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions pyneuroml/archive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import typing
from zipfile import ZipFile

from pyneuroml.utils import get_model_file_list
from pyneuroml.utils.cli import build_namespace
from pyneuroml.runners import run_jneuroml
from pyneuroml.sedml import validate_sedml_files
from pyneuroml.utils import get_model_file_list
from pyneuroml.utils.cli import build_namespace

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -88,7 +88,7 @@ def cli(a: typing.Optional[typing.Any] = None, **kwargs: str):
a = build_namespace(DEFAULTS, a, **kwargs)

rootfile = a.rootfile
zipfile_extension = None
zipfile_extension = ".neux.zip"

# first generate SED-ML file
# use .omex as extension
Expand All @@ -99,7 +99,7 @@ def cli(a: typing.Optional[typing.Any] = None, **kwargs: str):
run_jneuroml("", a.rootfile, "-sedml")

rootfile = a.rootfile.replace(".xml", ".sedml")
zipfile_extension = ".omex"
zipfile_extension = ".omex.zip"

# validate the generated file
validate_sedml_files([rootfile])
Expand All @@ -119,7 +119,7 @@ def cli(a: typing.Optional[typing.Any] = None, **kwargs: str):
def create_combine_archive(
rootfile: str,
zipfile_name: typing.Optional[str] = None,
zipfile_extension=".neux",
zipfile_extension=".neux.zip",
filelist: typing.List[str] = [],
extra_files: typing.List[str] = [],
):
Expand Down
7 changes: 3 additions & 4 deletions tests/archive/test_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Copyright 2023 NeuroML contributors
"""


import logging
import pathlib
import unittest
Expand Down Expand Up @@ -109,7 +108,7 @@ def test_create_combine_archive(self):
rootfile=dirname + "/HH_example_cell.nml",
filelist=filelist,
)
self.assertTrue(pathlib.Path(dirname + "/HH_example.neux").exists())
self.assertTrue(pathlib.Path(dirname + "/HH_example.neux.zip").exists())

dirname = str(thispath.parent.parent.parent)
filelist = []
Expand All @@ -119,7 +118,7 @@ def test_create_combine_archive(self):
filelist=filelist,
)
self.assertTrue(
pathlib.Path(dirname + "/examples/LEMS_NML2_Ex5_DetCell.neux").exists()
pathlib.Path(dirname + "/examples/LEMS_NML2_Ex5_DetCell.neux.zip").exists()
)

dirname = str(thispath.parent.parent.parent)
Expand All @@ -130,5 +129,5 @@ def test_create_combine_archive(self):
filelist=filelist,
)
self.assertTrue(
pathlib.Path(dirname + "/examples/NML2_SingleCompHHCell.neux").exists()
pathlib.Path(dirname + "/examples/NML2_SingleCompHHCell.neux.zip").exists()
)
Loading