-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·101 lines (84 loc) · 3.37 KB
/
setup.py
File metadata and controls
executable file
·101 lines (84 loc) · 3.37 KB
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
92
93
94
95
96
97
98
99
100
101
from setuptools import setup, Extension
import os
import platform
# DIFFRACTEM - tools for processing Serial Electron Diffraction Data
# Copyright (C) 2020 Robert Bücker
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# This library uses peakfinder8 for peak finding, written by Anton Barty,
# Valerio Mariani, and Oleksandr Yefanov;
# Copyright 2014-2019 Deutsches Elektronen-Synchrotron DESY
### ---
# peakfinder8 Cython version adapted from OnDA: https://github.com/ondateam/onda
try:
import numpy
except (ModuleNotFoundError, NameError):
print('NumPy is not installed. Please install it before diffractem via:\n'
'pip install numpy')
DIFFRACTEM_USE_CYTHON = os.getenv("DIFFRACTEM_USE_CYTHON")
ext = ".pyx" if DIFFRACTEM_USE_CYTHON else ".c" # pylint: disable=invalid-name
if platform.uname().system == 'Windows':
libraries = []
pass
else:
libraries = ["stdc++"]
pass
peakfinder8_ext = Extension( # pylint: disable=invalid-name
name="diffractem.peakfinder8_extension",
include_dirs=[numpy.get_include()],
libraries=libraries,
sources=[
"src/peakfinder8_extension/peakfinder8.cpp",
"src/peakfinder8_extension/peakfinder8_extension.pyx",
]
if DIFFRACTEM_USE_CYTHON
else [
"src/peakfinder8_extension/peakfinder8_extension.cpp",
"src/peakfinder8_extension/peakfinder8.cpp",
],
language="c++",
)
if DIFFRACTEM_USE_CYTHON:
from Cython.Build import cythonize
print('USING CYTHON')
extensions = cythonize(peakfinder8_ext) # pylint: disable=invalid-name
else:
extensions = [peakfinder8_ext] # pylint: disable=invalid-name
### ---
setup(
name='diffractem',
version='0.4.1',
packages=['diffractem'],
url='https://github.com/robertbuecker/diffractem',
license='',
scripts=['bin/nxs2tif.py', 'bin/edview.py'],
# scripts=['bin/nxs2tif.py', 'bin/edview.py', 'bin/quick_proc.py'],
entry_points={
'console_scripts': [
'quick_proc = diffractem.quick_proc:main',
'stream2sol = diffractem.stream2sol:main'
],
},
author='Robert Buecker',
author_email='robert.buecker@cssb-hamburg.de',
description='Some tools for working with serial electron microscopy data.',
install_requires=['h5py', 'numpy', 'pandas', 'hdf5plugin',
'dask[complete]', 'tifffile', 'scipy', 'astropy',
'matplotlib', 'numba', 'pyqtgraph', 'pyyaml', 'scikit-learn',
'scikit-image', 'PyQt5'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
],
ext_modules = extensions,
include_package_data = True
)