-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy path__init__.py
More file actions
executable file
·94 lines (84 loc) · 2.13 KB
/
__init__.py
File metadata and controls
executable file
·94 lines (84 loc) · 2.13 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
"""Coordinate-, image-, and effect-size-based meta-analysis estimators."""
from importlib import import_module
from . import ibma, kernel
from .cbma import (
ALE,
KDA,
SCALE,
ALESubtraction,
BalancedALESubtraction,
MKDAChi2,
MKDADensity,
ale,
mkda,
)
from .ibma import (
DerSimonianLaird,
Fishers,
Hedges,
PermutedOLS,
SampleSizeBasedLikelihood,
Stouffers,
VarianceBasedLikelihood,
WeightedLeastSquares,
)
from .kernel import ALEKernel, KDAKernel, MKDAKernel
_OPTIONAL_SUBMODULES = {
"cbmr": ".cbmr",
"models": ".models",
"spatial_cbmr": ".spatial_cbmr",
}
_OPTIONAL_EXPORTS = {
"CBMREstimator": (".cbmr", "CBMREstimator"),
"CBMRInference": (".cbmr", "CBMRInference"),
"CBMRResult": (".cbmr", "CBMRResult"),
"SpatialCBMREstimator": (".spatial_cbmr", "SpatialCBMREstimator"),
"SpatialCBMRInference": (".spatial_cbmr", "SpatialCBMRInference"),
"SpatialCBMRResult": (".spatial_cbmr", "SpatialCBMRResult"),
}
def __getattr__(name):
"""Lazily import optional CBMR modules and exports."""
if name in _OPTIONAL_SUBMODULES:
module = import_module(_OPTIONAL_SUBMODULES[name], __name__)
globals()[name] = module
return module
if name in _OPTIONAL_EXPORTS:
module_name, attr_name = _OPTIONAL_EXPORTS[name]
module = import_module(module_name, __name__)
attr = getattr(module, attr_name)
globals()[name] = attr
return attr
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
__all__ = [
"ALE",
"ALESubtraction",
"BalancedALESubtraction",
"SCALE",
"MKDADensity",
"MKDAChi2",
"KDA",
"CBMREstimator",
"CBMRInference",
"CBMRResult",
"SpatialCBMREstimator",
"SpatialCBMRInference",
"SpatialCBMRResult",
"DerSimonianLaird",
"Fishers",
"Hedges",
"PermutedOLS",
"SampleSizeBasedLikelihood",
"Stouffers",
"VarianceBasedLikelihood",
"WeightedLeastSquares",
"MKDAKernel",
"ALEKernel",
"KDAKernel",
"kernel",
"ibma",
"cbmr",
"spatial_cbmr",
"models",
"ale",
"mkda",
]