From cee21328cfee5773373930923496da720acdf6e2 Mon Sep 17 00:00:00 2001
From: Ahmed Ilyas <ahmed.n.ilyas@gmail.com>
Date: Wed, 12 Mar 2025 12:51:16 +0100
Subject: [PATCH] Rebuild annotation model while parsing annotations

---
 nomad/metainfo/metainfo.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nomad/metainfo/metainfo.py b/nomad/metainfo/metainfo.py
index 1532e571e3..ccca5b7caa 100644
--- a/nomad/metainfo/metainfo.py
+++ b/nomad/metainfo/metainfo.py
@@ -1132,6 +1132,7 @@ class MSection(metaclass=MObjectMeta):
 
     def m_parse_annotations(self):
         for annotation_name, annotation in self.m_annotations.items():
+            AnnotationModel.model_rebuild()
             annotation_model = AnnotationModel.m_registry.get(annotation_name)
             if not annotation_model:
                 continue
-- 
GitLab