Skip to content

Commit dc3a435

Browse files
authored
Merge pull request #128 from NeuroML/feat/test_latest_libnml
To v0.5.18
2 parents 061a522 + 4fe023d commit dc3a435

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

pyneuroml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
__version__ = "0.5.13"
3+
__version__ = "0.5.18"
44

55
JNEUROML_VERSION = "0.11.0"
66

pyneuroml/lems/__init__.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,29 @@ def generate_lems_file_for_neuroml(
148148
shutil.copy(incl_curr, target_dir)
149149

150150
ls.include_neuroml2_file(include.href, include_included=False)
151-
sub_doc = read_neuroml2_file(incl_curr)
152-
sub_dir = (
153-
os.path.dirname(incl_curr)
154-
if len(os.path.dirname(incl_curr)) > 0
155-
else "."
156-
)
157-
158-
if sub_doc.__class__ == neuroml.nml.nml.NeuroMLDocument:
159-
for include in sub_doc.includes:
160-
incl_curr = "%s/%s" % (sub_dir, include.href)
161-
logger.info(
162-
" -- Including %s located at %s" % (include.href, incl_curr)
163-
)
151+
try:
152+
sub_doc = read_neuroml2_file(incl_curr)
153+
sub_dir = (
154+
os.path.dirname(incl_curr)
155+
if len(os.path.dirname(incl_curr)) > 0
156+
else "."
157+
)
158+
159+
if sub_doc.__class__ == neuroml.nml.nml.NeuroMLDocument:
160+
for include in sub_doc.includes:
161+
incl_curr = "%s/%s" % (sub_dir, include.href)
162+
logger.info(
163+
" -- Including %s located at %s" % (include.href, incl_curr)
164+
)
164165

165-
if not os.path.isfile(
166-
"%s/%s" % (target_dir, os.path.basename(incl_curr))
167-
) and not os.path.isfile("%s/%s" % (target_dir, incl_curr)):
166+
if not os.path.isfile(
167+
"%s/%s" % (target_dir, os.path.basename(incl_curr))
168+
) and not os.path.isfile("%s/%s" % (target_dir, incl_curr)):
168169

169-
shutil.copy(incl_curr, target_dir)
170-
ls.include_neuroml2_file(include.href, include_included=False)
170+
shutil.copy(incl_curr, target_dir)
171+
ls.include_neuroml2_file(include.href, include_included=False)
172+
except TypeError:
173+
logging.info("File: %s is not a NeuroML file, but it may be LEMS, ignoring..." % incl_curr)
171174

172175
if (
173176
gen_plots_for_all_v

0 commit comments

Comments
 (0)