@@ -1021,24 +1021,23 @@ def _buildFileOutput( self ):
10211021 # Should check for duplication.
10221022 nsdfPath = fileBase .path + '/' + oname
10231023 if fentry .field in ["n" , "conc" ]:
1024- if fentry .basepath [:4 ] == 'chem' : #chem itself as compt
1025- modelPath = self .modelPath
1024+ modelPath = self .modelPath + "/chem"
1025+ basePath = modelPath + "/" + fentry .path
1026+ if fentry .path [- 1 ] in [']' , '#' ]: # explicit index
1027+ pathStr = basePath + "." + fentry .field
10261028 else :
1027- modelPath = self .modelPath + "/chem"
1028- basePath = modelPath + "/" + fentry .basepath
1029- pathStr = basePath + '/' + fentry .relpath + "[]." + fentry .field
1029+ pathStr = basePath + "[]." + fentry .field
10301030 else :
10311031 modelPath = self .modelPath + "/elec"
1032- if fentry .basepath in ["elec" , "#" , "." ]:
1033- fentry .basepath = "##[ISA=CompartmentBase]"
1034- elif fentry .basepath in ["spine" , "SPINE" , "head" , "HEAD" ]:
1035- fentry .basepath = "#head#[ISA=CompartmentBase]"
1032+ spl = fentry .path .split ('/' )
1033+ if spl [0 ] == "#" :
1034+ if len ( spl ) == 1 :
1035+ fentry .path = "##[ISA=CompartmentBase]"
1036+ else :
1037+ fentry .path = "##[ISA=CompartmentBase]" + fentry .path [1 :]
10361038 # Otherwise we use basepath as is.
1037- basePath = modelPath + "/" + fentry .basepath
1038- if fentry .relpath in ["." , "/" , "./" ]:
1039- pathStr = basePath + "." + fentry .field
1040- else :
1041- pathStr = basePath + '/' + fentry .relpath + "." + fentry .field
1039+ basePath = modelPath + "/" + fentry .path
1040+ pathStr = basePath + "." + fentry .field
10421041 if not nsdfPath in nsdfBlocks :
10431042 self .nsdfPathList .append ( nsdfPath )
10441043 nsdfBlocks [nsdfPath ] = [pathStr ]
@@ -1262,7 +1261,7 @@ def _buildStims( self ):
12621261 }
12631262 stims = moose .Neutral ( self .modelPath + '/stims' )
12641263 k = 0
1265- # rstim class has {elecpath, geom_expr, relpath, field, expr }
1264+ # rstim class has {fname, path, field, dt, flush_steps }
12661265 for i in self .stimList :
12671266 pair = i .elecpath + " " + i .geom_expr
12681267 dendCompts = self .elecid .compartmentsFromExpression [ pair ]
@@ -1965,10 +1964,12 @@ def convertArg( arg ):
19651964
19661965class rfile :
19671966 def __init__ ( self ,
1968- fname = 'output.h5' , basepath = 'elec' , relpath = '. ' , field = 'Vm' , dt = 1e-4 , flushSteps = 200 , start = 0.0 , stop = - 1.0 , ftype = 'nsdf' ):
1967+ fname = 'output.h5' , path = 'soma ' , field = 'Vm' , dt = 1e-4 , flushSteps = 200 , start = 0.0 , stop = - 1.0 , ftype = 'nsdf' ):
19691968 self .fname = fname
1970- self .basepath = basepath
1971- self .relpath = relpath
1969+ self .path = path
1970+ if not field in knownFieldsDefault :
1971+ print ( "Error: Field '{}' not known." .format ( field ) )
1972+ assert ( 0 )
19721973 self .field = field
19731974 self .dt = dt
19741975 self .flushSteps = flushSteps
@@ -1977,11 +1978,12 @@ def __init__( self,
19771978 self .ftype = self .fname .split ("." )[- 1 ]
19781979 if not self .ftype in ["txt" , "csv" , "h5" , "nsdf" ]:
19791980 print ( "Error: output file format for " , fname , " not known" )
1981+ assert ( 0 )
19801982 self .fname = self .fname .split ("/" )[- 1 ]
19811983
19821984 def printme ( self ):
1983- print ( "{0}, {1}, {2}, {3}, {4} " .format (
1984- self .fname , self .basepath , self . relpath , self .field , self .dt ) )
1985+ print ( "{0}, {1}, {2}, {3}" .format (
1986+ self .fname , self .path , self .field , self .dt ) )
19851987
19861988 @staticmethod
19871989 def convertArg ( arg ):
0 commit comments