kingdon 3.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
kingdon/__init__.py ADDED
@@ -0,0 +1,33 @@
1
+ """Top-level package for Kingdon."""
2
+
3
+ __author__ = """Martin Roelfs"""
4
+ __email__ = 'martinroelfs@yahoo.com'
5
+
6
+ import sys
7
+ import importlib.metadata
8
+
9
+ from sympy import symbols
10
+
11
+ from kingdon.algebra import Algebra
12
+ from kingdon.multivector import (
13
+ MultiVector, # Generic MultiVector type.
14
+ Scalar, Vector, Bivector, Trivector, Quadvector, Pentavector, Hexavector, Heptavector, Octovector, # k-vectors
15
+ Bireflection, # compositions
16
+ Direction, EVector, UPoint, Point, Translation, # PGA types
17
+ stack
18
+ )
19
+ from kingdon.matrixreps import expr_as_matrix
20
+
21
+ __version__ = importlib.metadata.version('kingdon')
22
+
23
+
24
+ def load_ipython_extension(ipython):
25
+ """ Register the :code:`%%graph` cell magic; called by :code:`%load_ext kingdon`. """
26
+ from kingdon.graph_magic import register_magics
27
+ register_magics(ipython)
28
+
29
+
30
+ # Register the magic when kingdon is imported into a running IPython, without importing IPython
31
+ # ourselves: if it is not already imported, there is no shell for us to register with anyway.
32
+ if (_ipython := sys.modules.get('IPython')) and (_shell := _ipython.get_ipython()):
33
+ load_ipython_extension(_shell)