diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index 60bfc4de0..0f9941066 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -129,7 +129,6 @@ def str2bool(input_str): raise ValueError(f"{input_str} is not recognized as boolean") - def real2float(realstr): """ Converts a Fortran-generated ASCII string of a real value into a numpy float type. Handles cases where double precision @@ -199,6 +198,7 @@ def read_swiftest_param(param_file_name, param, verbose=True): print(f"{param_file_name} not found.") return param + def reorder_dims(ds): # Re-order dimension coordinates so that they are in the same order as the Fortran side @@ -212,6 +212,8 @@ def reorder_dims(ds): idx = {index_name: idx[index_name] for index_name in dim_order} ds = ds.reindex(idx) return ds + + def read_swifter_param(param_file_name, verbose=True): """ Reads in a Swifter param.in file and saves it as a dictionary diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 4e9368b72..64cad6c6d 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -342,7 +342,7 @@ def __init__(self,read_param: bool = False, read_data: bool = False, simdir: os. # 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_data: - if self.read_param(read_init_cond = not read_data): + if self.read_param(read_init_cond = 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