forked from KMCzajkowski/smuthi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
60 lines (54 loc) · 1.91 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
# -*- coding: utf-8 -*-
import os
from setuptools import setup
from setuptools.command.install import install
import pkg_resources
import os
import subprocess
import sys
class CustomInstallCommand(install):
"""Compile nfmds code."""
def run(self):
install.run(self)
# compile nfmds if not built on readthedocs
if ((sys.platform.startswith('linux') or sys.platform.startswith('darwin'))
and not os.environ.get('READTHEDOCS')):
nfmds_sources_dirname = pkg_resources.resource_filename('smuthi.nfmds', 'NFM-DS')
os.chdir(nfmds_sources_dirname + '/TMATSOURCES')
sys.stdout.write('Compiling sources at ' + nfmds_sources_dirname + ' ...')
sys.stdout.flush()
subprocess.call(['gfortran', 'TAXSYM_SMUTHI.f90', '-o', 'TAXSYM_SMUTHI.out'])
sys.stdout.write(' done.\n')
sys.stdout.flush()
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="SMUTHI",
version="0.8.6",
author="Amos Egel",
author_email="[email protected]",
url='https://gitlab.com/AmosEgel/smuthi',
description="Light scattering by multiple particles in thin-film systems",
long_description=read('README.rst'),
packages=['smuthi', 'smuthi.nfmds'],
cmdclass={'install': CustomInstallCommand},
package_data={'smuthi.nfmds': ['NFM-DS/*.txt', 'NFM-DS/TMATSOURCES/*', 'NFM-DS/TMATFILES/*',
'NFM-DS/INPUTFILES/*.dat', 'NFM-DS/OUTPUTFILES/*'],
'smuthi': ['data/*']},
install_requires=[
'argparse',
'imageio',
'matplotlib',
'mpmath',
'numpy',
'numba',
'pywigxjpf',
'pyyaml',
'scipy',
'sympy',
'tqdm',
],
extras_require={'cuda': ['PyCuda']},
entry_points={'console_scripts': ['smuthi = smuthi.__main__:main']},
license='MIT',
)