Skip to content

Commit 2e38d89

Browse files
black formatting
1 parent 3095071 commit 2e38d89

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

pymc3/distributions/distribution.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -943,9 +943,9 @@ def _draw_value(param, point=None, givens=None, size=None):
943943

944944

945945
def _is_one_d(dist_shape):
946-
if hasattr(dist_shape, "dshape") and dist_shape.dshape in { (), }:
946+
if hasattr(dist_shape, "dshape") and dist_shape.dshape in {()}:
947947
return True
948-
elif hasattr(dist_shape, "shape") and dist_shape.shape in { (), }:
948+
elif hasattr(dist_shape, "shape") and dist_shape.shape in {()}:
949949
return True
950950
return False
951951

pymc3/tests/test_distributions_random.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,24 @@ def test_scalar_distribution_shape(self, shape, size):
255255
exp_size = self.default_size if size is None else tuple(np.atleast_1d(size))
256256
expected = exp_size + exp_shape
257257
actual = np.shape(self.sample_random_variable(rv, size))
258-
assert expected == actual, f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
258+
assert (
259+
expected == actual
260+
), f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
259261

260262
@pytest.mark.parametrize("size", [None, ()], ids=str)
261-
@pytest.mark.parametrize("shape", [None, (), (1,), (1, 1), (1, 2), (10, 11, 1), (9, 10, 2)], ids=str)
263+
@pytest.mark.parametrize(
264+
"shape", [None, (), (1,), (1, 1), (1, 2), (10, 11, 1), (9, 10, 2)], ids=str
265+
)
262266
def test_scalar_sample_shape(self, shape, size):
263267
""" Draws samples of scalar [size] from a [shape] RV. """
264268
rv = self.get_random_variable(shape)
265269
exp_shape = self.default_shape if shape is None else tuple(np.atleast_1d(shape))
266270
exp_size = self.default_size if size is None else tuple(np.atleast_1d(size))
267271
expected = exp_size + exp_shape
268272
actual = np.shape(self.sample_random_variable(rv, size))
269-
assert expected == actual, f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
273+
assert (
274+
expected == actual
275+
), f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
270276

271277
@pytest.mark.parametrize("size", [None, 3, (4, 5)], ids=str)
272278
@pytest.mark.parametrize("shape", [None, 1, (10, 11, 1)], ids=str)
@@ -277,7 +283,9 @@ def test_vector_params(self, shape, size):
277283
exp_size = self.default_size if size is None else tuple(np.atleast_1d(size))
278284
expected = exp_size + exp_shape
279285
actual = np.shape(self.sample_random_variable(rv, size))
280-
assert expected == actual, f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
286+
assert (
287+
expected == actual
288+
), f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
281289

282290

283291
class TestGaussianRandomWalk(BaseTestCases.BaseTestCase):

0 commit comments

Comments
 (0)