diff --git a/examples/Basic_Simulation/output_reader.py b/examples/Basic_Simulation/output_reader.py index 977c2a393..37942000a 100644 --- a/examples/Basic_Simulation/output_reader.py +++ b/examples/Basic_Simulation/output_reader.py @@ -28,7 +28,7 @@ import matplotlib.pyplot as plt # Read in the simulation output and store it as an Xarray dataset. -sim = swiftest.Simulation(read_old_output=True) +sim = swiftest.Simulation(read_data=True) # Plot of the data and save the output plot. colors = ['white' if x == 'Massive Body' else 'black' for x in sim.data['particle_type']] diff --git a/examples/Chambers2013/scattermovie.py b/examples/Chambers2013/scattermovie.py index 26bf46b70..39c44770f 100755 --- a/examples/Chambers2013/scattermovie.py +++ b/examples/Chambers2013/scattermovie.py @@ -113,7 +113,7 @@ def update(self,frame): return self.slist -sim = swiftest.Simulation(read_old_output=True) +sim = swiftest.Simulation(read_data=True) print('Making animation') anim = AnimatedScatter(sim.data,sim.param) print('Animation finished') diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index f5db48733..4e9368b72 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -44,7 +44,7 @@ class Simulation: This is a class that defines the basic Swift/Swifter/Swiftest simulation object """ - def __init__(self,read_param: bool = False, read_old_output: bool = False, simdir: os.PathLike | str = "simdata", **kwargs: Any): + def __init__(self,read_param: bool = False, read_data: bool = False, simdir: os.PathLike | str = "simdata", **kwargs: Any): """ Parameters @@ -66,7 +66,7 @@ def __init__(self,read_param: bool = False, read_old_output: bool = False, simdi inside the current working directory, which can be changed by passing `param_file` as an argument. - The argument has an equivalent parameter or set of parameters in the parameter input file. 3. Default values (see below) - read_old_output : bool, default False + read_data : bool, default False If true, read in a pre-existing binary input file given by the argument `output_file_name` if it exists. Parameter input file equivalent: None simdir : PathLike, default `"simdir"` @@ -341,8 +341,8 @@ def __init__(self,read_param: bool = False, read_old_output: bool = False, simdi # If the user asks to read in an old parameter file or output file, override any default parameters with values from the file # If the file doesn't exist, flag it for now so we know to create it param_file_found = False - if read_param or read_old_output: - if self.read_param(read_init_cond = not read_old_output): + if read_param or read_data: + if self.read_param(read_init_cond = not read_data): # We will add the parameter file to the kwarg list. This will keep the set_parameter method from # overriding everything with defaults when there are no arguments passed to Simulation() kwargs['param_file'] = self.param_file @@ -362,7 +362,7 @@ def __init__(self,read_param: bool = False, read_old_output: bool = False, simdi self.write_param() # Read in an old simulation file if requested - if read_old_output: + if read_data: binpath = os.path.join(self.simdir, self.param['BIN_OUT']) if os.path.exists(binpath): self.read_output_file() @@ -746,7 +746,7 @@ def set_parameter(self, verbose: bool = True, **kwargs): "init_cond_file_type": "NETCDF_DOUBLE", "init_cond_file_name": None, "init_cond_format": "EL", - "read_old_output": False, + "read_data": False, "output_file_type": "NETCDF_DOUBLE", "output_file_name": None, "output_format": "XVEL",