From 69e3e32264a2ef17eaf8357bb9f430a7aeee6c07 Mon Sep 17 00:00:00 2001 From: David Bold Date: Mon, 2 Dec 2024 14:53:43 +0100 Subject: [PATCH] Fix renaming in case a new section is needed Fixes #120 --- src/boutdata/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boutdata/data.py b/src/boutdata/data.py index 20171e7..247dc3d 100644 --- a/src/boutdata/data.py +++ b/src/boutdata/data.py @@ -359,7 +359,7 @@ def get_immediate_parent_and_child(path): # Renaming a child key just within the same parent section, we can preserve # the order - if new_parent is old_parent: + if new_parent is old_parent and ":" not in new_name: new_parent._keys = rename_key(new_parent._keys, new_child, old_child) new_parent.comments = rename_key( new_parent.comments, new_child, old_child