From 2676ad31095aeb95c35eabfbf4fc8583cc74162c Mon Sep 17 00:00:00 2001 From: aarya bahirat Date: Sat, 3 Jan 2026 10:47:55 +0530 Subject: [PATCH] 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. --- SU2_PY/SU2/io/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_PY/SU2/io/config.py b/SU2_PY/SU2/io/config.py index eba3ee41d6c8..a5e344728076 100755 --- a/SU2_PY/SU2/io/config.py +++ b/SU2_PY/SU2/io/config.py @@ -729,9 +729,9 @@ def read_config(filename): # hack - twl if "DV_VALUE_NEW" not in data_dict: - data_dict["DV_VALUE_NEW"] = [0] + data_dict["DV_VALUE_NEW"] = data_dict.get("DV_VALUE", [0]) if "DV_VALUE_OLD" not in data_dict: - data_dict["DV_VALUE_OLD"] = [0] + data_dict["DV_VALUE_OLD"] = data_dict.get("DV_VALUE", [0]) if "OPT_ITERATIONS" not in data_dict: data_dict["OPT_ITERATIONS"] = 100 if "OPT_ACCURACY" not in data_dict: