jdc = jdcfile.read()
params = jdc_to_dict(jdc, ["TELEMAC2D", "_F"])
+ yacs_scheme = generate_yacs_study(params)
+ file_dir, filename = os.path.split(filePath)
+ root, sfx = os.path.splitext(filename)
+ python_file = os.path.join(file_dir,root+".xml")
+
python_script = generate_study_script(params)
- print python_script
+ with open(python_file,'w') as pfile:
+ pfile.write(python_script)
def generate_study_yacs(self, filePath):
"""
Generating a yacs file from the eficas info
"""
# Create "Python script" item
- from TelApy.api.generate_study import generate_yacs_study
+ from TelApy.api.generate_study import generate_study_yacs
with open(filePath) as jdcfile:
jdc = jdcfile.read()
params = jdc_to_dict(jdc, ["TELEMAC2D", "_F"])
yacs_scheme = generate_yacs_study(params)
- file_dir = os.path.basename(filePath)
- root, sfx = filePath.splitext()
+ file_dir, filename = os.path.split(filePath)
+ root, sfx = os.path.splitext(filename)
yacs_file = os.path.join(file_dir,root+".xml")
- print yacs_file
- print yacs_scheme
-
+ yacs_scheme = generate_study_yacs(params)
+ yacs_scheme.saveScheme(yacs_file)
def find_or_create_coupling1d2d_case(self, filePath):
self.find_or_create_hydro_component()