From 99b5ff548890d9bd8a9b0ed1af79f6178cb8fcf2 Mon Sep 17 00:00:00 2001
From: David Grundfest <s233039@dtu.dk>
Date: Wed, 4 Sep 2024 14:41:17 +0200
Subject: [PATCH] Init

---
 qim3d/__init__.py | 50 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 qim3d/__init__.py

diff --git a/qim3d/__init__.py b/qim3d/__init__.py
new file mode 100644
index 00000000..119a2f42
--- /dev/null
+++ b/qim3d/__init__.py
@@ -0,0 +1,50 @@
+"""qim3d: A Python package for 3D image processing and visualization.
+
+The qim3d library is designed to make it easier to work with 3D imaging data in Python. 
+It offers a range of features, including data loading and manipulation,
+image processing and filtering, visualization of 3D data, and analysis of imaging results.
+
+Documentation available at https://platform.qim.dk/qim3d/
+
+"""
+
+__version__ = "0.4.1"
+
+
+import importlib as _importlib
+
+
+class _LazyLoader:
+    """Lazy loader to load submodules only when they are accessed"""
+
+    def __init__(self, module_name):
+        self.module_name = module_name
+        self.module = None
+
+    def _load(self):
+        if self.module is None:
+            self.module = _importlib.import_module(self.module_name)
+        return self.module
+
+    def __getattr__(self, item):
+        module = self._load()
+        return getattr(module, item)
+
+
+# List of submodules
+_submodules = [
+    "examples",
+    "generate",
+    "gui",
+    "io",
+    "models",
+    "processing",
+    "tests",
+    "utils",
+    "viz",
+    "cli",
+]
+
+# Creating lazy loaders for each submodule
+for submodule in _submodules:
+    globals()[submodule] = _LazyLoader(f"qim3d.{submodule}")
-- 
GitLab