Skip to content

Commit 23ee042

Browse files
committed
Updates to handle most of the ephys demos in TestJson
1 parent d0a6acc commit 23ee042

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

simWrapMoose.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import numpy as np
3333
import moose
3434
import sys
35+
from importlib import util
3536

3637
# import imp ## May be deprecated from Python 3.4
3738
# from simWrap import SimWrap
@@ -379,9 +380,15 @@ def loadModelFile( self, fname, modifyFunc, scaleParam, dumpFname, paramFname ):
379380
# Following the load() command, the chemical system for the
380381
# model must live under
381382
# /library/chem
383+
spec = util.spec_from_file_location("mscript", fname )
384+
mscript = util.module_from_spec(spec)
385+
spec.loader.exec_module(mscript)
386+
rdes = mscript.load()
387+
'''
388+
# Deprecated Python syntax from pre 3.3
382389
mscript = imp.load_source( "mscript", fname )
383-
#mscript = __import__( fileName )
384390
rdes = mscript.load()
391+
'''
385392
if not moose.exists( '/library/chem' ):
386393
if ( moose.exists( '/library/cell' ) ):
387394
self.modelId = moose.element( '/library/cell' )

0 commit comments

Comments
 (0)