# coding: utf-8

from __future__ import division, print_function

__author__ = "adrn <adrn@astro.columbia.edu>"

# Standard library
import os, sys
from distutils.core import setup
from distutils.extension import Extension

# Third-party
import numpy as np
from Cython.Distutils import build_ext
from Cython.Build import cythonize

# Get numpy path
numpy_base_path = os.path.split(np.__file__)[0]
numpy_incl_path = os.path.join(numpy_base_path, "core", "include")

extensions = []

potential = Extension("gary.potential.*",
                      ["gary/potential/*.pyx"],
                      include_dirs=[numpy_incl_path])
extensions.append(potential)

integrate = Extension("gary.integrate.*",
                      ["gary/integrate/*.pyx"],
                      include_dirs=[numpy_incl_path])
extensions.append(integrate)

# dynamics = Extension("gary.dynamics.*",
#                      ["gary/dynamics/*.pyx"],
#                      include_dirs=[numpy_incl_path])
# extensions.append(dynamics)

setup(
    name="gary",
    version="0.1",
    author="Adrian M. Price-Whelan",
    author_email="adrn@astro.columbia.edu",
    license="MIT",
    cmdclass={'build_ext': build_ext},
    ext_modules=cythonize(extensions),
    packages=["gary", "gary.coordinates", "gary.io",
              "gary.observation", "gary.integrate",
              "gary.dynamics", "gary.inference",
              "gary.potential"],
    scripts=['bin/plotsnap', 'bin/moviesnap', 'bin/snap2gal'],
    package_data={'gary.potential': ['*.pxd']},
)

@@ -822,16 +822,258 @@
 grate)%0A%0A
+dopri = Extension(%22gary.integrate.dopri.wrap_dop853%22,%0A                  %5B%22gary/integrate/dopri/wrap_dop853.pyx%22,%0A                   %22gary/integrate/dopri/dop853.c%22%5D,%0A                  include_dirs=%5Bnumpy_incl_path%5D)%0Aextensions.append(dopri)%0A%0A
 # dynami

build dopri