forked from simetenn/uncertainpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
139 lines (107 loc) · 4.25 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# -*- coding: utf-8 -*-
try:
from setuptools import setup, find_packages
except ImportError:
raise ImportError(
"Setuptools is needed to install all dependencies: https://pypi.python.org/pypi/setuptools"
)
import platform
import os
import sys
name = "uncertainpy"
description = "A python toolbox for uncertainty quantification and sensitivity analysis tailored towards neuroscience models."
long_description = """Uncertainpy is a python toolbox for uncertainty quantification and sensitivity
analysis tailored towards computational neuroscience.
Uncertainpy is model independent and treats the model as a black box where the
model can be left unchanged. Uncertainpy implements both quasi-Monte Carlo
methods and polynomial chaos expansions using either point collocation or the
pseudo-spectral method. Both of the polynomial chaos expansion methods have
support for the rosenblatt transformation to handle dependent input parameters.
Uncertainpy is feature based, i.e., if applicable, it recognizes and calculates
the uncertainty in features of the model, as well as the model itself.
Examples of features in neuroscience can be spike timing and the action
potential shape.
Uncertainpy is tailored towards neuroscience models, and comes with several
common neuroscience models and features built in, but new models and features can
easily be implemented. It should be noted that while Uncertainpy is tailored
towards neuroscience, the implemented methods are general, and Uncertainpy can
be used for many other types of models and features within other fields.
"""
uncertainpy_require = [
"chaospy>=3.3.0",
"tqdm",
"h5py",
"multiprocess",
"numpy>=1.16",
"scipy>=1.4.1",
"seaborn",
"matplotlib>=3,<3.2",
"xvfbwrapper",
"six",
"exdir",
"ruamel.yaml",
"salib",
]
efel_features = ["efel"]
network_features = ["elephant", "neo", "quantities"]
all_uncertainpy_requires = uncertainpy_require + efel_features + network_features
test_dependencies = ["click"]
tests_require = all_uncertainpy_requires + test_dependencies
docs_dependencies = ["sphinx", "sphinx_rtd_theme"]
docs_require = all_uncertainpy_requires + docs_dependencies
all_requires = docs_require + test_dependencies + docs_dependencies
extras_require = {
"efel_features": efel_features,
"network_features": network_features,
"all": all_uncertainpy_requires,
"docs": docs_require,
"all_extras": all_requires,
"tests": tests_require,
}
# To install on read the docs
if os.environ.get("READTHEDOCS") == "True":
# uncertainpy_require = ["mock"]
uncertainpy_require = []
help_text = """
Custom options:
--all_extras Install with all dependencies, along with extra dependencies.
--all Install with all dependencies required by Uncertainpy
--tests Install with dependencies required to run tests
--docs Install with dependencies required to build the docs
--network_features Install with dependencies required by NetworkFeatures
--efel_features Install with dependencies required by EfelFeatures
"""
if "--help" in sys.argv or "-h" in sys.argv:
print(help_text)
if "--all_extras" in sys.argv:
uncertainpy_require = all_requires
sys.argv.remove("--all_extras")
if "--all" in sys.argv:
uncertainpy_require = all_uncertainpy_requires
sys.argv.remove("--all")
if "--tests" in sys.argv:
uncertainpy_require = tests_require
sys.argv.remove("--tests")
if "--network_features" in sys.argv:
uncertainpy_require = uncertainpy_require + network_features
sys.argv.remove("--network_features")
if "--efel_features" in sys.argv:
uncertainpy_require = uncertainpy_require + efel_features
sys.argv.remove("--efel_features")
# Get version
exec(open(os.path.join("src", "uncertainpy", "_version.py")).read())
setup(
name=name,
version=__version__,
url="https://github.com/simetenn/uncertainpy",
author="Simen Tennøe",
description=description,
license="GNU GPLv3",
keywords="uncertainty quantification sensitivity analysis neuroscience",
long_description=long_description,
python_requires=">=3",
packages=find_packages("src"),
package_dir={"": "src"},
install_requires=uncertainpy_require,
extras_require=extras_require,
)