-
Notifications
You must be signed in to change notification settings - Fork 11
/
aaaa_test_import.py
45 lines (35 loc) · 1.47 KB
/
aaaa_test_import.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
r"""
Test whether all Cython files were compiled correctly.
Copyright
---------
- This file is part of https://github.com/geomdata/gda-public/
- 2015, 2016, 2017 by Geometric Data Analytics, Inc. (http://geomdata.com)
- AGPL license. See `LICENSE` or https://github.com/geomdata/gda-public/blob/master/LICENSE
"""
"""
doctest discovery
Examples
--------
>>> test_cython()
"""
import os
msg = "Compiled Cython out-of-date. Please re-run 'python setup.py build_ext --inplace'"
def test_cython():
try:
import multidim.fast_algorithms as tda
import timeseries.fast_algorithms as barcode
import timeseries.curve_geometry as curve_geometry
import homology.dim0 as dim0
import homology.dim1 as dim1
if os.path.getmtime(tda.__file__) <= os.path.getmtime("multidim/fast_algorithms.pyx"):
assert False, ImportError(msg)
if os.path.getmtime(barcode.__file__) <= os.path.getmtime("timeseries/fast_algorithms.pyx"):
assert False, ImportError(msg)
if os.path.getmtime(curve_geometry.__file__) <= os.path.getmtime("timeseries/curve_geometry.pyx"):
assert False, ImportError(msg)
if os.path.getmtime(dim0.__file__) <= os.path.getmtime("homology/dim0.pyx"):
assert False, ImportError(msg)
if os.path.getmtime(dim1.__file__) <= os.path.getmtime("homology/dim1.pyx"):
assert False, ImportError(msg)
except ImportError:
assert False, ImportError(msg)