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

Commit

Permalink
Merge branch 'debug' into IntelAdvisor
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 2, 2021
2 parents 122ba7d + 744949f commit 1381c23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
from datetime import date
import xarray as xr
import numpy as np
import os

class Simulation:
"""
This is a class that define the basic Swift/Swifter/Swiftest simulation object
"""
def __init__(self, codename="Swiftest", param_file=""):
def __init__(self, codename="Swiftest", param_file="", readbin=True):
self.ds = xr.Dataset()
self.param = {
'! VERSION': f"Swiftest parameter input",
Expand Down Expand Up @@ -55,6 +56,11 @@ def __init__(self, codename="Swiftest", param_file=""):
self.codename = codename
if param_file != "" :
self.read_param(param_file, codename)
if readbin:
if os.path.exists(self.param['BIN_OUT']):
self.bin2xr()
else:
print(f"BIN_OUT file {self.param['BIN_OUT']} not found.")
return


Expand Down

0 comments on commit 1381c23

Please sign in to comment.