Skip to content

Commit ae7d8f0

Browse files
Merge pull request #429 from NeuroML/experimental
Fixes for validating - should be possible to validate xml files as nml too...
2 parents d088537 + 74a186a commit ae7d8f0

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

pyneuroml/pynml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,13 +874,13 @@ def _evaluate_arguments(args):
874874

875875
exit(0)
876876
elif args.validate:
877-
file_types = ["nml"]
877+
file_types = ["nml","xml"]
878878
pre_args = "-validate"
879879
exit_on_fail = True
880880
run_multi = True
881881

882882
elif args.validatev1:
883-
file_types = ["nml"]
883+
file_types = ["nml","xml"]
884884
pre_args = "-validatev1"
885885
exit_on_fail = True
886886
run_multi = True

pyneuroml/runners.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -770,14 +770,11 @@ def run_jneuroml(
770770
return False
771771

772772
if report_jnml_output:
773-
logger.debug(
773+
logger.info(
774774
"Successfully ran the following command using pyNeuroML v%s: \n %s"
775775
% (__version__, command)
776776
)
777-
logger.debug("Output:\n\n%s" % output)
778-
779-
# except KeyboardInterrupt as e:
780-
# raise e
777+
logger.info("Output:\n\n%s" % output)
781778

782779
except Exception as e:
783780
logger.error("*** Execution of jnml has failed! ***")

pyneuroml/utils/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@
3535
logger = logging.getLogger(__name__)
3636
logger.setLevel(logging.INFO)
3737

38-
try:
39-
import libsedml
40-
except ModuleNotFoundError:
41-
logger.warning("Please install optional dependencies to use SED-ML features:")
42-
logger.warning("pip install pyneuroml[combine]")
43-
4438

4539
MAX_COLOUR = (255, 0, 0) # type: typing.Tuple[int, int, int]
4640
MIN_COLOUR = (255, 255, 0) # type: typing.Tuple[int, int, int]
@@ -721,6 +715,13 @@ def get_model_file_list(
721715
lems_def_dir = get_model_file_list(inc, filelist, rootdir, lems_def_dir)
722716

723717
elif rootfile.endswith(".sedml"):
718+
719+
try:
720+
import libsedml
721+
except ModuleNotFoundError:
722+
logger.error("Please install optional dependencies to use SED-ML features:")
723+
logger.error("pip install pyneuroml[combine]")
724+
724725
if pathlib.Path(rootfile).is_absolute():
725726
rootdoc = libsedml.readSedMLFromFile(rootfile)
726727
else:

0 commit comments

Comments
 (0)