@@ -131,7 +131,7 @@ def safe_literal_eval(filename, defaultValue):
131131# Parameter Parsing
132132# ===================================================================
133133try :
134- sparams_path = os .path .join (inpath + "1" , "concore.params" )
134+ sparams_path = os .path .join (inpath , "1" , "concore.params" )
135135 if os .path .exists (sparams_path ):
136136 with open (sparams_path , "r" ) as f :
137137 sparams = f .read ()
@@ -171,7 +171,7 @@ def tryparam(n, i):
171171def default_maxtime (default ):
172172 """Read maximum simulation time from file or use default."""
173173 global maxtime
174- maxtime_path = os .path .join (inpath + "1" , "concore.maxtime" )
174+ maxtime_path = os .path .join (inpath , "1" , "concore.maxtime" )
175175 maxtime = safe_literal_eval (maxtime_path , default )
176176
177177default_maxtime (100 )
@@ -220,7 +220,7 @@ def read(port_identifier, name, initstr_val):
220220 return default_return_val
221221
222222 time .sleep (delay )
223- file_path = os .path .join (inpath + str (file_port_num ), name )
223+ file_path = os .path .join (inpath , str (file_port_num ), name )
224224 ins = ""
225225
226226 try :
@@ -287,10 +287,10 @@ def write(port_identifier, name, val, delta=0):
287287 # Case 2: File-based port
288288 try :
289289 if isinstance (port_identifier , str ) and port_identifier in zmq_ports :
290- file_path = os .path .join ("../" + port_identifier , name )
290+ file_path = os .path .join (".." , port_identifier , name )
291291 else :
292292 file_port_num = int (port_identifier )
293- file_path = os .path .join (outpath + str (file_port_num ), name )
293+ file_path = os .path .join (outpath , str (file_port_num ), name )
294294 except ValueError :
295295 print (f"Error: Invalid port identifier '{ port_identifier } ' for file operation. Must be integer or ZMQ name." )
296296 return
0 commit comments