Skip to content

Commit

Permalink
apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed Nov 11, 2020
1 parent 3095071 commit b8849d2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pymc3/tests/test_distributions_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,24 @@ def test_scalar_distribution_shape(self, shape, size):
exp_size = self.default_size if size is None else tuple(np.atleast_1d(size))
expected = exp_size + exp_shape
actual = np.shape(self.sample_random_variable(rv, size))
assert expected == actual, f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
assert (
expected == actual
), f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"

@pytest.mark.parametrize("size", [None, ()], ids=str)
@pytest.mark.parametrize("shape", [None, (), (1,), (1, 1), (1, 2), (10, 11, 1), (9, 10, 2)], ids=str)
@pytest.mark.parametrize(
"shape", [None, (), (1,), (1, 1), (1, 2), (10, 11, 1), (9, 10, 2)], ids=str
)
def test_scalar_sample_shape(self, shape, size):
""" Draws samples of scalar [size] from a [shape] RV. """
rv = self.get_random_variable(shape)
exp_shape = self.default_shape if shape is None else tuple(np.atleast_1d(shape))
exp_size = self.default_size if size is None else tuple(np.atleast_1d(size))
expected = exp_size + exp_shape
actual = np.shape(self.sample_random_variable(rv, size))
assert expected == actual, f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"
assert (
expected == actual
), f"Sample size {size} from {shape}-shaped RV had shape {actual}. Expected: {expected}"

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


class TestGaussianRandomWalk(BaseTestCases.BaseTestCase):
Expand Down

0 comments on commit b8849d2

Please sign in to comment.