Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed problem with argument read_old_output_file when it is not supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 29, 2022
1 parent 57b140f commit 1603e3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Simulation:
This is a class that defines the basic Swift/Swifter/Swiftest simulation object
"""

def __init__(self,read_param: bool = False, **kwargs: Any):
def __init__(self,read_param: bool = False, read_old_output_file: bool = False, **kwargs: Any):
"""
Parameters
Expand All @@ -64,6 +64,10 @@ def __init__(self,read_param: bool = False, **kwargs: Any):
- The argument has an equivalent parameter or set of parameters in the parameter input file.
3. Default values (see below)
read_old_output_file : 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
**kwargs : See list of valid parameters and their defaults below
codename : {"Swiftest", "Swifter", "Swift"}, default "Swiftest"
Expand Down Expand Up @@ -140,9 +144,6 @@ def __init__(self,read_param: bool = False, **kwargs: Any):
Specifies the format for the data saved to the output file. If "XV" then cartesian position and velocity
vectors for all bodies are stored. If "XVEL" then the orbital elements are also stored.
Parameter input file equivalent: `OUT_FORM`
read_old_output_file : 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
MU : str, default "MSUN"
The mass unit system to use. Case-insensitive valid options are:
* "Msun" : Solar mass
Expand Down Expand Up @@ -344,7 +345,6 @@ def __init__(self,read_param: bool = False, **kwargs: Any):
self.write_param()

# Read in an old simulation file if requested
read_old_output_file = kwargs.pop("read_old_output_file",False)
if read_old_output_file:
binpath = os.path.join(self.sim_dir, self.param['BIN_OUT'])
if os.path.exists(binpath):
Expand Down

0 comments on commit 1603e3e

Please sign in to comment.