1########################################################### 2# We check what extensions are available 3########################################################### 4__extensions__ = {'matplotlib': False, 'mplot3d': False, 5 'pygmo': False, 'scikit-learn': False, 'scipy': False, 6 'numba': False} 7# 1 - matplotlib 8try: 9 from matplotlib import __version__ as matplotlib_ver 10 __extensions__['matplotlib'] = True 11 12 # We detect the version and if more than 1.1.0 mplot3d is there 13 mver = matplotlib_ver.split('.') 14 mver = int(mver[0]) * 100 + int(mver[1]) * 10 15 if mver >= 110: 16 __extensions__['mplot3d'] = True 17 del mver 18except ImportError: 19 pass 20 21# 2 - pygmo2 22try: 23 from pygmo import __version__ as pygmo_ver 24 __extensions__['pygmo'] = True 25except ImportError: 26 pass 27 28# 3 - scikit-learn is installed 29try: 30 from sklearn import __version__ as sklearn_ver 31 __extensions__['scikit-learn'] = True 32except ImportError: 33 pass 34 35# 4 - scipy is installed 36try: 37 from scipy import __version__ as scipy_ver 38 __extensions__['scipy'] = True 39except ImportError: 40 pass 41 42# 5 - numba is installed 43try: 44 from numba import __version__ as numba_ver 45 __extensions__['numba'] = True 46except ImportError: 47 pass 48 49########################################################### 50# We import the submodules 51########################################################### 52 53# For convenience, bring all core classes into the root namespace when 54# importing *. 55from pykep.core import * 56from pykep import core, sims_flanagan, pontryagin, orbit_plots, examples, phasing, util, planet, trajopt 57 58 59########################################################### 60# We define pykep module 61########################################################### 62version = '@pykep_VERSION@' 63__doc__ = 'pykep is the answer ... but what was the question?' 64__all__ = ['core', 'sims_flanagan', 'pontryagin', 'orbit_plots', 65 'examples', 'trajopt', 'phasing', 'util', 'planet', 'test'] 66__version__ = {'major': int(version.split('.')[0]), 'minor': int(version.split('.')[1])} 67__all__ += [name for name in dir(core) if not name.startswith('_')] 68