Skip to content

Commit

Permalink
add some lines
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Dec 14, 2023
1 parent c5f97cf commit 2affe82
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/bin/ceasiompy_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def run_testcase(testcase_nb):
def run_modules_list(args_list):
"""Run a workflow from a CPACS file and a list of modules."""

if len(args_list) < 2:
if len(args_list) < 3:
print(
"\nAt least 2 arguments are required to run a CEASIOMpy, the first onw must be the"
"\nAt least 3 arguments are required to run a CEASIOMpy, the first onw must be the"
"CPACS file and the modules to run. You can add as many modules as you want."
)
return
Expand All @@ -133,14 +133,16 @@ def run_modules_list(args_list):
print(f"The CPACS file {cpacs_path} does not exist.")
return

modules_list = args_list[1:]
output_format = args_list[1]
modules_list = args_list[2:]

log.info("CEASIOMpy as been started from a command line")

workflow = Workflow()
workflow.cpacs_in = cpacs_path
workflow.modules_list = modules_list
workflow.module_optim = ["NO"] * len(modules_list)
workflow.output_format = output_format
workflow.write_config_file()

workflow.set_workflow()
Expand Down Expand Up @@ -173,10 +175,17 @@ def run_gui():
os.system(f"cd {STREAMLIT_PATH} && streamlit run CEASIOMpy.py")


def run_output(format):
def run_output(output):
"""Chose the format for the output mesh"""

log.info()
if output == "su2":
file_extension = "su2"
elif output == "edge":
file_extension = "bmsh"
else:
raise ValueError("Unsupported output format. Use 'su2' or 'edge'")

log.info(f"The chosen output format is: {file_extension}")


# =================================================================================================
Expand Down Expand Up @@ -225,7 +234,8 @@ def main():
type=str,
metavar="",
default="su2",
help="chose to generate a mesh for SU2 or m-Edge [su2, edge]",
choices=["su2", "cgns", "edge"],
help="chose to generate a mesh for SU2 or m-Edge [su2, cgns, edge]",
)

args = parser.parse_args()
Expand Down

0 comments on commit 2affe82

Please sign in to comment.