-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpandas.patch
95 lines (83 loc) · 3.56 KB
/
pandas.patch
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
diff --git a/wrappers/pyAgrum/testunits/testsOnPython.py b/wrappers/pyAgrum/testunits/testsOnPython.py
index 04706b583..583ea03e5 100644
--- a/wrappers/pyAgrum/testunits/testsOnPython.py
+++ b/wrappers/pyAgrum/testunits/testsOnPython.py
@@ -66,7 +66,8 @@ def runTests(local: bool, test_module, log) -> int:
from tests import BNLearnerTestSuite
from tests import BNListenerTestSuite
from tests import ConfigTestSuite
- from tests import DiscretizerTestSuite
+ if pandasFound:
+ from tests import DiscretizerTestSuite
from tests import EssentialGraphTestSuite
from tests import EvidenceTestSuite
from tests import GraphTestSuite
@@ -92,11 +93,12 @@ def runTests(local: bool, test_module, log) -> int:
from tests import VariablesTestSuite
- from tests import CausalASTTestSuite
- from tests import CausalDSepTestSuite
- from tests import CausalModelTestSuite
- from tests import CausalNonRegressionTestSuite
- from tests import CausalEffectEstimationTestSuite
+ if pandasFound:
+ from tests import CausalASTTestSuite
+ from tests import CausalDSepTestSuite
+ from tests import CausalModelTestSuite
+ from tests import CausalNonRegressionTestSuite
+ from tests import CausalEffectEstimationTestSuite
from tests import WorkaroundTestSuite
@@ -106,10 +108,11 @@ def runTests(local: bool, test_module, log) -> int:
from tests import CtbnIndependenceTestSuite
from tests import CtbnLearnerTestSuite
- from tests import CLGLearningTestSuite
- from tests import CLGSamplingTestSuite
- from tests import CLGCanonicalFormTestSuite
- from tests import CLGInferenceTestSuite
+ if pandasFound:
+ from tests import CLGLearningTestSuite
+ from tests import CLGSamplingTestSuite
+ from tests import CLGCanonicalFormTestSuite
+ from tests import CLGInferenceTestSuite
# from tests import MixtureModelTestSuite
@@ -126,7 +129,8 @@ def runTests(local: bool, test_module, log) -> int:
tl.append(BNLearnerTestSuite.ts)
tl.append(BNListenerTestSuite.ts)
tl.append(ConfigTestSuite.ts)
- tl.append(DiscretizerTestSuite.ts)
+ if pandasFound:
+ tl.append(DiscretizerTestSuite.ts)
tl.append(EssentialGraphTestSuite.ts)
tl.append(EvidenceTestSuite.ts)
tl.append(GraphTestSuite.ts)
@@ -149,11 +153,13 @@ def runTests(local: bool, test_module, log) -> int:
if test_module in {"", "causal"}:
log.info("testing 'causal'")
- tl.append(CausalASTTestSuite.ts)
- tl.append(CausalDSepTestSuite.ts)
- tl.append(CausalModelTestSuite.ts)
- tl.append(CausalNonRegressionTestSuite.ts)
- tl.append(CausalEffectEstimationTestSuite.ts)
+ if pandasFound:
+ tl.append(CausalASTTestSuite.ts)
+ tl.append(CausalDSepTestSuite.ts)
+ tl.append(CausalModelTestSuite.ts)
+ tl.append(CausalNonRegressionTestSuite.ts)
+ tl.append(CausalEffectEstimationTestSuite.ts)
+ log.warning("Pandas or sklearn not found.")
if test_module in {"", "skbn"}:
log.info("testing 'skbn'")
@@ -173,10 +179,13 @@ def runTests(local: bool, test_module, log) -> int:
if test_module in {"", "clg"}:
log.info("testing 'clg'")
- tl.append(CLGLearningTestSuite.ts)
- tl.append(CLGSamplingTestSuite.ts)
- tl.append(CLGCanonicalFormTestSuite.ts)
- tl.append(CLGInferenceTestSuite.ts)
+ if pandasFound:
+ tl.append(CLGLearningTestSuite.ts)
+ tl.append(CLGSamplingTestSuite.ts)
+ tl.append(CLGCanonicalFormTestSuite.ts)
+ tl.append(CLGInferenceTestSuite.ts)
+ else:
+ log.warning("Pandas or sklearn not found.")
tests = unittest.TestSuite(tl)