source: orange/Orange/__init__.py @ 10651:4f6fcf57db06

Revision 10651:4f6fcf57db06, 3.4 KB checked in by markotoplak, 2 years ago (diff)

Moved caching, collections, debugging, fileutil, r, testing from misc to utils.

Line 
1from __future__ import absolute_import
2
3__version__ = "2.5a4"
4
5from . import orange
6
7# Definitely ugly, but I see no other workaround.
8# When, e.g. data.io executes "from orange import ExampleTable"
9# orange gets imported again since it is not in sys.modules
10# before this entire file is executed
11import sys
12sys.modules["orange"] = orange
13
14import warnings
15
16alreadyWarned = False
17disabledMsg = "Some features will be disabled due to failing modules\n"
18def _import(name):
19    global alreadyWarned
20    try:
21        __import__(name, globals(), locals(), [], -1)
22    except ImportError, err:
23        warnings.warn("%sImporting '%s' failed: %s" %
24            (disabledMsg if not alreadyWarned else "", name, err),
25            UserWarning, 2)
26        alreadyWarned = True
27
28_import("misc")
29_import("data")
30_import("data.io")
31_import("data.sample")
32_import("data.outliers")
33_import("data.preprocess")
34_import("data.preprocess.scaling")
35_import("data.utils")
36_import("data.discretization")
37_import("data.continuization")
38_import("data.filter")
39_import("data.imputation")
40
41_import("feature")
42_import("feature.construction")
43_import("feature.construction.functionDecomposition")
44_import("feature.construction.univariate")
45_import("feature.discretization")
46_import("feature.imputation")
47_import("feature.scoring")
48_import("feature.selection")
49
50_import("network")
51
52_import("stat")
53
54_import("statistics")
55_import("statistics.estimate")
56_import("statistics.contingency")
57_import("statistics.distribution")
58_import("statistics.basic")
59_import("statistics.evd")
60
61_import("classification")
62_import("classification.tree")
63
64_import("classification.rules")
65
66_import("classification.lookup")
67_import("classification.bayes")
68_import("classification.svm")
69_import("classification.logreg")
70_import("classification.knn")
71_import("classification.majority")
72
73_import("optimization")
74
75_import("projection")
76_import("projection.linear")
77_import("projection.mds")
78_import("projection.som")
79
80_import("ensemble")
81_import("ensemble.bagging")
82_import("ensemble.boosting")
83_import("ensemble.forest")
84_import("ensemble.stacking")
85
86_import("regression")
87_import("regression.base")
88_import("regression.earth")
89_import("regression.lasso")
90_import("regression.linear")
91_import("regression.mean")
92_import("regression.pls")
93_import("regression.tree")
94
95_import("multitarget")
96_import("multitarget.tree")
97
98_import("multilabel")
99_import("multilabel.multibase")
100_import("multilabel.br")
101_import("multilabel.lp")
102_import("multilabel.mlknn")
103_import("multilabel.brknn")
104_import("multilabel.mulan")
105
106_import("associate")
107
108_import("distance")
109
110_import("wrappers")
111
112_import("featureConstruction")
113_import("featureConstruction.univariate")
114_import("featureConstruction.functionDecomposition")
115
116_import("evaluation")
117_import("evaluation.scoring")
118_import("evaluation.testing")
119_import("evaluation.reliability")
120
121_import("clustering")
122_import("clustering.kmeans")
123_import("clustering.hierarchical")
124_import("clustering.consensus")
125
126_import("misc")
127_import("misc.selection")
128
129_import("utils") #TODO hide utils from the user
130_import("utils.environ")
131_import("utils.counters")
132_import("utils.addons")
133_import("utils.render")
134_import("utils.serverfiles")
135#
136try:
137    from . import version
138    # Always use short_version here (see PEP 386)
139    __version__ = version.short_version
140    __hg_revision__ = version.hg_revision
141except ImportError:
142    # Leave the default version defined at the top.
143    pass
144
145del _import
146del alreadyWarned
147del disabledMsg
Note: See TracBrowser for help on using the repository browser.