aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pywarpx/__init__.py')
-rw-r--r--Python/pywarpx/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/pywarpx/__init__.py b/Python/pywarpx/__init__.py
index f0f4177d4..8b57f60fb 100644
--- a/Python/pywarpx/__init__.py
+++ b/Python/pywarpx/__init__.py
@@ -40,10 +40,16 @@ from .WarpX import warpx
from ._libwarpx import libwarpx
# This is a circular import and must happen after the import of libwarpx
-from . import picmi # isort:skip
+from . import picmi # isort:skip
+
+# intentionally query the value - only set once sim dimension is known
+def __getattr__(name):
+ # https://stackoverflow.com/a/57263518/2719194
+ if name == '__version__':
+ return libwarpx.__version__
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
# TODO
-#__version__ = cxx.__version__
#__doc__ = cxx.__doc__
#__license__ = cxx.__license__
#__author__ = cxx.__author__