-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
77 lines (72 loc) · 2.3 KB
/
Copy pathsetup.py
File metadata and controls
77 lines (72 loc) · 2.3 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
import numpy as np
from setuptools import setup, find_packages, Extension
from numpy._core._multiarray_umath import __cpu_features__ as cpu_has
__version__ = "0.0.1"
CFLAGS = ["-Ofast"]
if cpu_has["AVX2"]:
CFLAGS.append("-mavx2")
setup(
name="fastmap",
version=__version__,
packages=find_packages(),
license="MIT",
description="Optimized implementations of algorithms computing distance measures for Maps of Elections.",
classifiers=[
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
],
install_requires=[
"numpy",
],
python_requires=">=3.10",
extras_require={
"testing": [
"pytest",
"mapel",
"tqdm",
]
},
ext_modules=[
Extension(
name="fastmap._spear",
sources=["fastmap/pyspear.c"],
extra_compile_args=CFLAGS,
include_dirs=["fastmap/lap/", "fastmap/bap/", "fastmap/utils/"],
),
Extension(
name="fastmap._hamm",
sources=["fastmap/pyhamm.c"],
extra_compile_args=CFLAGS,
include_dirs=["fastmap/lap/", "fastmap/bap/", "fastmap/utils/"],
),
Extension(
name="fastmap._swap",
sources=["fastmap/pyswap.c"],
extra_compile_args=CFLAGS,
include_dirs=["fastmap/lap/"],
),
Extension(
name="fastmap._pairwise",
sources=["fastmap/pypairwise.c"],
extra_compile_args=CFLAGS,
include_dirs=["fastmap/lap/", "fastmap/qap/", "fastmap/utils/"],
),
Extension(
name="fastmap._swap_distance_between_potes",
sources=["fastmap/kkemeny/swap_distance_between_potes.c"],
extra_compile_args=CFLAGS,
),
Extension(
name="fastmap._local_search_kkemeny_single_k",
sources=["fastmap/kkemeny/local_search_kkemeny_single_k.c"],
extra_compile_args=CFLAGS,
include_dirs=["fastmap/kkemeny/"],
),
Extension(
name="fastmap._simulated_annealing",
sources=["fastmap/kkemeny/simulated_annealing.c"],
extra_compile_args=CFLAGS,
),
],
include_dirs=[np.get_include()],
)