-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtox.ini
More file actions
175 lines (156 loc) · 5 KB
/
Copy pathtox.ini
File metadata and controls
175 lines (156 loc) · 5 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#
# Setup and manage Python virtual environments that allow users to develop and
# test the surmise Python package.
#
[tox]
requires = tox>=4
env_list =
[testenv]
description = Run the surmise full test suite
passenv = COVERAGE_FILE
setenv =
COV_FILE = {env:COVERAGE_FILE:.coverage}
DOC_ROOT = docs
BOOK_ROOT = book
deps =
coverage: pytest-cov
usedevelop =
coverage: true
nocoverage: false
commands =
nocoverage: python -m pytest --pyargs surmise.tests
coverage: coverage run --rcfile={toxinidir}/.coveragerc --data-file={env:COV_FILE} -m pytest {toxinidir}/src/surmise/tests
[testenv:oldest]
# IMPORTANT
# Please make sure that all changes made here are consistent with the
# dependence/version information provided in setup.py.
#
# Use the oldest Python version allowed by package so that the package offers
# the most flexibility to users. Note that we are, therefore, not ensuring that
# the oldest packages are compatible with the newest Python version supported by
# the package.
description = Install all dependencies at oldest allowable version & test
basepython = py310
deps =
# Execution
numpy==1.22.0
scipy==1.9.0
dill==0.3.8
scikit-learn==1.2.0
usedevelop = true
commands =
python -m pip list
python -c 'import numpy ; exit(numpy.__version__ != "1.22.0")'
python -c 'import scipy ; exit(scipy.__version__ != "1.9.0")'
python -c 'import dill ; exit(dill.__version__ != "0.3.8")'
python -c 'import sklearn ; exit(sklearn.__version__ != "1.2.0")'
python -m pytest src/surmise
[testenv:emu_cal]
# The tests in this environment check for compatibility between the emulator and
# calibrator. They do not extensively test for accuracy or performance of the
# emulator or calibrator.
description = Run standard emulator/calibrator tests
usedevelop = true
commands = python -m pytest ./src/surmise/tests -k "not new"
[testenv:new_emu]
description = Run new emulator tests
usedevelop = true
commands = python -m pytest ./src/surmise/tests -k "new_emu"
[testenv:new_cal]
description = Run new calibrator tests
usedevelop = true
commands = python -m pytest ./src/surmise/tests -k "new_cal"
[testenv:only_emu]
description = Run new emulator tests
usedevelop = true
commands = python -m pytest -x ./src/surmise/tests -k "emu"
[testenv:only_cal]
description = Run new calibrator tests
usedevelop = true
commands = python -m pytest -x ./src/surmise/tests -k "cal"
[testenv:only_sampler]
description = Run sampler tests
usedevelop = true
commands = python -m pytest -x ./src/surmise/tests -k "cal_samplers"
[testenv:test_rng]
description = Run RNG related tests
usedevelop = true
commands = python -m pytest -x -s ./src/surmise/tests -k "rng"
[testenv:test_collector]
description = Collect all tests without running
usedevelop = true
commands = python -m pytest --collect-only ./src/surmise/tests
[testenv:report]
description = Generate coverage report as HTML
depends = coverage
deps = coverage
skip_install = true
commands =
coverage html --rcfile={toxinidir}/.coveragerc --data-file={env:COV_FILE}
coverage report --rcfile={toxinidir}/.coveragerc --data-file={env:COV_FILE}
[testenv:check]
# This should only *report* issues. It should *not* alter any files.
description = Run code quality checks
deps =
flake8
commands =
flake8 --config={toxinidir}/.flake8
[testenv:cythonize]
# IMPORTANT
# Match numpy version to the version used to compile the resultant .c files as
# specified in pyproject.toml.
description = Compile Cython .pyx files into .c files
deps =
setuptools
cython==3.2.4
numpy==2.1.2
skip_install = true
commands =
cythonize -f -a src/surmise/emulationsupport/matern_covmat.pyx
[testenv:html]
description = Generate surmise's documentation as HTML
deps =
sphinx
sphinxcontrib-bibtex
sphinx_rtd_theme
commands =
sphinx-build --version
sphinx-build -E --fail-on-warning -b html {env:DOC_ROOT} {env:DOC_ROOT}/build_html
[testenv:pdf]
description = Generate surmise's documentation as PDF file
deps =
sphinx
sphinxcontrib-bibtex
allowlist_externals = make
commands =
sphinx-build --version
sphinx-build -E --fail-on-warning -b latex {env:DOC_ROOT} {env:DOC_ROOT}/build_pdf
make -C {env:DOC_ROOT}/build_pdf
[testenv:book]
# This is a conservative build of the book from scratch each time. This should
# be used for official builds and testing.
description = Generate surmise examples in Jupyter book
deps =
pandas
matplotlib
seaborn
notebook
jupyter-book<2.0.0
nbdime
commands =
jupyter-book clean --all {env:BOOK_ROOT}
jupyter-book build --all --warningiserror {env:BOOK_ROOT}
[testenv:test_tool]
# This is a hidden, undocumented tox task that just sets up a venv that
# developers can use for now for testing/debugging samplers for the current
# development phase.
#
# surmise is loaded in editable/developer mode to facilitate interactive
# debugging.
description = Build a venv for running the external sampler testing tool
usedevelop = true
deps =
h5py
matplotlib
statsmodels
corner