From a8dac979f6755dc195bb28cf7a07e50b1b3d3784 Mon Sep 17 00:00:00 2001 From: raushan Date: Tue, 29 Oct 2024 12:30:12 +0100 Subject: [PATCH] fix modular for logger --- utils/modular_model_converter.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/utils/modular_model_converter.py b/utils/modular_model_converter.py index c107a483186231..3d1d3914581247 100644 --- a/utils/modular_model_converter.py +++ b/utils/modular_model_converter.py @@ -38,7 +38,8 @@ # value from the dependency is used, then mapped to current name convention, resulting in wrong value. # The corresponding mapped value is used to define the file target for the assignment ASSIGNMENTS_TO_KEEP = { - "_CHECKPOINT_FOR_DOC": "modeling", + "logger": ["configuration", "modeling"], + "_CHECKPOINT_FOR_DOC": ["modeling"], } AUTO_GENERATED_MESSAGE = """# 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 @@ -842,11 +843,12 @@ def leave_SimpleStatementLine(self, original_node, updated_node): return updated_node elif m.matches(original_node, m.SimpleStatementLine(body=[m.Assign()])): if original_node.body[0].targets[0].target.value in ASSIGNMENTS_TO_KEEP.keys(): - file_ = ASSIGNMENTS_TO_KEEP[original_node.body[0].targets[0].target.value] - self.files[file_][original_node.body[0].targets[0].target.value] = { - "node": original_node, - "insert_idx": self.global_scope_index, - } + files = ASSIGNMENTS_TO_KEEP[original_node.body[0].targets[0].target.value] + for file_ in files: + self.files[file_][original_node.body[0].targets[0].target.value] = { + "node": original_node, + "insert_idx": self.global_scope_index, + } self.global_scope_index += 100 return updated_node