@@ -120,6 +120,9 @@ def get_runs(self) -> list["SimulationRun"]:
120120 run_ids = [int (str (d .name ).removeprefix ("run_" )) for d in dirs ]
121121 return [SimulationRun (id = run_id , sim = self ) for run_id in run_ids ]
122122
123+ def get_run (self , run_id : int ) -> "SimulationRun" :
124+ return SimulationRun (id = run_id , sim = self )
125+
123126 def simulate (
124127 self ,
125128 num_models : int ,
@@ -133,7 +136,6 @@ def simulate(
133136 parallel : bool = False ,
134137 num_nodes : int = 1 ,
135138 show_progress : bool = True ,
136- show_fargo_output : bool = False ,
137139 verbose : bool = False ,
138140 overwrite : bool = False ,
139141 ) -> None :
@@ -148,6 +150,8 @@ def simulate(
148150 else :
149151 run = SimulationRun (id = run_id , sim = self , resume_rng = resume )
150152
153+ print (f"------ STARTING RUN { run ._id } ------" )
154+
151155 start_idx = 0 if not resume else run .get_next_model_id ()
152156 for i in np .arange (start_idx , num_models ):
153157 try :
@@ -278,8 +282,7 @@ def simulate(
278282
279283 max_orbit_radius = distances .max ()
280284 param_config ["mesh_parameters.ymax" ] = (
281- mesh_parameters ["y_max_ratio" ]
282- * max_orbit_radius .to (self ._unit_system .length ).value
285+ mesh_parameters ["y_max_ratio" ] * max_orbit_radius
283286 )
284287
285288 param_config ["mesh_parameters.nx" ] = run .get_polar_img_size ()[1 ]
@@ -295,7 +298,9 @@ def orbital_period(mass, radius, G):
295298 return np .sqrt ((4 * np .pi ** 2 * radius ** 3 ) / (mass * G ))
296299
297300 period = orbital_period (
298- mass = m_star , radius = max_orbit_radius , G = self ._constants ["G" ]
301+ mass = m_star ,
302+ radius = max_orbit_radius * self ._unit_system .length ,
303+ G = self ._constants ["G" ],
299304 )
300305
301306 total_time = num_orbits * period
@@ -364,7 +369,7 @@ def toml_serialize_dict(read_dict):
364369 model_id = model ._id ,
365370 show_progress = show_progress ,
366371 verbose = verbose ,
367- show_fargo_output = show_fargo_output ,
372+ show_fargo_output = verbose ,
368373 )
369374
370375 self ._setup .run (
@@ -373,14 +378,18 @@ def toml_serialize_dict(read_dict):
373378 parallel = parallel ,
374379 show_progress = show_progress ,
375380 cuda_device_id = cuda_device_id ,
381+ verbose = verbose ,
376382 )
377383
378384 # Move the data files to the correct directory
379385 model .get_data_directory ().mkdir ()
380- shutil .move (
381- src = Variables .get ("FARGO_ROOT" ) / model .get_fargo_output_path (),
382- dst = model .get_data_directory (),
383- )
386+ for file in (
387+ Variables .get ("FARGO_ROOT" ) / model .get_fargo_output_path ()
388+ ).glob ("*.*" ):
389+ shutil .move (
390+ src = file ,
391+ dst = model .get_data_directory (),
392+ )
384393 shutil .rmtree (
385394 path = Variables .get ("FARGO_ROOT" ) / model .get_fargo_output_path ()
386395 )
0 commit comments