Skip to content

Commit 1a78390

Browse files
committed
moves string_types to vartypes module
1 parent 135da45 commit 1a78390

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pymc3/distributions/distribution.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,12 @@
44

55
from ..memoize import memoize
66
from ..model import Model, get_named_nodes
7-
import sys
7+
from ..vartypes import string_types
88

99

1010
__all__ = ['DensityDist', 'Distribution', 'Continuous', 'Discrete', 'NoDistribution', 'TensorType', 'draw_values']
1111

1212

13-
if sys.version_info[0] == 3:
14-
string_types = str
15-
else:
16-
string_types = basestring
17-
18-
1913
class Distribution(object):
2014
"""Statistical distribution"""
2115
def __new__(cls, name, *args, **kwargs):

pymc3/vartypes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
__all__ = ['bool_types', 'int_types', 'float_types', 'complex_types', 'continuous_types',
24
'discrete_types', 'default_type', 'typefilter']
35

@@ -21,6 +23,11 @@
2123
default_type = {'discrete': 'int64',
2224
'continuous': 'float64'}
2325

26+
if sys.version_info[0] == 3:
27+
string_types = str
28+
else:
29+
string_types = basestring
30+
2431

2532
def typefilter(vars, types):
2633
# Returns variables of type `types` from `vars`

0 commit comments

Comments
 (0)