-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
91 lines (82 loc) · 3.41 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python
import sys
from setuptools import setup, Extension, distutils
from Cython.Build import cythonize
import versioneer
import numpy
if distutils.ccompiler.get_default_compiler() == 'msvc':
extra_compile_args = ['/openmp']
extra_link_args = None
else:
extra_compile_args = ['-fopenmp']
extra_link_args = ['-fopenmp']
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Physics',
]
install_requires = [
'xarray',
'periodictable',
'h5py'
]
directives = {'auto_pickle': True,
'embedsignature': True,
'language_level': 3,
'linetrace': False,
'profile': True,
'warn.undeclared': True,
'warn.unreachable': True,
'warn.maybe_uninitialized': True,
'warn.unused': True,
'warn.unused_arg': False,
'warn.unused_result': False,
'warn.multiple_declarators': True}
macros = []
# enable coverage by building cython files by running setup.py with
# `--with-cython-coverage` enabled
if '--with-cython-coverage' in sys.argv:
sys.argv.remove('--with-cython-coverage')
directives['linetrace'] = True
macros = [('CYTHON_TRACE', '1'), ('CYTHON_TRACE_NOGIL', '1')]
extensions = [Extension('javelin.fourier_cython', ['javelin/fourier_cython.pyx'],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=macros),
Extension('javelin.energies', ['javelin/energies.pyx'],
include_dirs=[numpy.get_include()], define_macros=macros),
Extension('javelin.mccore', ['javelin/mccore.pyx'],
include_dirs=[numpy.get_include()], define_macros=macros),
Extension('javelin.modifier', ['javelin/modifier.pyx'],
include_dirs=[numpy.get_include()], define_macros=macros),
Extension('javelin.random', ['javelin/random.pyx'], define_macros=macros)]
setup(
name='javelin',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Disordered materials modelling and single crystal diffuse scattering calculator',
long_description="""Javelin is inspired by DISCUS. It is written in python using modern
tools, Matplotlib and VTK for plotting, pandas for storing the
atomic structure and xarray for storing scattering simulations. It
is designed to play well with other atomic structure analysis
programs such as ASE and diffpy.
The scope of javelin is limited to X-ray and neutron single
crystal nuclear and magnetic diffuse scattering. It will have the
ability to model disorered structure and refine the structure
against experimental data.""",
url='http://javelin.readthedocs.io',
author='Ross Whitfield',
author_email='[email protected]',
license='MIT',
platforms='any',
packages=['javelin'],
classifiers=classifiers,
install_requires=install_requires,
ext_modules=cythonize(extensions, compiler_directives=directives)
)