Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error in Fortran_to_Aviary.py #128

Merged
merged 4 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions aviary/utils/Fortran_to_Aviary.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ def create_aviary_deck(fortran_deck: str, legacy_code=None, defaults_deck=None,

fortran_deck: Path = get_path(fortran_deck, verbose=False)

if not out_file:
if out_file:
out_file = Path(out_file)
else:
name = fortran_deck.stem
out_file: Path = fortran_deck.parents / name + '_converted.csv'
out_file: Path = fortran_deck.parent.resolve().joinpath(name + '_converted.csv')

if legacy_code is GASP:
default_extension = '.dat'
Expand Down Expand Up @@ -361,7 +363,8 @@ def update_gasp_options(vehicle_data):
if isinstance(design_range, list):
# if the design range target_range value is 0, set the problem_type to fallout
if design_range[0] == 0:
input_values.set_val('problem_type', ['fallout'])
problem_type = 'fallout'
input_values.set_val('problem_type', [problem_type])
design_range = 0
if problem_type == 'sizing':
design_range = design_range[0]
Expand Down Expand Up @@ -614,4 +617,4 @@ def _exec_F2A(args, user_args):
filepath = args.input_deck

create_aviary_deck(filepath, args.legacy_code, args.defaults_deck,
Path(args.out_file), args.force)
args.out_file, args.force)
Loading