Skip to content

Commit 2676ad3

Browse files
committed
Fix DV_VALUE replacement bug in config.py (issue #2005)
- Initialize DV_VALUE_NEW and DV_VALUE_OLD from existing DV_VALUE - Prevents replacement of multi-value DV_VALUE with default [0] - Fixes error: 'DV_VALUE does not contain enough entries to match DV_KIND or DV_PARAM' The bug occurred when DV_VALUE_NEW/OLD were missing - they were initialized to [0] and then overwrote the original DV_VALUE. Now they inherit from DV_VALUE if it exists, preserving the original values.
1 parent e1befed commit 2676ad3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

SU2_PY/SU2/io/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,9 @@ def read_config(filename):
729729

730730
# hack - twl
731731
if "DV_VALUE_NEW" not in data_dict:
732-
data_dict["DV_VALUE_NEW"] = [0]
732+
data_dict["DV_VALUE_NEW"] = data_dict.get("DV_VALUE", [0])
733733
if "DV_VALUE_OLD" not in data_dict:
734-
data_dict["DV_VALUE_OLD"] = [0]
734+
data_dict["DV_VALUE_OLD"] = data_dict.get("DV_VALUE", [0])
735735
if "OPT_ITERATIONS" not in data_dict:
736736
data_dict["OPT_ITERATIONS"] = 100
737737
if "OPT_ACCURACY" not in data_dict:

0 commit comments

Comments
 (0)