From bad15aac1e06d09184a4d6a332053425acafc6c8 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 24 Oct 2023 15:22:03 +0200 Subject: [PATCH] Fix _update_variable_names! --- src/run_spineopt_standard.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/run_spineopt_standard.jl b/src/run_spineopt_standard.jl index 9cceeb1b50..21f80ab9c5 100644 --- a/src/run_spineopt_standard.jl +++ b/src/run_spineopt_standard.jl @@ -933,8 +933,10 @@ end function _update_variable_names!(m) for (name, var) in m.ext[:spineopt].variables - for (ind, v) in var - _set_name(v, _base_name(name, ind)) + # NOTE: only update names for the representative variables + # This is achieved by using the indices function from the variable definition + for ind in m.ext[:spineopt].variables_definition[name][:indices](m) + _set_name(var[ind], _base_name(name, ind)) end end end