Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions yt/visualization/tests/test_image_comp_2D_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import matplotlib as mpl
import numpy as np
import numpy.testing as npt
import numpy.testing as nptesting
import pytest
from matplotlib.colors import SymLogNorm

Expand Down Expand Up @@ -38,7 +38,7 @@ def test_sliceplot_set_unit_and_zlim_order():
im0 = p0.plots[field].image._A
im1 = p1.plots[field].image._A

npt.assert_allclose(im0, im1)
nptesting.assert_allclose(im0, im1)


def test_annotation_parse_h():
Expand Down Expand Up @@ -69,7 +69,7 @@ def test_annotation_parse_h():
img2 = p2.plots["gas", "density"].figure.canvas.renderer.buffer_rgba()

# This should be the same image
npt.assert_allclose(img1, img2)
nptesting.assert_allclose(img1, img2)


@pytest.mark.mpl_image_compare
Expand Down
16 changes: 8 additions & 8 deletions yt/visualization/tests/test_set_zlim.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import numpy.testing as npt
import numpy.testing as nptesting
import pytest

from yt.testing import fake_amr_ds
Expand All @@ -24,15 +24,15 @@ def test_float_vmin_then_set_unit():
p.render()
cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_almost_equal(new_lims, desired_lims)
nptesting.assert_almost_equal(new_lims, desired_lims)

# 1 g/cm**3 == 1000 kg/m**3
p.set_unit(field, "kg/m**3")
p.render()

cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_almost_equal(new_lims, 1000 * desired_lims)
nptesting.assert_almost_equal(new_lims, 1000 * desired_lims)


def test_set_unit_then_float_vmin():
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_reset_zlim():

cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_array_equal(new_lims, raw_lims)
nptesting.assert_array_equal(new_lims, raw_lims)


def test_set_dynamic_range_with_vmin():
Expand All @@ -86,7 +86,7 @@ def test_set_dynamic_range_with_vmin():
p.render()
cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_almost_equal(new_lims, (zmin, 2 * zmin))
nptesting.assert_almost_equal(new_lims, (zmin, 2 * zmin))


def test_set_dynamic_range_with_vmax():
Expand All @@ -102,7 +102,7 @@ def test_set_dynamic_range_with_vmax():
p.render()
cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_almost_equal(new_lims, (zmax / 2, zmax))
nptesting.assert_almost_equal(new_lims, (zmax / 2, zmax))


def test_set_dynamic_range_with_min():
Expand All @@ -121,7 +121,7 @@ def test_set_dynamic_range_with_min():
p.render()
cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_almost_equal(new_lims, (vmin, 2 * vmin))
nptesting.assert_almost_equal(new_lims, (vmin, 2 * vmin))


def test_set_dynamic_range_with_None():
Expand All @@ -141,4 +141,4 @@ def test_set_dynamic_range_with_None():
p.render()
cb = p.plots[field].image.colorbar
new_lims = np.array((cb.vmin, cb.vmax))
npt.assert_almost_equal(new_lims, (vmin, 2 * vmin))
nptesting.assert_almost_equal(new_lims, (vmin, 2 * vmin))
Loading