Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
trying to parametrize as it has been advised
  • Loading branch information
bazkiaei committed Oct 9, 2018
1 parent 308168f commit 94273a2
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions gunagala/tests/test_psf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,25 +120,31 @@ def test_pixellated_square(psf, image_size):


@pytest.mark.parametrize("psf, image_size", [
(psf_moffat(), (21, 21)),
(psf_pixellated(), (21, 21)),
(psf_moffat(), (7, 9)),
(psf_pixellated(), (7, 9))],
ids=["moffat", "pixellated"]
(psf_pixellated(), (7, 9))]
)
def test_pixellated_rectangle(psf, image_size):
assert isinstance(psf.pixellated(size=(7.2, 9.2)), np.ndarray)
assert psf.pixellated(size=(7.2, 9.2)).shape == image_size
assert (psf.pixellated(size=(7.2, 9.2)) >= 0).all()
assert np.isfinite(psf.pixellated(size=(7.2, 9.2))).all()


@pytest.mark.parametrize("psf, image_size", [
(psf_moffat(), (21, 21)),
(psf_pixellated(), (21, 21))],
assert isinstance(psf.pixellated(), np.ndarray)
assert isinstance(psf.pixellated(size=(
image_size[0] + 0.2, image_size[1] + 0.2)), np.ndarray)
assert psf.pixellated(size=(
image_size[0] + 0.2, image_size[1] + 0.2)).shape == image_size
assert (psf.pixellated(size=(
image_size[0] + 0.2, image_size[1] + 0.2)) >= 0).all()
assert np.isfinite(psf.pixellated(size=(
image_size[0] + 0.2, image_size[1] + 0.2))).all()


@pytest.mark.parametrize("psf", [
(psf_moffat()),
(psf_pixellated())],
ids=["moffat", "pixellated"]
)
def test_pixellated_offsets(psf, image_size):
assert isinstance(psf.pixellated(), np.ndarray)
assert psf.pixellated().shape == image_size
def test_pixellated_offsets(psf):
assert isinstance(psf.pixellated(offsets=(0.3, -0.7)), np.ndarray)
assert psf.pixellated().shape == (21, 21)
assert (psf.pixellated() >= 0).all()
assert np.isfinite(psf.pixellated()).all()

Expand Down

0 comments on commit 94273a2

Please sign in to comment.