From 344c13859ef51141b393c8c752e367873cbf8c65 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Mon, 31 May 2021 15:03:15 +0200
Subject: [PATCH] Update from LOFAR master

---
 lib/siplib.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/siplib.py b/lib/siplib.py
index 188f755..24ea8ed 100644
--- a/lib/siplib.py
+++ b/lib/siplib.py
@@ -43,6 +43,14 @@ VERSION = "SIPlib 0.4"
 ltasip.Namespace.setPrefix('sip')
 
 
+# The LTA catalogue expectes all lofar complexType objects to be annotated as xsi:type="<my_type>"
+# Trick pyxb into doing this, by override the _RequireXSIType, and make the xsitype required for out types.
+import inspect
+from pyxb.binding.basis import complexTypeDefinition
+for member in inspect.getmembers(ltasip, inspect.isclass):
+    if issubclass(member[1], complexTypeDefinition):
+        member[1]._RequireXSIType = classmethod(lambda _1, _2: True)
+
 # todo: create docstrings for everything.
 # specify types and explain purpose of the field (-> ask someone with more astronomical background)
 
-- 
GitLab